commit af104db2d77047c5b970f73046bb36502aad9b77
parent 255fa33744602a090c6134a591af276ccccb6256
Author: Dan Callaghan <djc@djc.id.au>
Date: Sat, 16 Apr 2022 18:23:52 +1000
move rubocop-packaging checks to the top level
These were in a contrib subdirectory to avoid introducing a new
dependency on the rubocop-packaging gem. But the current layout doesn't
work on Github Actions. Bundler installs dependencies into
vendor/bundle/ and so Rubocop tries to check them and fails like this:
[rubocop-packaging] Running RuboCop Packaging checks
Error: The `Layout/IndentHeredoc` cop has been renamed to `Layout/HeredocIndentation`.
(obsolete configuration found in /home/runner/work/sup/sup/vendor/bundle/ruby/3.0.0/gems/highline-2.0.3/.rubocop.yml, please update it)
The `Style/MethodMissing` cop has been split into `Style/MethodMissingSuper` and `Style/MissingRespondToMissing`.
(obsolete configuration found in /home/runner/work/sup/sup/vendor/bundle/ruby/3.0.0/gems/highline-2.0.3/.rubocop.yml, please update it)
rubocop-packaging checks failed
Error: Process completed with exit code 1.
Diffstat:
6 files changed, 6 insertions(+), 36 deletions(-)
diff --git a/contrib/rubocop-packaging/.rubocop.yml b/.rubocop.yml
diff --git a/Manifest.txt b/Manifest.txt
@@ -1,6 +1,7 @@
.github/workflows/checks.yml
.gitignore
.gitmodules
+.rubocop.yml
CONTRIBUTORS
Gemfile
HACKING
@@ -23,9 +24,6 @@ bin/sup-tweak-labels
contrib/colorpicker.rb
contrib/completion/_sup.bash
contrib/completion/_sup.zsh
-contrib/rubocop-packaging/.rubocop.yml
-contrib/rubocop-packaging/Gemfile
-contrib/rubocop-packaging/rubocop-packaging.sh
devel/console.sh
devel/count-loc.sh
devel/load-index.rb
diff --git a/Rakefile b/Rakefile
@@ -79,18 +79,9 @@ task :check_manifest do
end
task :rubocop_packaging do
- # Bundler.with_clean_env allows rubocop-packaging.sh to use its own
- # separate Bundler directory, even if this Rake task is executed by
- # Bundler.
- #
- # We currently use the deprecated "Bundler.with_clean_env" instead of
- # "Bundler.with_unbundled_env" for compatibility with older versions
- # of Ruby and Bundler.
- Bundler.with_clean_env do
- if system("cd contrib/rubocop-packaging && ./rubocop-packaging.sh")
- puts "rubocop-packaging checks OK"
- else
- abort "rubocop-packaging checks failed"
- end
+ if system("rubocop --only Packaging")
+ puts "rubocop-packaging checks OK"
+ else
+ abort "rubocop-packaging checks failed"
end
end
diff --git a/contrib/rubocop-packaging/Gemfile b/contrib/rubocop-packaging/Gemfile
@@ -1,3 +0,0 @@
-source 'https://rubygems.org/'
-
-gem 'rubocop-packaging'
diff --git a/contrib/rubocop-packaging/rubocop-packaging.sh b/contrib/rubocop-packaging/rubocop-packaging.sh
@@ -1,17 +0,0 @@
-#!/bin/sh
-
-set -euf
-
-if [ ! -f .rubocop.yml ]; then
- echo ".rubocop.yml not found in current working directory: `pwd`" >&2
- echo "To run, first 'cd' to the directory that contains this script" >&2
- exit 1
-fi
-
-rm -f Gemfile.lock
-
-echo "[rubocop-packaging] Running 'bundle install'..."
-bundle install --path=.bundle
-
-echo "[rubocop-packaging] Running RuboCop Packaging checks"
-bundle exec rubocop --only Packaging ../..
diff --git a/sup.gemspec b/sup.gemspec
@@ -67,5 +67,6 @@ SUP: please note that our old mailing lists have been shut down,
s.add_development_dependency "rr", "~> 1.1"
s.add_development_dependency "gpgme", ">= 2.0.2"
s.add_development_dependency "pry"
+ s.add_development_dependency "rubocop-packaging"
end