guard-rubocop 1.4.0 → 1.5.0

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
  SHA256:
3
- metadata.gz: e66ec8cc26e03e6fc402a04e57ba01155e2811f53e2bbc07537ce83657240ee4
4
- data.tar.gz: 98c66cd08f8ac9bbf37b259c11250bb24b2e123005c8306c066e0111f6cac935
3
+ metadata.gz: f4fd50bb78f68a751f5fcc10f383377a222c9929ed882c62e44a93f15de13054
4
+ data.tar.gz: 0ec423fa69f1af3cc9e784a576ecd6c91995f3ab03afdb5ea54226a7bdf97a0e
5
5
  SHA512:
6
- metadata.gz: '09bf72978e4a18615a30494e8422c7f66cac1fd0f01ede788966ab47f2ea41541b08fe81e6dae2200e09407973cefc821deabe7577e8983b52788e9d005324fa'
7
- data.tar.gz: '0490a4d82a4fc9385c8e01ffe6cf7bec665d67d494a830b5bd8063b281c8a2b501210f46ea93c2c03d11cfa5f8ae2d883cd4e3db267efb8103f426192a850420'
6
+ metadata.gz: de52917c49a6988e46ab3c8c2a933e6c590df311252c0d0e8a5828113242448c8f0f1deeaa7c4c57a1290a91f8ae9869bafa73a36c9fdf74c840d1b199fd5f84
7
+ data.tar.gz: 8a9f56e402052cdbe167ddf27fd6f736e659a1dd864861d7aef07017e3c3f88b3395ac7b9e2ee2eecb57dc4fb84d72720845d2a86f3ae47b7b165ba603b7dd87
@@ -6,7 +6,7 @@ jobs:
6
6
  runs-on: ubuntu-latest
7
7
  strategy:
8
8
  matrix:
9
- ruby: [2.4, 2.5, 2.6, 2.7]
9
+ ruby: ['2.5', '2.6', '2.7', '3.0']
10
10
  steps:
11
11
  - uses: actions/checkout@v2
12
12
  - uses: ruby/setup-ruby@v1
@@ -14,9 +14,10 @@ jobs:
14
14
  ruby-version: ${{ matrix.ruby }}
15
15
  - run: bundle install
16
16
  - run: bundle exec rspec
17
- - uses: coverallsapp/github-action@master
18
- with:
19
- github-token: ${{ secrets.GITHUB_TOKEN }}
17
+ # FIXME: https://github.com/rubocop/guard-rubocop/pull/48#issuecomment-906893891
18
+ # - uses: coverallsapp/github-action@master
19
+ # with:
20
+ # github-token: ${{ secrets.GITHUB_TOKEN }}
20
21
  rubocop:
21
22
  name: RuboCop
22
23
  runs-on: ubuntu-latest
@@ -24,6 +25,6 @@ jobs:
24
25
  - uses: actions/checkout@v2
25
26
  - uses: ruby/setup-ruby@v1
26
27
  with:
27
- ruby-version: 2.7
28
+ ruby-version: 2.5
28
29
  - run: bundle install
29
30
  - run: bundle exec rubocop
data/.rubocop.yml CHANGED
@@ -1,5 +1,8 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
+ AllCops:
4
+ TargetRubyVersion: 2.5
5
+
3
6
  Layout/FirstArrayElementIndentation:
4
7
  EnforcedStyle: consistent
5
8
 
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Development
4
4
 
5
+ ## v1.5.0
6
+
7
+ * Drop support Ruby 2.4. [#50](https://github.com/rubocop/guard-rubocop/pull/50)
8
+ * Allow custom `cmd` option for rubocop. [#48](https://github.com/rubocop/guard-rubocop/pull/48)
9
+
5
10
  ## v1.4.0
6
11
 
7
12
  * Support RuboCop 1.0
data/README.md CHANGED
@@ -1,13 +1,13 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/guard-rubocop.svg)](http://badge.fury.io/rb/guard-rubocop)
2
- [![CI](https://github.com/yujinakayama/guard-rubocop/workflows/CI/badge.svg)](https://github.com/yujinakayama/guard-rubocop/actions)
3
- [![Coverage Status](https://coveralls.io/repos/yujinakayama/guard-rubocop/badge.svg?branch=master&service=github)](https://coveralls.io/github/yujinakayama/guard-rubocop?branch=master)
4
- [![Code Climate](https://codeclimate.com/github/yujinakayama/guard-rubocop/badges/gpa.svg)](https://codeclimate.com/github/yujinakayama/guard-rubocop)
2
+ [![CI](https://github.com/rubocop/guard-rubocop/workflows/CI/badge.svg)](https://github.com/rubocop/guard-rubocop/actions)
3
+ [![Coverage Status](https://coveralls.io/repos/rubocop/guard-rubocop/badge.svg?branch=master&service=github)](https://coveralls.io/github/rubocop/guard-rubocop?branch=master)
4
+ [![Code Climate](https://codeclimate.com/github/rubocop/guard-rubocop/badges/gpa.svg)](https://codeclimate.com/github/rubocop/guard-rubocop)
5
5
 
6
6
  # guard-rubocop
7
7
 
8
- **guard-rubocop** allows you to automatically check Ruby code style with [RuboCop](https://github.com/bbatsov/rubocop) when files are modified.
8
+ **guard-rubocop** allows you to automatically check Ruby code style with [RuboCop](https://github.com/rubocop/rubocop) when files are modified.
9
9
 
10
- Tested on MRI 2.4 - 2.7.
10
+ Tested on MRI 2.5 - 3.0.
11
11
 
12
12
  ## Installation
13
13
 
@@ -61,6 +61,9 @@ all_on_start: true # Check all files at Guard startup.
61
61
  cli: '--rails' # Pass arbitrary RuboCop CLI arguments.
62
62
  # An array or string is acceptable.
63
63
  # default: nil
64
+ cmd: './bin/rubocop' # Pass custom cmd to run rubocop.
65
+ # default: rubocop
66
+
64
67
  hide_stdout: false # Do not display console output (in case outputting to file).
65
68
  # default: false
66
69
  keep_failed: true # Keep failed files until they pass.
@@ -120,6 +123,6 @@ Note: You need to use `guard-rspec` 4.2.3 or later due to a [bug](https://github
120
123
 
121
124
  ## License
122
125
 
123
- Copyright (c) 2013–2014 Yuji Nakayama
126
+ Copyright (c) 2013–2020 Yuji Nakayama
124
127
 
125
128
  See the [LICENSE.txt](LICENSE.txt) for details.
@@ -13,10 +13,10 @@ Gem::Specification.new do |spec|
13
13
  spec.summary = 'Guard plugin for RuboCop'
14
14
  spec.description = 'Guard::RuboCop automatically checks Ruby code style with RuboCop ' \
15
15
  'when files are modified.'
16
- spec.homepage = 'https://github.com/yujinakayama/guard-rubocop'
16
+ spec.homepage = 'https://github.com/rubocop/guard-rubocop'
17
17
  spec.license = 'MIT'
18
18
 
19
- spec.required_ruby_version = '>= 2.4'
19
+ spec.required_ruby_version = '>= 2.5'
20
20
 
21
21
  spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
22
22
  spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
@@ -28,7 +28,7 @@ module Guard
28
28
  end
29
29
 
30
30
  def build_command(paths)
31
- command = ['rubocop']
31
+ command = [@options[:cmd] || 'rubocop']
32
32
 
33
33
  if should_add_default_formatter_for_console?
34
34
  command.concat(%w[--format progress]) # Keep default formatter for console.
@@ -80,11 +80,9 @@ module Guard
80
80
  end
81
81
 
82
82
  def result
83
- @result ||= begin
84
- File.open(json_file_path) do |file|
85
- # Rubinius 2.0.0.rc1 does not support `JSON.load` with 3 args.
86
- JSON.parse(file.read, symbolize_names: true)
87
- end
83
+ @result ||= File.open(json_file_path) do |file|
84
+ # Rubinius 2.0.0.rc1 does not support `JSON.load` with 3 args.
85
+ JSON.parse(file.read, symbolize_names: true)
88
86
  end
89
87
  end
90
88
 
@@ -5,7 +5,7 @@
5
5
  module GuardRuboCopVersion
6
6
  # http://semver.org/
7
7
  MAJOR = 1
8
- MINOR = 4
8
+ MINOR = 5
9
9
  PATCH = 0
10
10
 
11
11
  def self.to_s
@@ -109,6 +109,22 @@ RSpec.describe Guard::RuboCop::Runner do
109
109
  let(:options) { { cli: %w[--debug --rails] } }
110
110
  let(:paths) { %w[file1.rb file2.rb] }
111
111
 
112
+ describe ':cmd option' do
113
+ context 'when set' do
114
+ let(:options) { { cmd: 'bin/rubocop' } }
115
+
116
+ it 'uses the supplied :cmd' do
117
+ expect(build_command[0]).to eq('bin/rubocop')
118
+ end
119
+ end
120
+
121
+ context 'when not set' do
122
+ it 'uses the default command' do
123
+ expect(build_command[0]).to eq('rubocop')
124
+ end
125
+ end
126
+ end
127
+
112
128
  context 'when :hide_stdout is not set' do
113
129
  context 'and :cli option includes formatter for console' do
114
130
  before { options[:cli] = %w[--format simple] }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-rubocop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuji Nakayama
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-27 00:00:00.000000000 Z
11
+ date: 2021-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -158,11 +158,11 @@ files:
158
158
  - spec/spec_helper.rb
159
159
  - spec/support/silence_output.rb
160
160
  - spec/support/simplecov.rb
161
- homepage: https://github.com/yujinakayama/guard-rubocop
161
+ homepage: https://github.com/rubocop/guard-rubocop
162
162
  licenses:
163
163
  - MIT
164
164
  metadata: {}
165
- post_install_message:
165
+ post_install_message:
166
166
  rdoc_options: []
167
167
  require_paths:
168
168
  - lib
@@ -170,15 +170,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - ">="
172
172
  - !ruby/object:Gem::Version
173
- version: '2.4'
173
+ version: '2.5'
174
174
  required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  requirements:
176
176
  - - ">="
177
177
  - !ruby/object:Gem::Version
178
178
  version: '0'
179
179
  requirements: []
180
- rubygems_version: 3.1.2
181
- signing_key:
180
+ rubyforge_project:
181
+ rubygems_version: 2.7.6.3
182
+ signing_key:
182
183
  specification_version: 4
183
184
  summary: Guard plugin for RuboCop
184
185
  test_files: