quiet_quality 1.2.0 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rspec.yml +1 -1
  3. data/CHANGELOG.md +22 -0
  4. data/lib/quiet_quality/annotators/github_stdout.rb +3 -1
  5. data/lib/quiet_quality/cli/arg_parser.rb +11 -7
  6. data/lib/quiet_quality/cli/entrypoint.rb +0 -8
  7. data/lib/quiet_quality/cli/presenter.rb +1 -1
  8. data/lib/quiet_quality/config/finder.rb +0 -4
  9. data/lib/quiet_quality/config/logging.rb +3 -2
  10. data/lib/quiet_quality/config/parsed_options.rb +36 -0
  11. data/lib/quiet_quality/config/parser.rb +4 -8
  12. data/lib/quiet_quality/executors/base_executor.rb +1 -11
  13. data/lib/quiet_quality/message.rb +44 -9
  14. data/lib/quiet_quality/tools/brakeman/parser.rb +8 -1
  15. data/lib/quiet_quality/tools/brakeman/runner.rb +1 -1
  16. data/lib/quiet_quality/tools/brakeman.rb +1 -0
  17. data/lib/quiet_quality/tools/haml_lint/parser.rb +2 -1
  18. data/lib/quiet_quality/tools/haml_lint/runner.rb +1 -1
  19. data/lib/quiet_quality/tools/haml_lint.rb +1 -0
  20. data/lib/quiet_quality/tools/markdown_lint/parser.rb +2 -1
  21. data/lib/quiet_quality/tools/markdown_lint/runner.rb +1 -1
  22. data/lib/quiet_quality/tools/markdown_lint.rb +1 -0
  23. data/lib/quiet_quality/tools/rspec/parser.rb +26 -2
  24. data/lib/quiet_quality/tools/rspec/runner.rb +1 -1
  25. data/lib/quiet_quality/tools/rspec.rb +1 -0
  26. data/lib/quiet_quality/tools/rubocop/parser.rb +6 -1
  27. data/lib/quiet_quality/tools/rubocop/runner.rb +1 -1
  28. data/lib/quiet_quality/tools/rubocop.rb +1 -0
  29. data/lib/quiet_quality/tools/standardrb/parser.rb +3 -0
  30. data/lib/quiet_quality/tools/standardrb/runner.rb +1 -1
  31. data/lib/quiet_quality/tools/standardrb.rb +1 -0
  32. data/lib/quiet_quality/version.rb +1 -1
  33. data/lib/quiet_quality/version_control_systems/git.rb +2 -11
  34. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae3f031f4d627e624ce2ae28a5cf58d8e9e0663822371089d54bda51cb1aefeb
4
- data.tar.gz: c9c26fd4d3df19e70162b38ef78622cc569ea492656d9264c4a41a964931934a
3
+ metadata.gz: 6876b975446f39615f129b4fd35f3543bb998024ea292edcac1e6e1a90f7b59b
4
+ data.tar.gz: 277492ea2e6b93854e3b7d16f0184a50b5c756683929fb2a1081415e8e9836df
5
5
  SHA512:
6
- metadata.gz: 6925f90d2f144b9bd59b4f0ca8d9a28e41cebf8570b30e3fa85cee6eefe2961aaaf246f733cd9b62de0d070afb7cca545c650ead15e45a6a39372d34c4240023
7
- data.tar.gz: 3589c916dab556a467ab64c974ea91eda6a4f6f229ccda58aa51488b13b3a9a44217206fb3962697570cd176fb1bd282bee6231eccad5b50e1d948f0758eb8fb
6
+ metadata.gz: 7d0acaa14243573095f8741b9ca45cf56608b4ffde72f3ecd36a6ebd03cb0aeb45541ef3e4dad1c681976d5cdc3226d738a489b754d80590be032c31bbc8520b
7
+ data.tar.gz: 8e8daf77522762cca13480745f30df25cb2e445f2f7c69f98c20af9bc3b03bc8568299b8403ddbbc2e09fef750d3b3944c1a6f9b8dc2e4e22a4389a5419d05ab
@@ -30,4 +30,4 @@ jobs:
30
30
  run: bundle install --jobs 4 --retry 3
31
31
 
32
32
  - name: Run RSpec
33
- run: bundle exec rspec
33
+ run: SIMPLECOV=true SIMPLECOV_TEXT=true bundle exec rspec
data/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## Release 1.2.2
4
+
5
+ * Add some code to the Rspec::Parser that _cleans_ the json of certain text that
6
+ simplecov may write into the rspec json output. (#91, resolves #86)
7
+ * Include the name of the originating tool in the printed message, and the
8
+ annotation, when a warning is presented. (#90 resolves #72)
9
+ * Support `normal` as a logging level, and the `--normal` and `-n` cli
10
+ arguments. This is the default value, so this really only matters if your
11
+ config file sets another value and you want to override it from the cli.
12
+ (#91, resolves #86)
13
+
14
+ ## Release 1.2.1
15
+
16
+ * Fix the handling of the various ways to specify whether tools should limit
17
+ their targets to changed files or run against the entire repository. The
18
+ configuration systems had disagreements on what to call the options in
19
+ question, which resulted in some configuration entries being ignored. We
20
+ enforce a set of validations on reads and writes now to avoid such a problem
21
+ in the future (#89, resolves #88)
22
+ * Add coverage-checking, and then improve test coverage and remove unreferenced
23
+ code as a result. (#87)
24
+
3
25
  ## Release 1.2.0
4
26
 
5
27
  * Support `--light`, `--quiet`, and `--logging LEVEL` arguments for less output
@@ -18,10 +18,12 @@ module QuietQuality
18
18
  # ::warning file={name},line={line},title={title}::{message}
19
19
  # See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message
20
20
  def self.format(message)
21
+ title = message.tool_name.to_s
22
+ title += " #{message.rule}" if message.rule
21
23
  attributes = {
22
24
  file: message.path,
23
25
  line: message.annotated_line || message.start_line,
24
- title: message.rule
26
+ title: title
25
27
  }.compact
26
28
 
27
29
  attributes_string = attributes.map { |k, v| "#{k}=#{v}" }.join(",")
@@ -45,12 +45,12 @@ module QuietQuality
45
45
  # options; if they don't, they are global options. (optparse allows an optional argument
46
46
  # to a flag if the string representing it is not a 'string in all caps'. So `[FOO]` or `foo`
47
47
  # would be optional, but `FOO` would be required. This helper simplifies handling those.
48
- def read_tool_or_global_option(name, tool, value)
48
+ def read_tool_or_global_option(name:, into:, tool:, value:)
49
49
  if tool
50
50
  validate_value_from("tool", tool, Tools::AVAILABLE)
51
- set_tool_option(tool, name, value)
51
+ set_tool_option(tool, into, value)
52
52
  else
53
- set_global_option(name, value)
53
+ set_global_option(into, value)
54
54
  end
55
55
  end
56
56
 
@@ -114,11 +114,11 @@ module QuietQuality
114
114
 
115
115
  def setup_file_target_options(parser)
116
116
  parser.on("-a", "--all-files [tool]", "Use the tool(s) on all files") do |tool|
117
- read_tool_or_global_option(:all_files, tool, true)
117
+ read_tool_or_global_option(name: :all_files, into: :limit_targets, tool: tool, value: false)
118
118
  end
119
119
 
120
120
  parser.on("-c", "--changed-files [tool]", "Use the tool(s) only on changed files") do |tool|
121
- read_tool_or_global_option(:all_files, tool, false)
121
+ read_tool_or_global_option(name: :all_files, into: :limit_targets, tool: tool, value: true)
122
122
  end
123
123
 
124
124
  parser.on("-B", "--comparison-branch BRANCH", "Specify the branch to compare against") do |branch|
@@ -128,15 +128,19 @@ module QuietQuality
128
128
 
129
129
  def setup_filter_messages_options(parser)
130
130
  parser.on("-f", "--filter-messages [tool]", "Filter messages from tool(s) based on changed lines") do |tool|
131
- read_tool_or_global_option(:filter_messages, tool, true)
131
+ read_tool_or_global_option(name: :filter_messages, into: :filter_messages, tool: tool, value: true)
132
132
  end
133
133
 
134
134
  parser.on("-u", "--unfiltered [tool]", "Don't filter messages from tool(s)") do |tool|
135
- read_tool_or_global_option(:filter_messages, tool, false)
135
+ read_tool_or_global_option(name: :filter_messages, into: :filter_messages, tool: tool, value: false)
136
136
  end
137
137
  end
138
138
 
139
139
  def setup_logging_options(parser)
140
+ parser.on("-n", "--normal", "Print outcomes and messages") do
141
+ set_global_option(:logging, Config::Logging::NORMAL)
142
+ end
143
+
140
144
  parser.on("-l", "--light", "Print aggregated results only") do
141
145
  set_global_option(:logging, Config::Logging::LIGHT)
142
146
  end
@@ -62,14 +62,6 @@ module QuietQuality
62
62
  parsed_options.helping?
63
63
  end
64
64
 
65
- def quiet_logging?
66
- options.logging.quiet?
67
- end
68
-
69
- def light_logging?
70
- options.logging.light?
71
- end
72
-
73
65
  def printing_version?
74
66
  parsed_options.printing_version?
75
67
  end
@@ -70,7 +70,7 @@ module QuietQuality
70
70
  line_range = line_range_for(msg)
71
71
  rule_string = msg.rule ? " [#{msg.rule}]" : ""
72
72
  truncated_body = reduce_text(msg.body, 120)
73
- logger.puts " #{msg.path}:#{line_range}#{rule_string} #{truncated_body}"
73
+ logger.puts "#{msg.tool_name} #{msg.path}:#{line_range}#{rule_string} #{truncated_body}"
74
74
  end
75
75
  end
76
76
  end
@@ -25,10 +25,6 @@ module QuietQuality
25
25
 
26
26
  attr_reader :from
27
27
 
28
- def config_path_within(dir)
29
- File.join(dir, CONFIG_FILENAME)
30
- end
31
-
32
28
  def each_successive_enclosing_directory(max_depth: 100, &block)
33
29
  d = Pathname.new(from)
34
30
  depth = 0
@@ -3,11 +3,12 @@ module QuietQuality
3
3
  class Logging
4
4
  LIGHT = :light
5
5
  QUIET = :quiet
6
- LEVELS = [LIGHT, QUIET].freeze
6
+ NORMAL = :normal
7
+ LEVELS = [LIGHT, QUIET, NORMAL].freeze
7
8
 
8
9
  attr_accessor :level
9
10
 
10
- def initialize(level: nil)
11
+ def initialize(level: NORMAL)
11
12
  @level = level
12
13
  end
13
14
 
@@ -1,6 +1,26 @@
1
1
  module QuietQuality
2
2
  module Config
3
3
  class ParsedOptions
4
+ InvalidOptionName = Class.new(Error)
5
+
6
+ GLOBAL_OPTIONS = [
7
+ :no_config,
8
+ :config_path,
9
+ :annotator,
10
+ :executor,
11
+ :comparison_branch,
12
+ :logging,
13
+ :limit_targets,
14
+ :filter_messages,
15
+ :file_filter
16
+ ].to_set
17
+
18
+ TOOL_OPTIONS = [
19
+ :limit_targets,
20
+ :filter_messages,
21
+ :file_filter
22
+ ].to_set
23
+
4
24
  def initialize
5
25
  @tools = []
6
26
  @tool_options = {}
@@ -20,21 +40,37 @@ module QuietQuality
20
40
  end
21
41
 
22
42
  def set_global_option(name, value)
43
+ validate_global_option(name)
23
44
  @global_options[name.to_sym] = value
24
45
  end
25
46
 
26
47
  def global_option(name)
48
+ validate_global_option(name)
27
49
  @global_options.fetch(name.to_sym, nil)
28
50
  end
29
51
 
30
52
  def set_tool_option(tool, name, value)
53
+ validate_tool_option(name)
31
54
  @tool_options[tool.to_sym] ||= {}
32
55
  @tool_options[tool.to_sym][name.to_sym] = value
33
56
  end
34
57
 
35
58
  def tool_option(tool, name)
59
+ validate_tool_option(name)
36
60
  @tool_options.dig(tool.to_sym, name.to_sym)
37
61
  end
62
+
63
+ private
64
+
65
+ def validate_global_option(name)
66
+ return if GLOBAL_OPTIONS.include?(name.to_sym)
67
+ fail(InvalidOptionName, "Option name #{name} is not a recognized global ParsedOption")
68
+ end
69
+
70
+ def validate_tool_option(name)
71
+ return if TOOL_OPTIONS.include?(name.to_sym)
72
+ fail(InvalidOptionName, "Option name #{name} is not a recognized tool ParsedOption")
73
+ end
38
74
  end
39
75
  end
40
76
  end
@@ -42,8 +42,8 @@ module QuietQuality
42
42
  read_global_option(opts, :annotator, :annotator, as: :symbol, validate_from: Annotators::ANNOTATOR_TYPES)
43
43
  read_global_option(opts, :annotate, :annotator, as: :symbol, validate_from: Annotators::ANNOTATOR_TYPES)
44
44
  read_global_option(opts, :comparison_branch, :comparison_branch, as: :string)
45
- read_global_option(opts, :changed_files, :changed_files, as: :boolean)
46
- read_global_option(opts, :all_files, :changed_files, as: :reversed_boolean)
45
+ read_global_option(opts, :changed_files, :limit_targets, as: :boolean)
46
+ read_global_option(opts, :all_files, :limit_targets, as: :reversed_boolean)
47
47
  read_global_option(opts, :filter_messages, :filter_messages, as: :boolean)
48
48
  read_global_option(opts, :unfiltered, :filter_messages, as: :reversed_boolean)
49
49
  read_global_option(opts, :logging, :logging, as: :symbol, validate_from: Logging::LEVELS)
@@ -61,8 +61,8 @@ module QuietQuality
61
61
 
62
62
  read_tool_option(opts, tool_name, :filter_messages, :filter_messages, as: :boolean)
63
63
  read_tool_option(opts, tool_name, :unfiltered, :filter_messages, as: :reversed_boolean)
64
- read_tool_option(opts, tool_name, :changed_files, :changed_files, as: :boolean)
65
- read_tool_option(opts, tool_name, :all_files, :changed_files, as: :reversed_boolean)
64
+ read_tool_option(opts, tool_name, :changed_files, :limit_targets, as: :boolean)
65
+ read_tool_option(opts, tool_name, :all_files, :limit_targets, as: :reversed_boolean)
66
66
  read_tool_option(opts, tool_name, :file_filter, :file_filter, as: :string)
67
67
  end
68
68
 
@@ -102,8 +102,6 @@ module QuietQuality
102
102
  when :reversed_boolean then validate_boolean(name, value)
103
103
  when :symbol then validate_symbol(name, value, from: from)
104
104
  when :string then validate_string(name, value)
105
- else
106
- fail ArgumentError, "validate_value does not handle type #{as}"
107
105
  end
108
106
  end
109
107
 
@@ -135,8 +133,6 @@ module QuietQuality
135
133
  when :reversed_boolean then !value
136
134
  when :string then value.to_s
137
135
  when :symbol then value.to_sym
138
- else
139
- fail ArgumentError, "coerce_value does not handle type #{as}"
140
136
  end
141
137
  end
142
138
  end
@@ -7,7 +7,7 @@ module QuietQuality
7
7
  end
8
8
 
9
9
  def execute!
10
- fail NoMethodError, "execute! should be implemented by the subclass of BaseExecutor"
10
+ pipelines.none?(&:failure?)
11
11
  end
12
12
 
13
13
  def outcomes
@@ -39,16 +39,6 @@ module QuietQuality
39
39
  Pipeline.new(tool_options: topts, changed_files: changed_files)
40
40
  end
41
41
  end
42
-
43
- def pipeline_by_tool
44
- @_pipeline_by_tool ||= pipelines
45
- .map { |p| [p.tool_name, p] }
46
- .to_h
47
- end
48
-
49
- def pipeline_for(tool)
50
- pipeline_by_tool.fetch(tool.to_sym)
51
- end
52
42
  end
53
43
  end
54
44
  end
@@ -1,7 +1,8 @@
1
1
  module QuietQuality
2
2
  class Message
3
- attr_accessor :annotated_line
4
- attr_reader :path, :body, :start_line, :stop_line, :level, :rule
3
+ REQUIRED_ATTRS = %w[path body start_line tool_name].freeze
4
+
5
+ attr_writer :annotated_line
5
6
 
6
7
  def self.load(hash)
7
8
  new(**hash)
@@ -9,17 +10,51 @@ module QuietQuality
9
10
 
10
11
  def initialize(**attrs)
11
12
  @attrs = attrs.map { |k, v| [k.to_s, v] }.to_h
12
- @path = @attrs.fetch("path")
13
- @body = @attrs.fetch("body")
14
- @start_line = @attrs.fetch("start_line")
15
- @stop_line = @attrs.fetch("stop_line", @start_line)
16
- @annotated_line = @attrs.fetch("annotated_line", nil)
17
- @level = @attrs.fetch("level", nil)
18
- @rule = @attrs.fetch("rule", nil)
13
+ validate_attrs!
19
14
  end
20
15
 
21
16
  def to_h
22
17
  @attrs.map { |k, v| [k.to_s, v] }.to_h
23
18
  end
19
+
20
+ def path
21
+ @_path ||= @attrs.fetch("path")
22
+ end
23
+
24
+ def body
25
+ @_body ||= @attrs.fetch("body")
26
+ end
27
+
28
+ def tool_name
29
+ @_tool_name ||= @attrs.fetch("tool_name")
30
+ end
31
+
32
+ def start_line
33
+ @_start_line ||= @attrs.fetch("start_line")
34
+ end
35
+
36
+ def stop_line
37
+ @_stop_line ||= @attrs.fetch("stop_line", start_line)
38
+ end
39
+
40
+ def annotated_line
41
+ @annotated_line ||= @attrs.fetch("annotated_line", nil)
42
+ end
43
+
44
+ def level
45
+ @_level ||= @attrs.fetch("level", nil)
46
+ end
47
+
48
+ def rule
49
+ @_rule ||= @attrs.fetch("rule", nil)
50
+ end
51
+
52
+ private
53
+
54
+ def validate_attrs!
55
+ REQUIRED_ATTRS.each do |attr|
56
+ raise ArgumentError, "Missing required attribute #{attr}" unless @attrs[attr]
57
+ end
58
+ end
24
59
  end
25
60
  end
@@ -37,7 +37,14 @@ module QuietQuality
37
37
  line = warning.fetch(:line)
38
38
  level = warning.fetch(:confidence, nil)
39
39
  rule = warning.fetch(:warning_type)
40
- Message.new(path: path, body: body, start_line: line, level: level, rule: rule)
40
+ Message.new(
41
+ path: path,
42
+ body: body,
43
+ start_line: line,
44
+ level: level,
45
+ rule: rule,
46
+ tool_name: TOOL_NAME
47
+ )
41
48
  end
42
49
  end
43
50
  end
@@ -3,7 +3,7 @@ module QuietQuality
3
3
  module Brakeman
4
4
  class Runner < BaseRunner
5
5
  def tool_name
6
- :brakeman
6
+ TOOL_NAME
7
7
  end
8
8
 
9
9
  def command
@@ -3,6 +3,7 @@ require_relative "./rubocop"
3
3
  module QuietQuality
4
4
  module Tools
5
5
  module Brakeman
6
+ TOOL_NAME = :brakeman
6
7
  end
7
8
  end
8
9
  end
@@ -36,7 +36,8 @@ module QuietQuality
36
36
  body: offense.fetch(:message),
37
37
  start_line: offense.dig(:location, :line),
38
38
  level: offense.fetch(:severity, nil),
39
- rule: offense.fetch(:linter_name, nil)
39
+ rule: offense.fetch(:linter_name, nil),
40
+ tool_name: TOOL_NAME
40
41
  )
41
42
  end
42
43
  end
@@ -3,7 +3,7 @@ module QuietQuality
3
3
  module HamlLint
4
4
  class Runner < RelevantRunner
5
5
  def tool_name
6
- :haml_lint
6
+ TOOL_NAME
7
7
  end
8
8
 
9
9
  def no_files_output
@@ -1,6 +1,7 @@
1
1
  module QuietQuality
2
2
  module Tools
3
3
  module HamlLint
4
+ TOOL_NAME = :haml_lint
4
5
  end
5
6
  end
6
7
  end
@@ -25,7 +25,8 @@ module QuietQuality
25
25
  path: entry.fetch(:filename),
26
26
  start_line: entry.fetch(:line),
27
27
  rule: entry.fetch(:description),
28
- body: entry.fetch(:docs)
28
+ body: entry.fetch(:docs),
29
+ tool_name: TOOL_NAME
29
30
  )
30
31
  end
31
32
  end
@@ -3,7 +3,7 @@ module QuietQuality
3
3
  module MarkdownLint
4
4
  class Runner < RelevantRunner
5
5
  def tool_name
6
- :markdown_lint
6
+ TOOL_NAME
7
7
  end
8
8
 
9
9
  def no_files_output
@@ -1,6 +1,7 @@
1
1
  module QuietQuality
2
2
  module Tools
3
3
  module MarkdownLint
4
+ TOOL_NAME = :markdown_lint
4
5
  end
5
6
  end
6
7
  end
@@ -16,8 +16,26 @@ module QuietQuality
16
16
 
17
17
  attr_reader :text
18
18
 
19
+ # Many people use simplecov with rspec, and its default formatter
20
+ # writes text output into the stdout stream of rspec even when rspec is
21
+ # asked for json output. I have an issue open here, and I'll get a pair
22
+ # of PRs together if they indicate any willingness to accept such a
23
+ # change: https://github.com/simplecov-ruby/simplecov/issues/1060
24
+ #
25
+ # The only stdout writes are visible on these lines:
26
+ # https://github.com/simplecov-ruby/simplecov-html/blob/main/lib/simplecov-html.rb#L31
27
+ # https://github.com/simplecov-ruby/simplecov-html/blob/main/lib/simplecov-html.rb#L80
28
+ #
29
+ # There are _hundreds_ of rspec plugins, and any of them could write to
30
+ # stdout - we probably won't worry about any but the most common.
31
+ def cleaned_text
32
+ @_cleaned_text ||= text
33
+ .gsub(/Coverage report generated.*covered.$/, "")
34
+ .gsub(/Encoding problems with file.*$/, "")
35
+ end
36
+
19
37
  def content
20
- @_content ||= JSON.parse(text, symbolize_names: true)
38
+ @_content ||= JSON.parse(cleaned_text, symbolize_names: true)
21
39
  end
22
40
 
23
41
  def examples
@@ -37,7 +55,13 @@ module QuietQuality
37
55
  body = example.dig(:exception, :message) || example.fetch(:description)
38
56
  line = example.fetch(:line_number)
39
57
  rule = example.dig(:exception, :class) || "Failed Example"
40
- Message.new(path: path, body: body, start_line: line, rule: rule)
58
+ Message.new(
59
+ path: path,
60
+ body: body,
61
+ start_line: line,
62
+ rule: rule,
63
+ tool_name: TOOL_NAME
64
+ )
41
65
  end
42
66
  end
43
67
  end
@@ -3,7 +3,7 @@ module QuietQuality
3
3
  module Rspec
4
4
  class Runner < RelevantRunner
5
5
  def tool_name
6
- :rspec
6
+ TOOL_NAME
7
7
  end
8
8
 
9
9
  def no_files_output
@@ -1,6 +1,7 @@
1
1
  module QuietQuality
2
2
  module Tools
3
3
  module Rspec
4
+ TOOL_NAME = :rspec
4
5
  end
5
6
  end
6
7
  end
@@ -37,9 +37,14 @@ module QuietQuality
37
37
  start_line: offense.dig(:location, :start_line),
38
38
  stop_line: offense.dig(:location, :last_line),
39
39
  level: offense.fetch(:severity, nil),
40
- rule: offense.fetch(:cop_name, nil)
40
+ rule: offense.fetch(:cop_name, nil),
41
+ tool_name: tool_name
41
42
  )
42
43
  end
44
+
45
+ def tool_name
46
+ TOOL_NAME
47
+ end
43
48
  end
44
49
  end
45
50
  end
@@ -3,7 +3,7 @@ module QuietQuality
3
3
  module Rubocop
4
4
  class Runner < RelevantRunner
5
5
  def tool_name
6
- :rubocop
6
+ TOOL_NAME
7
7
  end
8
8
 
9
9
  def no_files_output
@@ -1,6 +1,7 @@
1
1
  module QuietQuality
2
2
  module Tools
3
3
  module Rubocop
4
+ TOOL_NAME = :rubocop
4
5
  end
5
6
  end
6
7
  end
@@ -2,6 +2,9 @@ module QuietQuality
2
2
  module Tools
3
3
  module Standardrb
4
4
  class Parser < Rubocop::Parser
5
+ def tool_name
6
+ TOOL_NAME
7
+ end
5
8
  end
6
9
  end
7
10
  end
@@ -3,7 +3,7 @@ module QuietQuality
3
3
  module Standardrb
4
4
  class Runner < RelevantRunner
5
5
  def tool_name
6
- :standardrb
6
+ TOOL_NAME
7
7
  end
8
8
 
9
9
  def no_files_output
@@ -3,6 +3,7 @@ require_relative "./rubocop"
3
3
  module QuietQuality
4
4
  module Tools
5
5
  module Standardrb
6
+ TOOL_NAME = :standardrb
6
7
  end
7
8
  end
8
9
  end
@@ -1,3 +1,3 @@
1
1
  module QuietQuality
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -66,12 +66,6 @@ module QuietQuality
66
66
 
67
67
  private
68
68
 
69
- def changed_lines_for(diff)
70
- GitDiffParser.parse(diff).flat_map do |parsed_diff|
71
- parsed_diff.changed_line_numbers.to_set
72
- end
73
- end
74
-
75
69
  def committed_changed_files(base, sha)
76
70
  ChangedFiles.new(committed_changes(base, sha))
77
71
  end
@@ -105,11 +99,8 @@ module QuietQuality
105
99
  end
106
100
 
107
101
  def untracked_paths
108
- out, err, stat = Open3.capture3("git", "-C", path, "ls-files", "--others", "--exclude-standard")
109
- unless stat.success?
110
- warn err
111
- fail(Error, "git ls-files failed")
112
- end
102
+ out, _err, stat = Open3.capture3("git", "-C", path, "ls-files", "--others", "--exclude-standard")
103
+ fail(Error, "git ls-files failed") unless stat.success?
113
104
  out.split
114
105
  end
115
106
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quiet_quality
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Mueller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-30 00:00:00.000000000 Z
11
+ date: 2023-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
@@ -251,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
251
251
  - !ruby/object:Gem::Version
252
252
  version: '0'
253
253
  requirements: []
254
- rubygems_version: 3.1.6
254
+ rubygems_version: 3.3.7
255
255
  signing_key:
256
256
  specification_version: 4
257
257
  summary: A system for comparing quality tool outputs against the forward diffs