standard 1.0.1 → 1.0.2

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: ad16fa94acb2de73ebed6090c37d6e73791f7db9588ce441606963930381d36a
4
- data.tar.gz: 2a649119dd14d36e72f0eb159373cba7b173e43b92566a27d92c8d4582564a89
3
+ metadata.gz: 5243ef8e251d58a567e45ac2ced197b1e7aecebb11fe062017673f60b72c20d9
4
+ data.tar.gz: 1b7b1d75fd42803b4e2ffe96738bcb67ec60d1fc4db7e7fbda7b8e5b7693d113
5
5
  SHA512:
6
- metadata.gz: 6190b3e6ffd7bc1f7254c42d085fa42e4e7e5d16032c46841be6c7149a7ee3d3b01ea07487380237bc7745d2d52112b9c1f8434fac55ce11935212ed6f081b08
7
- data.tar.gz: d3c470c9d92695eaa9acb8532b2959176e2c6caa42115cb5781eb6efff81ebab9f711ead27598b7acc3c643a193a9848c7b81dc26637f1d239d38cb8131f2009
6
+ metadata.gz: 6cbb608448c4a9da25f2c88941217272dbd133c6e356d380fcd82109b4921eb1d32c930da5974bef9540da9116b5e5dfa469c5b7241b4b1d2af758d7600fd8e3
7
+ data.tar.gz: 18248be1abd1e69c865bf2387fc70bcdc271bdf5c90b99e446370aa2e592438326e59656c84e2b6ab36fd404c27db8d1e5b43bbd4005f05c954eeeaa07dfb585
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.2
4
+
5
+ * Preserve RuboCop's CLI exit codes
6
+ ([#270](https://github.com/testdouble/standard/pull/270)) by
7
+ [@nicksieger](https://github.com/nicksieger)
8
+
3
9
  ## 1.0.1
4
10
 
5
11
  * Update rubocop from 1.10.0 to [1.11.0](https://github.com/rubocop-hq/rubocop/releases/tag/v1.11.0)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- standard (1.0.1)
4
+ standard (1.0.2)
5
5
  rubocop (= 1.11.0)
6
6
  rubocop-performance (= 1.10.1)
7
7
 
@@ -61,4 +61,4 @@ DEPENDENCIES
61
61
  standard!
62
62
 
63
63
  BUNDLED WITH
64
- 2.2.6
64
+ 2.3.0.dev
data/README.md CHANGED
@@ -231,11 +231,6 @@ style.
231
231
 
232
232
  ## I disagree with rule X, can you change it?
233
233
 
234
- **[NOTE: until StandardRB hits 1.0.0, the answer is yes! It just requires
235
- [opening an issue](https://github.com/testdouble/standard/issues/new) and
236
- convincing [@searls](https://twitter.com/searls) (the BDFNow) to make the
237
- change.]**
238
-
239
234
  No. The whole point of Standard is to save you time by avoiding
240
235
  [bikeshedding](https://www.freebsd.org/doc/en/books/faq/misc.html#bikeshed-painting)
241
236
  about code style. There are lots of debates online about tabs vs. spaces, etc.
data/lib/standard/cli.rb CHANGED
@@ -3,9 +3,6 @@ require_relative "loads_runner"
3
3
 
4
4
  module Standard
5
5
  class Cli
6
- SUCCESS_STATUS_CODE = 0
7
- FAILURE_STATUS_CODE = 1
8
-
9
6
  def initialize(argv)
10
7
  @argv = argv
11
8
  @builds_config = BuildsConfig.new
@@ -14,10 +11,7 @@ module Standard
14
11
 
15
12
  def run
16
13
  config = @builds_config.call(@argv)
17
-
18
- success = @loads_runner.call(config.runner).call(config)
19
-
20
- success ? SUCCESS_STATUS_CODE : FAILURE_STATUS_CODE
14
+ @loads_runner.call(config.runner).call(config)
21
15
  end
22
16
  end
23
17
  end
@@ -13,7 +13,7 @@ module Standard
13
13
  config.rubocop_options[:formatters] = [["files", temp_file.path]]
14
14
  config.rubocop_options[:format] = "files"
15
15
  config.rubocop_options[:out] = temp_file.path
16
- Runners::Rubocop.new.call(config)
16
+ exit_code = Runners::Rubocop.new.call(config)
17
17
 
18
18
  # Read in the files with errors. It will have the absolute paths
19
19
  # of the files but we only want the relative path.
@@ -37,6 +37,7 @@ module Standard
37
37
  file.puts "# Remove from this list as you refactor files."
38
38
  file.write(yaml_format_errors.to_yaml)
39
39
  end
40
+ exit_code
40
41
  ensure
41
42
  # Clean up temp file.
42
43
  temp_file.close
@@ -4,36 +4,15 @@ module Standard
4
4
  module Runners
5
5
  class Rubocop
6
6
  def call(config)
7
- rubocop_runner = RuboCop::Runner.new(
8
- config.rubocop_options,
9
- config.rubocop_config_store
7
+ rubocop_runner = RuboCop::CLI::Command::ExecuteRunner.new(
8
+ RuboCop::CLI::Environment.new(
9
+ config.rubocop_options,
10
+ config.rubocop_config_store,
11
+ config.paths
12
+ )
10
13
  )
11
14
 
12
- rubocop_runner.run(config.paths).tap do |success|
13
- print_errors_and_warnings(success, rubocop_runner)
14
- print_corrected_code_if_fixing_stdin(config.rubocop_options)
15
- end
16
- end
17
-
18
- private
19
-
20
- def print_errors_and_warnings(success, rubocop_runner)
21
- return unless success
22
-
23
- (rubocop_runner.warnings + rubocop_runner.errors).each do |message|
24
- warn message
25
- end
26
- end
27
-
28
- def print_corrected_code_if_fixing_stdin(rubocop_options)
29
- return unless rubocop_options[:stdin] && rubocop_options[:auto_correct]
30
-
31
- if rubocop_options[:stderr]
32
- warn "=" * 20
33
- else
34
- puts "=" * 20
35
- end
36
- print rubocop_options[:stdin]
15
+ rubocop_runner.run
37
16
  end
38
17
  end
39
18
  end
@@ -1,3 +1,3 @@
1
1
  module Standard
2
- VERSION = Gem::Version.new("1.0.1")
2
+ VERSION = Gem::Version.new("1.0.2")
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: standard
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Searls
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-04 00:00:00.000000000 Z
11
+ date: 2021-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.1.4
111
+ rubygems_version: 3.2.3
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Ruby Style Guide, with linter & automatic code fixer