diogot / danger-xcode_summary

A Danger plugin that shows all build errors, warnings and unit tests results generated from xcodebuild.
MIT License
137 stars 41 forks source link

sort report by alphabet #79

Closed yuyuUI closed 9 months ago

yuyuUI commented 1 year ago

Sort the result by alphabet.

yuyuUI commented 1 year ago

Hi, @diogot Thanks for this project. I would like to sort the report by alphabet. ~How can I self-test?~ Saw the readme bundle exec rake spec

However, I can not satisfy the RuboCop.

Running RuboCop...
Inspecting 6 files
..C...

Offenses:

lib/xcode_summary/plugin.rb:173:131: C: [Correctable] Layout/LineLength: Line is too long. [162/130]
      warnings = warnings.uniq.reject { |result| result.message.nil? }.sort_by { |result| result.location.file_path + result.location.line.to_s + result.message }
                                                                                                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/xcode_summary/plugin.rb:177:5: C: Metrics/AbcSize: Assignment Branch Condition size for errors is too high. [<14, 60, 8> 62.13/60]
    def errors(action) ...
    ^^^^^^^^^^^^^^^^^^
lib/xcode_summary/plugin.rb:195:68: C: [Correctable] Style/BlockDelimiters: Avoid using {...} for multi-line blocks.
      errors = errors.reject { |result| result.message.nil? }.sort { |a, b|
                                                                   ^
lib/xcode_summary/plugin.rb:196:9: C: [Correctable] Layout/IndentationWidth: Use 2 (not 0) spaces for indentation.
        a.location ? [a.location.file_path, a.location.line, a.message] <=> [b.location.file_path, b.location.line, b.message] : 0

lib/xcode_summary/plugin.rb:197:9: C: [Correctable] Layout/BlockAlignment: } at 197, 8 is not aligned with errors = errors.reject { |result| result.message.nil? }.sort { |a, b| at 195, 6.
        }
        ^

6 files inspected, 5 offenses detected, 4 offenses auto-correctable
RuboCop failed!