ezcater_rubocop 0.50.1 → 0.50.2.rc0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4c63e90ad7d1b2099f2aab6305c3d0123d1c6e3e
4
- data.tar.gz: d25866a9801f2a127476ee40f918b236465310e0
3
+ metadata.gz: dc2b72196c2d978e118d0d6f13ff45f2a06549fe
4
+ data.tar.gz: 1d875ba7c900140c5f0f5c2ef99054d3eb297322
5
5
  SHA512:
6
- metadata.gz: 24ba565cd9d863890700d15fd65702fbc4cb7b27fcd1fa6ed1b71c78ba007b68cca518ecb9eb15a75e9d049d8d34849353631a46ba58db0422ac2d3d07a2446f
7
- data.tar.gz: e54da354c72bf4a6a01927b0eb89dc3bae0dd38e8b469b9d771f4ce66e0ee620f0fcc116293e3e1835e5e06f3ff012ce7922a33610454a1ff8f474e9e398f4c3
6
+ metadata.gz: 2ceece608ed580d16420ed3697c6ec01a7d9db5763985a8dfe6c2d10e5b8129667f4b7b3b3c93ef3d4cd5677e1f7ee6f1099ecbbb69f407c4640bdab653a56d5
7
+ data.tar.gz: c22694f8ee893278028ebcd8451c75852fe267936489401bd681a3f2d291e4a465ff61fa9c9c4e9258fa06f8bcda947f191c0738240961beb0de1ec8303580bb
@@ -1,5 +1,8 @@
1
1
  # ezcater_rubocop
2
2
 
3
+ ## v0.50.2 (unreleased)
4
+ - Add `circle_rubocop.rb` script.
5
+
3
6
  ## v0.50.1
4
7
  - Add shared configuration.
5
8
  - Do not apply `Ezcater/StyleDig` to access using a range.
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "English"
4
+
5
+ # This script is used to run Rubocop in CircleCI so that on branches only
6
+ # the changed files are checked and on master all files are checked.
7
+ #
8
+ # Additionally if rubocop configuration is changed, all files are checked, and
9
+ # if the commit description on a non-master branch includes [rubocop skip]
10
+ # then rubocop is skipped.
11
+
12
+ def run(command)
13
+ puts "Running: #{command}"
14
+ exit 1 unless system(command)
15
+ end
16
+
17
+ def rubocop_everything
18
+ run("bundle exec rubocop --parallel")
19
+ end
20
+
21
+ begin
22
+ if ENV["CIRCLE_BRANCH"] == "master"
23
+ rubocop_everything
24
+ else
25
+ git_commit_desc = `git log --format=%B -n 1 $CIRCLE_SHA1`
26
+ puts "Git commit: #{git_commit_desc}"
27
+ if git_commit_desc.match?(/\[rubocop skip\]/i)
28
+ puts "Skipping RuboCop"
29
+ exit 0
30
+ end
31
+
32
+ changed_files = `git diff --diff-filter=d --name-only origin/master...$CIRCLE_BRANCH`.split("\n").join(" ")
33
+ raise "Failed to identify changed files" unless $CHILD_STATUS.success?
34
+
35
+ if changed_files.strip.empty? || changed_files.include?(".rubocop")
36
+ rubocop_everything
37
+ else
38
+ run("bundle exec rubocop --force-exclusion #{changed_files}")
39
+ end
40
+ end
41
+ rescue StandardError => ex
42
+ puts "Error: #{ex.message}"
43
+ rubocop_everything
44
+ end
@@ -25,8 +25,8 @@ Gem::Specification.new do |spec|
25
25
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
26
26
  f.match(%r{^(test|spec|features)/})
27
27
  end
28
- spec.bindir = "exe"
29
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.bindir = "bin"
29
+ spec.executables << "circle_rubocop.rb"
30
30
  spec.require_paths = ["lib"]
31
31
 
32
32
  spec.add_development_dependency "bundler", "~> 1.15"
@@ -1,3 +1,3 @@
1
1
  module EzcaterRubocop
2
- VERSION = "0.50.1".freeze
2
+ VERSION = "0.50.2.rc0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ezcater_rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.50.1
4
+ version: 0.50.2.rc0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ezCater, Inc
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-17 00:00:00.000000000 Z
11
+ date: 2017-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -111,7 +111,8 @@ dependencies:
111
111
  description: ezCater custom cops and shared configuration
112
112
  email:
113
113
  - engineering@ezcater.com
114
- executables: []
114
+ executables:
115
+ - circle_rubocop.rb
115
116
  extensions: []
116
117
  extra_rdoc_files: []
117
118
  files:
@@ -127,6 +128,7 @@ files:
127
128
  - LICENSE.txt
128
129
  - README.md
129
130
  - Rakefile
131
+ - bin/circle_rubocop.rb
130
132
  - bin/console
131
133
  - bin/setup
132
134
  - conf/rubocop.yml
@@ -156,9 +158,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
156
158
  version: '0'
157
159
  required_rubygems_version: !ruby/object:Gem::Requirement
158
160
  requirements:
159
- - - ">="
161
+ - - ">"
160
162
  - !ruby/object:Gem::Version
161
- version: '0'
163
+ version: 1.3.1
162
164
  requirements: []
163
165
  rubyforge_project:
164
166
  rubygems_version: 2.6.13