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 +4 -4
- data/CHANGELOG.md +3 -0
- data/bin/circle_rubocop.rb +44 -0
- data/ezcater_rubocop.gemspec +2 -2
- data/lib/ezcater_rubocop/version.rb +1 -1
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc2b72196c2d978e118d0d6f13ff45f2a06549fe
|
4
|
+
data.tar.gz: 1d875ba7c900140c5f0f5c2ef99054d3eb297322
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ceece608ed580d16420ed3697c6ec01a7d9db5763985a8dfe6c2d10e5b8129667f4b7b3b3c93ef3d4cd5677e1f7ee6f1099ecbbb69f407c4640bdab653a56d5
|
7
|
+
data.tar.gz: c22694f8ee893278028ebcd8451c75852fe267936489401bd681a3f2d291e4a465ff61fa9c9c4e9258fa06f8bcda947f191c0738240961beb0de1ec8303580bb
|
data/CHANGELOG.md
CHANGED
@@ -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
|
data/ezcater_rubocop.gemspec
CHANGED
@@ -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
|
29
|
-
spec.executables
|
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"
|
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.
|
4
|
+
version: 0.50.2.rc0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ezCater, Inc
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
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:
|
163
|
+
version: 1.3.1
|
162
164
|
requirements: []
|
163
165
|
rubyforge_project:
|
164
166
|
rubygems_version: 2.6.13
|