standard 1.1.6 → 1.1.7

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: 6b24b683942b6c6f3b13c8708e2c22a2d788a27c7674b33990d6a1fad43de33e
4
- data.tar.gz: ee990f979a9b601b56647a0d18f510f7999bb4654a9c2a8cf3d1b1c82a5a3e75
3
+ metadata.gz: 3817c9b959b345aab28f7811195b4e685e6b7753008e6b87b7baead24913fdc9
4
+ data.tar.gz: 67f0e62b1076826b09b1078e9e60dd7da184a4f4f285e20f1a15aad59cafa3c2
5
5
  SHA512:
6
- metadata.gz: 74c5858a47301a05a52d3edce69c411005470fb0c12634f967f38e91f45b2c4ff75a151a452a2df6e9aa18054b205abf01870215ab79d74ed54b5e93d1c4045c
7
- data.tar.gz: 287af69ea38002e20c05c184862d6313756427db6fbd03538bb4309c40c8926fc5ea7b3a5c71828058afad2c5e05b9b30f7e72d72230573c293e1a0235b106f9
6
+ metadata.gz: '0206790883999325864cbbb28341c846c63809eb85cf0cdab2b6427f7d97d8df147f80b092f5691a387c79fedeea3a8ba127b46d4ed55f30b9c364e0e763423d'
7
+ data.tar.gz: 56638828bd4ba34031949d85cb114b632f0167cfccb8d33edeb3b84ed3c2f1e3ca208a42604cf3cc2901d12b9db142457e8c11739187fc7bdb1426417ddbee99
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.1.7
4
+
5
+ * Fix an issue with nested generated todos being ignored
6
+ [#311](https://github.com/testdouble/standard/pull/311)
7
+
3
8
  ## 1.1.6
4
9
 
5
10
  * Update rubocop from 1.18.3 to [1.18.4](https://github.com/rubocop-hq/rubocop/releases/tag/v1.18.4)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- standard (1.1.6)
4
+ standard (1.1.7)
5
5
  rubocop (= 1.18.4)
6
6
  rubocop-performance (= 1.11.4)
7
7
 
@@ -32,7 +32,7 @@ module Standard
32
32
  default_ignores: standard_yaml.key?("default_ignores") ? !!standard_yaml["default_ignores"] : true,
33
33
  config_root: yaml_path ? Pathname.new(yaml_path).dirname.to_s : nil,
34
34
  todo_file: todo_path,
35
- todo_ignore_files: todo_yaml["ignore"] || []
35
+ todo_ignore_files: (todo_yaml["ignore"] || []).map { |f| Hash === f ? f.keys.first : f }
36
36
  }
37
37
  end
38
38
 
@@ -10,26 +10,21 @@ module Standard
10
10
  temp_file = Tempfile.new("excluded.txt")
11
11
  begin
12
12
  # Run Rubocop to generate the files with errors into the temp file.
13
- config.rubocop_options[:formatters] = [["files", temp_file.path]]
14
- config.rubocop_options[:format] = "files"
13
+ config.rubocop_options[:formatters] = [["json", temp_file.path]]
15
14
  config.rubocop_options[:out] = temp_file.path
16
15
  exit_code = Runners::Rubocop.new.call(config)
17
16
 
18
- # Read in the files with errors. It will have the absolute paths
19
- # of the files but we only want the relative path.
20
- files_with_errors = temp_file.readlines.map(&:chomp)
21
- files_with_errors.map! do |file|
22
- # Get the relative file path. Don't use the
23
- # relative_path_from method as it will raise an
24
- # error in Ruby 2.4.1 and possibly other versions.
25
- #
26
- # https://bugs.ruby-lang.org/issues/10011
27
- #
28
- file.sub(Dir.pwd + File::SEPARATOR, "")
29
- end
17
+ result = JSON.parse(temp_file.read)
18
+ ignore = result["files"].select { |file|
19
+ file["offenses"].size > 0
20
+ }.map { |file|
21
+ {
22
+ file["path"] => file["offenses"].map { |o| o["cop_name"] }.uniq
23
+ }
24
+ }
30
25
 
31
26
  # Read the files with errors from the temp file.
32
- yaml_format_errors = {"ignore" => files_with_errors}
27
+ yaml_format_errors = {"ignore" => ignore}
33
28
 
34
29
  # Regenerate the todo file.
35
30
  File.open(".standard_todo.yml", "w") do |file|
@@ -1,3 +1,3 @@
1
1
  module Standard
2
- VERSION = Gem::Version.new("1.1.6")
2
+ VERSION = Gem::Version.new("1.1.7")
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.1.6
4
+ version: 1.1.7
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-07-27 00:00:00.000000000 Z
11
+ date: 2021-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop