mirror of
https://github.com/github/choosealicense.com
synced 2024-12-22 12:50:24 +01:00
make rubocop ruby version match pages ruby version
This commit is contained in:
parent
8a2dff3f74
commit
f08ace3feb
@ -1,5 +1,5 @@
|
|||||||
AllCops:
|
AllCops:
|
||||||
TargetRubyVersion: 2.1
|
TargetRubyVersion: 2.3
|
||||||
Exclude:
|
Exclude:
|
||||||
- _site/**/*
|
- _site/**/*
|
||||||
- vendor/**/*
|
- vendor/**/*
|
||||||
|
1
Gemfile
1
Gemfile
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
require 'json'
|
require 'json'
|
||||||
|
1
Rakefile
1
Rakefile
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require 'html-proofer'
|
require 'html-proofer'
|
||||||
require 'rspec/core/rake_task'
|
require 'rspec/core/rake_task'
|
||||||
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
# Checks if a given license meets the approval criteria to be added to choosealicense.com
|
# 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
|
# See https://github.com/github/choosealicense.com/blob/gh-pages/CONTRIBUTING.md#adding-a-license
|
||||||
# Usage: script/check-approval [SPDX LICENSE ID]
|
# Usage: script/check-approval [SPDX LICENSE ID]
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env ruby
|
#!/usr/bin/env ruby
|
||||||
|
# frozen_string_literal: true
|
||||||
# Usage: script/generate-docs
|
# Usage: script/generate-docs
|
||||||
# Reads in the fields, meta, and rules YAML files and produces markdown output
|
# Reads in the fields, meta, and rules YAML files and produces markdown output
|
||||||
# suitable for documenting in the project's README
|
# suitable for documenting in the project's README
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require 'json'
|
require 'json'
|
||||||
require 'open-uri'
|
require 'open-uri'
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'yaml'
|
require 'yaml'
|
||||||
|
|
||||||
describe 'ci ruby version' do
|
describe 'ruby version' do
|
||||||
pages_versions = JSON.parse(open('https://pages.github.com/versions.json').read)
|
pages_versions = JSON.parse(open('https://pages.github.com/versions.json').read)
|
||||||
pages_ruby_version = pages_versions['ruby']
|
pages_ruby_version = pages_versions['ruby']
|
||||||
|
|
||||||
ci_config_file = '.travis.yml'
|
ci_config_file = '.travis.yml'
|
||||||
|
|
||||||
ci_config = YAML.load_file(ci_config_file)
|
ci_config = YAML.load_file(ci_config_file)
|
||||||
ci_ruby_version = ci_config['rvm'][0]
|
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
|
expect(ci_ruby_version).to eql(pages_ruby_version), msg
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'byte order marks' do
|
describe 'byte order marks' do
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'license fillable fields' do
|
describe 'license fillable fields' do
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'license meta' do
|
describe 'license meta' do
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'license rules' do
|
describe 'license rules' do
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'shown licenses' do
|
describe 'shown licenses' do
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'licenses' do
|
describe 'licenses' do
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
require 'jekyll'
|
require 'jekyll'
|
||||||
require 'open-uri'
|
require 'open-uri'
|
||||||
require 'json'
|
require 'json'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user