boxt_ruby_style_guide 7.5.0 → 7.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/tasks/lint.rake +11 -8
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c98e2c24a98ee1a1b71ff68d8ac9e1a71fc828e7dd426fdca7cdb7d1d46bd95
4
- data.tar.gz: d391b2f458db7d6c95e85674ccbacbd44c1b75e4b2cae553d42885e44797e1d2
3
+ metadata.gz: 7fdb78910aef325a37d80abf635b2c675d190e63669133b14f19ebcad1c480d9
4
+ data.tar.gz: 5c58cb56cfeb23d4769f8681bd21c16b5f39a3401ecbb6a016b3ba7cdf1c68f7
5
5
  SHA512:
6
- metadata.gz: c682a374a5084e2abc80665481fcd9df82f99b301064916153d5d6dd8ed587d226f83698627ab804a98e449fffe0d78fa16e8e7ccfcd0f8c60a13add8196b545
7
- data.tar.gz: '09e6a7393ba970d72171d6e85660a4482594f54de05d9f63ae4248aca894992110073f20bfb9fe9b9feab3c8d2d31399e687fa935b57a6a073e1c4807da9d31a'
6
+ metadata.gz: be5aa640996292e3d526e91a27fb2365eebb84c2e2c02f32f0a1d2b47dbe04340e0e11f15a30d9b6c60a2b25a56430dce48a950cf2522b227ce0f51acb99c58d
7
+ data.tar.gz: 667f275e3560ec91b6c20ca8bdd6f58cfc7f079c1207812d891af364e5a086823e0f7679c8e0537598c9dd4f03d230c7853b8828787a481eb2a8e5b023adfc28
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.5.0
1
+ 7.6.0
@@ -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("rubocop #{diff_file_paths};")
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
- command = <<~BASH
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.5.0
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-03 00:00:00.000000000 Z
11
+ date: 2020-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop