boxt_ruby_style_guide 7.5.0 → 7.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/tasks/lint.rake +11 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fdb78910aef325a37d80abf635b2c675d190e63669133b14f19ebcad1c480d9
|
4
|
+
data.tar.gz: 5c58cb56cfeb23d4769f8681bd21c16b5f39a3401ecbb6a016b3ba7cdf1c68f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be5aa640996292e3d526e91a27fb2365eebb84c2e2c02f32f0a1d2b47dbe04340e0e11f15a30d9b6c60a2b25a56430dce48a950cf2522b227ce0f51acb99c58d
|
7
|
+
data.tar.gz: 667f275e3560ec91b6c20ca8bdd6f58cfc7f079c1207812d891af364e5a086823e0f7679c8e0537598c9dd4f03d230c7853b8828787a481eb2a8e5b023adfc28
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.
|
1
|
+
7.6.0
|
data/lib/tasks/lint.rake
CHANGED
@@ -23,18 +23,25 @@ RUBY_DIRS = %w[app lib test spec].freeze
|
|
23
23
|
# - test/**/*.{rb,rake}
|
24
24
|
# - spec/**/*.{rb,rake}
|
25
25
|
#
|
26
|
-
GREP_PATTERN = <<~STRING.delete("\n")
|
26
|
+
GREP_PATTERN = <<~STRING.delete("\n").delete("\s")
|
27
27
|
(
|
28
28
|
(#{RUBY_DIRS.join('|')})\\/.+\\.(rb|rake)
|
29
29
|
|^
|
30
30
|
(Gemfile|Rakefile|.+\\.gemspec)
|
31
|
-
)
|
31
|
+
\Z)
|
32
32
|
STRING
|
33
33
|
|
34
34
|
namespace :lint do
|
35
35
|
desc "Runs rubocop against all files with committed changes different from base branch"
|
36
36
|
task :rubocop do
|
37
|
-
exec(
|
37
|
+
exec(<<~BASH)
|
38
|
+
RUBOCOP_CHANGED_FILES=`#{diff_file_paths}`
|
39
|
+
if [ -z "$RUBOCOP_CHANGED_FILES" ]; then
|
40
|
+
echo "No matching Ruby files changed"
|
41
|
+
else
|
42
|
+
bundle exec rubocop $RUBOCOP_CHANGED_FILES
|
43
|
+
fi
|
44
|
+
BASH
|
38
45
|
end
|
39
46
|
|
40
47
|
private
|
@@ -52,10 +59,6 @@ namespace :lint do
|
|
52
59
|
# Returns String
|
53
60
|
def diff_file_paths
|
54
61
|
base_branch = ENV.fetch("RUBOCOP_LINT_BASE", BASE_BRANCH)
|
55
|
-
|
56
|
-
git diff --name-only #{base_branch} HEAD | egrep '#{GREP_PATTERN}'
|
57
|
-
BASH
|
58
|
-
file_paths = `#{command}`
|
59
|
-
file_paths.gsub(/\n|\r/, " ")
|
62
|
+
"git diff -r --name-only --diff-filter=d #{base_branch} | egrep '#{GREP_PATTERN}'"
|
60
63
|
end
|
61
64
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boxt_ruby_style_guide
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boxt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|