Closed mokagio closed 7 years ago
This PR addresses #1, by installing Rubocop, running it with --auto-fix, and fixing all the remaining offences that were straightforward.
--auto-fix
Since in #1 no particular style was mentioned, I think we should just go with whichever defaults the Rubocop style guide suggests.
The only exceptions I took the liberty of making have been:
.gemspec
spec/
spec/.rubocop.yml
Things still to do:
For the record, here's the remaining offences:
Inspecting 12 files ......CC.C.. Offenses: ext/swiftlint/swiftlint.rb:15:81: C: Line is too long. [89/80] `#{swiftlint_path} #{cmd} #{swiftlint_arguments(options, additional_swiftlint_args)}` ^^^^^^^^^ ext/swiftlint/swiftlint.rb:38:3: C: Assignment Branch Condition size for swiftlint_arguments is too high. [15.13/15] def swiftlint_arguments(options, additional_swiftlint_args) ^^^ ext/swiftlint/swiftlint.rb:45:81: C: Line is too long. [86/80] map { |key, value| value.is_a?(FalseClass) ? ["no-#{key}", ''] : [key, value] }. ^^^^^^ lib/danger_plugin.rb:22:3: C: Class has too many lines. [107/100] class DangerSwiftlint < Plugin ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/danger_plugin.rb:45:5: C: Assignment Branch Condition size for lint_files is too high. [46.24/15] def lint_files(files = nil, inline_mode: false, fail_on_error: false, additional_swiftlint_args: '') ^^^ lib/danger_plugin.rb:45:5: C: Cyclomatic complexity for lint_files is too high. [12/6] def lint_files(files = nil, inline_mode: false, fail_on_error: false, additional_swiftlint_args: '') ^^^ lib/danger_plugin.rb:45:5: C: Method has too many lines. [35/10] def lint_files(files = nil, inline_mode: false, fail_on_error: false, additional_swiftlint_args: '') ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lib/danger_plugin.rb:45:5: C: Perceived complexity for lint_files is too high. [14/7] def lint_files(files = nil, inline_mode: false, fail_on_error: false, additional_swiftlint_args: '') ^^^ lib/danger_plugin.rb:45:81: C: Line is too long. [104/80] def lint_files(files = nil, inline_mode: false, fail_on_error: false, additional_swiftlint_args: '') ^^^^^^^^^^^^^^^^^^^^^^^^ lib/danger_plugin.rb:107:81: C: Line is too long. [87/80] .map { |full_options| swiftlint.lint(full_options, additional_swiftlint_args) } ^^^^^^^ lib/danger_plugin.rb:117:5: C: Assignment Branch Condition size for find_swift_files is too high. [25.04/15] def find_swift_files(dir_selected, files = nil, excluded_paths = []) ^^^ lib/danger_plugin.rb:117:5: C: Method has too many lines. [18/10] def find_swift_files(dir_selected, files = nil, excluded_paths = []) ... ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ spec/danger_plugin_spec.rb:5:1: C: Module has too many lines. [173/100] module Danger ... ^^^^^^^^^^^^^ 12 files inspected, 13 offenses detected
Excellent, so that works 👍
Edit: screencap for when Danger deletes the comment:
🎉 🚀 🤖 thanks @ashfurrow!
No problem, thanks for taking this on! 🌟
This PR addresses #1, by installing Rubocop, running it with
--auto-fix
, and fixing all the remaining offences that were straightforward.Since in #1 no particular style was mentioned, I think we should just go with whichever defaults the Rubocop style guide suggests.
The only exceptions I took the liberty of making have been:
.gemspec
, for the sake of keeping the tabbed formatting consistentspec/
folder (_see comment inspec/.rubocop.yml
)Things still to do:
For the record, here's the remaining offences: