diff --git a/Gemfile.lock b/Gemfile.lock index 41fe354f..9c8f0ef0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -49,8 +49,8 @@ GEM unicode-display_width (~> 1.0, >= 1.0.1) rubocop-migrations (0.1.2) rubocop (~> 0.41) - rubocop-rspec (1.21.0) - rubocop (>= 0.52.0) + rubocop-rspec (1.30.0) + rubocop (>= 0.58.0) ruby-progressbar (1.10.0) safe_yaml (1.0.4) thread_safe (0.3.6) diff --git a/Makefile b/Makefile index 819810f1..a05b627a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: image test docs +.PHONY: image test docs bundle IMAGE_NAME ?= codeclimate/codeclimate-rubocop @@ -14,3 +14,9 @@ docs: image --workdir /usr/src/app \ --volume $(PWD):/usr/src/app \ $(IMAGE_NAME) sh -c "apk --update add git && bundle install --with=test && bundle exec rake docs:scrape" + +bundle: + docker run --rm \ + --entrypoint /bin/sh \ + --volume $(PWD):/usr/src/app \ + $(IMAGE_NAME) -c "cd /usr/src/app && bundle $(BUNDLE_ARGS)" \ No newline at end of file diff --git a/bin/newver b/bin/newver new file mode 100755 index 00000000..e1931deb --- /dev/null +++ b/bin/newver @@ -0,0 +1,38 @@ +#!/bin/sh +set -eu + +if [ $# -eq 0 ]; then + >&2 echo "Usage: 'bin/newver X.Y.Z', where X.Y.Z is the Rubocop version to add." + exit 1 +fi +NEWVER="$1" + +git checkout Gemfile* +git checkout -b "newver/${NEWVER}" + +ed Gemfile <<-EDITS +/gem "parser",/c +gem "parser" +. +/gem "rubocop",/c +gem "rubocop", "~> ${NEWVER}", require: false +. +wq +EDITS + +make bundle -e BUNDLE_ARGS="update rubocop" +make image +make docs +sudo chown -R $(id -u):$(id -g) config + +set +e +make test +retval=$? +if [ $retval -ne 0 ]; then + >&2 echo "If tests fail, you may need to modify spec/support/currently_undocumented_cops.txt" + exit $retval +fi +set -e + +git add config spec Gemfile* +git commit -v -m "Updated channel and documentation to Rubocop v${NEWVER}"