From c46992e0294f80b90c302415ff1bdef28b7eee77 Mon Sep 17 00:00:00 2001 From: whereismyjetpack Date: Tue, 12 Jul 2022 15:17:44 -0400 Subject: [PATCH 1/4] updates rubocop --- .github/workflows/ci.yml | 2 +- exe/niftany | 2 +- niftany.gemspec | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2f22ef..f146d8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['2.6', '2.7'] + ruby-version: ['2.6', '2.7', '3.1'] steps: - uses: actions/checkout@v2 diff --git a/exe/niftany b/exe/niftany index 5f1a06f..0ff0249 100755 --- a/exe/niftany +++ b/exe/niftany @@ -10,7 +10,7 @@ require 'scss_lint/cli' require 'colorize' def parse_opts(args) - options = OpenStruct.new + options = Struct.new options.auto_correct = false options.parallel = false diff --git a/niftany.gemspec b/niftany.gemspec index ce0e8c5..bde1eec 100644 --- a/niftany.gemspec +++ b/niftany.gemspec @@ -2,10 +2,11 @@ Gem::Specification.new do |spec| spec.name = 'niftany' - spec.version = '0.9.0' + spec.version = '0.10.0' + spec.metadata = { 'rubygems_mfa_required' => 'true' } spec.authors = ['Adam Wead'] spec.email = ['amsterdamos@gmail.com'] - spec.summary = 'Manages configurations and versions of linters used in projects at '\ + spec.summary = 'Manages configurations and versions of linters used in projects at ' \ 'Penn State University Libraries.' spec.description = 'Combining "nittany" and "nifty" into one, super-nice gem that lints all our code at once.' spec.homepage = 'https://github.com/psu-libraries/niftany' @@ -17,10 +18,10 @@ Gem::Specification.new do |spec| spec.add_dependency 'colorize', '~> 0.8.1' spec.add_dependency 'erb_lint', '~> 0.0.22' - spec.add_dependency 'rubocop', '~> 0.79' + spec.add_dependency 'rubocop', '~> 1.3' spec.add_dependency 'rubocop-performance', '~> 1.1' spec.add_dependency 'rubocop-rails', '~> 2.3' - spec.add_dependency 'rubocop-rspec', '~> 1.3' + spec.add_dependency 'rubocop-rspec', '~> 2' spec.add_dependency 'scss_lint', '~> 0.55' spec.add_development_dependency 'bundler', '~> 2.0' From 65990e942df54108948b7a7d5835ce74d2115308 Mon Sep 17 00:00:00 2001 From: whereismyjetpack Date: Mon, 18 Jul 2022 11:20:30 -0400 Subject: [PATCH 2/4] fix Struct --- exe/niftany | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/exe/niftany b/exe/niftany index 0ff0249..dda66dc 100755 --- a/exe/niftany +++ b/exe/niftany @@ -10,9 +10,7 @@ require 'scss_lint/cli' require 'colorize' def parse_opts(args) - options = Struct.new - options.auto_correct = false - options.parallel = false + options = Struct.new('Options', :auto_correct, :parallel).new parser = OptionParser.new do |opts| opts.banner = 'Usage: niftany [options]' From 57796e06d004960685438fef56368ad590ce7255 Mon Sep 17 00:00:00 2001 From: Alex Kiessling Date: Mon, 18 Jul 2022 11:36:37 -0400 Subject: [PATCH 3/4] Use --autocorrect instead of --auto-correct --- exe/niftany | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exe/niftany b/exe/niftany index dda66dc..8b46eb7 100755 --- a/exe/niftany +++ b/exe/niftany @@ -15,7 +15,7 @@ def parse_opts(args) parser = OptionParser.new do |opts| opts.banner = 'Usage: niftany [options]' - opts.on('-a', '--auto-correct', 'Correct violations') do |auto| + opts.on('-a', '--autocorrect', 'Correct violations') do |auto| options.auto_correct = auto end @@ -34,7 +34,7 @@ end def rubocop_options(options) rubocop_options = [] - rubocop_options.append('--auto-correct') if options.auto_correct + rubocop_options.append('--autocorrect') if options.auto_correct rubocop_options.append('--parallel') if options.parallel rubocop_options end From ad9d5d5d6405f14e7b5b69276551bdffa4c63c17 Mon Sep 17 00:00:00 2001 From: Alex Kiessling Date: Mon, 18 Jul 2022 11:40:28 -0400 Subject: [PATCH 4/4] Adds the false setting back in to options Struct --- exe/niftany | 2 ++ 1 file changed, 2 insertions(+) diff --git a/exe/niftany b/exe/niftany index 8b46eb7..e4f6a52 100755 --- a/exe/niftany +++ b/exe/niftany @@ -11,6 +11,8 @@ require 'colorize' def parse_opts(args) options = Struct.new('Options', :auto_correct, :parallel).new + options.auto_correct = false + options.parallel = false parser = OptionParser.new do |opts| opts.banner = 'Usage: niftany [options]'