make rubocop ruby version match pages ruby version
This commit is contained in:
Родитель
8a2dff3f74
Коммит
f08ace3feb
|
@ -1,5 +1,5 @@
|
|||
AllCops:
|
||||
TargetRubyVersion: 2.1
|
||||
TargetRubyVersion: 2.3
|
||||
Exclude:
|
||||
- _site/**/*
|
||||
- vendor/**/*
|
||||
|
|
1
Gemfile
1
Gemfile
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
source 'https://rubygems.org'
|
||||
|
||||
require 'json'
|
||||
|
|
1
Rakefile
1
Rakefile
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require 'html-proofer'
|
||||
require 'rspec/core/rake_task'
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'byte order marks' do
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'license fillable fields' do
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'license meta' do
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'license rules' do
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'shown licenses' do
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'licenses' do
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require 'jekyll'
|
||||
require 'open-uri'
|
||||
require 'json'
|
||||
|
|
Загрузка…
Ссылка в новой задаче