From fc6ef3901d76e1a1f920315328f51a13ec7d17d9 Mon Sep 17 00:00:00 2001 From: Wilson Bilkovich Date: Mon, 22 Oct 2018 18:58:44 -0400 Subject: [PATCH 1/2] Add `bin/newver` script for creating new Rubocop channels. (#129) * Add `bin/newver` script for creating new Rubocop channels. * Adds make bundle and updates newver script * Make bundle uses docker, Following up on PR review and to be consistency with how we update gems in other repos --- Makefile | 8 +++++++- bin/newver | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100755 bin/newver 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}" From d0e077762ec3e7660553487753ae09ee4251667a Mon Sep 17 00:00:00 2001 From: Ale Paredes Date: Tue, 23 Oct 2018 14:06:35 -0400 Subject: [PATCH 2/2] Updates rubocop-rspec 1.30 --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)