Feature #3809
Add rubocop to foreman
Description
Add rubocop to foreman as a lint checker for the Ruby code. A couple notes:
- To generate the config, use --auto-gen-config which will disable all failing rules and create a TODO list of things to address
- Use https://github.com/eitoball/rubocop-checkstyle_formatter to output XML for Jenkins
Check out our rubocop rake task in Katello for running rubocop via Jenkins:
Related issues
Associated revisions
refs #3809 - Fix "`ruby_20` is not a valid platform"
:ruby_20 is unknown platform for older bundler versions
Refs #3809 - Remove rubocop TODOs
Removed the following TODOs so that cops for these will run from now on:
Lint/AmbiguousOperator, DefEndAlignment, DeprecatedClassMethods
EnsureReturn, RequireParentheses, Void, BlockAlignment, EndAlignment,
UselessAccessModifier,
Style/IndentArray, IndentHash, Tab, UnlessElse, UnneededPercentQ, UnneededPercentX
RedundantReturn
Rails/Validation
Refs #3809 - Fix a few rubocop TODOs
Refs #3809 - Use parentheses in method definitions
Refs #3809 - fix shadowing outer local variables
Refs #3809 - Remove useless assignments
Refs #3809 - Enable cop BarePercentLiterals
Refs #3809 - Enable cop StringConversionInInterpolation
Refs #3809 - Remove cops for empty lines
Refs #3809 - Remove cop IndentationConsistency
Refs #3809 - Remove various small cops
Refs #3809 - Remove classcheck cop
Refs #3809 - Remove cop emptyliteral
refs #3809 - exclude auto-generated schema.rb from rubocop checks
Refs #3809 - Remove semicolon cop
Refs #3809 - Remove nested ternary and nil checking
Refs #3809 - Style/blocks cop enabled
Refs #3809 - Enable cop Style/AlignArray
Refs #3809 - Enable cop Style/IfUnlessModifier
Refs #3809 - Enable cop Style/MultilineTernaryOperator
Refs #3809 - Stabby lambda syntax for oneliners
I started by spotting log.rb which didn't have a lambda wrapping its
default scope, as needed by Rails 4. Since the style guide and most
Rails 4 documents used the stabby lambda, I turned on the cop so that we
use it everywhere there's a oneliner lambda.
Refs #3809 - Enable Rails delegate cop
Refs #3809 - Turning on some rubocop cops
Refs #3809 - Turning on some Lint cops
Refs #3809 - Turning on the AndOr cop
Refs #3809 - Using defaults for AndOr cop
Refs #3809 - Turn on MultilineTernaryOperator rubocop
Refs #3809 - regenerate .rubocop_todo.yml
History
#1
Updated by Dominic Cleal over 8 years ago
- Category set to Tests
#2
Updated by David Davis almost 8 years ago
- Assignee set to David Davis
#3
Updated by The Foreman Bot almost 8 years ago
- Status changed from New to Ready For Testing
- Target version set to 1.7.5
- Pull request https://github.com/theforeman/foreman/pull/1666 added
- Pull request deleted (
)
#4
Updated by David Davis almost 8 years ago
- Related to Bug #7022: Need to update rubocop to 0.24.1 added
#5
Updated by Dmitri Dolguikh almost 8 years ago
- Target version changed from 1.7.5 to 1.7.4
#6
Updated by David Davis almost 8 years ago
- Related to Feature #7181: Add rubocop to smart-proxy code added
#7
Updated by David Davis almost 8 years ago
- Related to Feature #7179: Document how to run rubocop added
#8
Updated by David Davis almost 8 years ago
- Related to Bug #7196: Tie into the Foreman rubocop rake task added
#9
Updated by Dominic Cleal almost 8 years ago
- Legacy Backlogs Release (now unused) set to 21
#10
Updated by David Davis almost 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 7ebd35e77de73085bc71b280084f0f4908818117.
#11
Updated by Dominic Cleal over 7 years ago
- Related to Bug #9231: Exception message missing when ENC fails to render added
#12
Updated by The Foreman Bot about 6 years ago
- Pull request https://github.com/theforeman/foreman/pull/3521 added
#13
Updated by The Foreman Bot almost 6 years ago
- Pull request https://github.com/theforeman/foreman/pull/3625 added
#14
Updated by The Foreman Bot almost 6 years ago
- Pull request https://github.com/theforeman/foreman/pull/3634 added
#15
Updated by The Foreman Bot almost 6 years ago
- Pull request https://github.com/theforeman/foreman/pull/3643 added
#16
Updated by The Foreman Bot almost 6 years ago
- Pull request https://github.com/theforeman/foreman/pull/3834 added
#17
Updated by Anonymous over 4 years ago
- Related to Refactor #22058: Rubocop Tracker Issue added
#18
Updated by The Foreman Bot almost 4 years ago
- Pull request https://github.com/theforeman/foreman/pull/6029 added
Fixes #3809 - Add rubocop to check Ruby code