1
0
mirror of https://github.com/github/choosealicense.com synced 2024-06-18 09:49:54 +02:00

make rubocop ruby version match pages ruby version

This commit is contained in:
Mike Linksvayer 2017-01-18 13:31:19 -08:00
parent 8a2dff3f74
commit f08ace3feb
13 changed files with 26 additions and 3 deletions

View File

@ -1,5 +1,5 @@
AllCops:
TargetRubyVersion: 2.1
TargetRubyVersion: 2.3
Exclude:
- _site/**/*
- vendor/**/*

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
source 'https://rubygems.org'
require 'json'

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'html-proofer'
require 'rspec/core/rake_task'

View File

@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
# Checks if a given license meets the approval criteria to be added to choosealicense.com
# See https://github.com/github/choosealicense.com/blob/gh-pages/CONTRIBUTING.md#adding-a-license
# Usage: script/check-approval [SPDX LICENSE ID]

View File

@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
# Usage: script/generate-docs
# Reads in the fields, meta, and rules YAML files and produces markdown output
# suitable for documenting in the project's README

View File

@ -1,14 +1,14 @@
# frozen_string_literal: true
require 'json'
require 'open-uri'
require 'spec_helper'
require 'yaml'
describe 'ci ruby version' do
describe 'ruby version' do
pages_versions = JSON.parse(open('https://pages.github.com/versions.json').read)
pages_ruby_version = pages_versions['ruby']
ci_config_file = '.travis.yml'
ci_config = YAML.load_file(ci_config_file)
ci_ruby_version = ci_config['rvm'][0]
@ -18,4 +18,16 @@ describe 'ci ruby version' do
expect(ci_ruby_version).to eql(pages_ruby_version), msg
end
end
rubocop_config_file = '.rubocop.yml'
rubocop_config = YAML.load_file(rubocop_config_file)
rubocop_ruby_version = rubocop_config['AllCops']['TargetRubyVersion']
pages_ruby_version_minor = pages_ruby_version.match('^(\d+)\.(\d+)')[0]
context "in #{rubocop_config_file} and pages ruby minor version" do
it 'match' do
msg = "#{rubocop_ruby_version} != #{pages_ruby_version_minor}; please add a commit bumping in #{rubocop_config_file}"
expect(rubocop_ruby_version.to_s).to eql(pages_ruby_version_minor), msg
end
end
end

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'byte order marks' do

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'license fillable fields' do

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'license meta' do

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'license rules' do

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'shown licenses' do

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'spec_helper'
describe 'licenses' do

View File

@ -1,3 +1,4 @@
# frozen_string_literal: true
require 'jekyll'
require 'open-uri'
require 'json'