Project

General

Profile

Feature #3809

Add rubocop to foreman

Added by David Davis almost 6 years ago. Updated about 1 year ago.


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:

https://github.com/Katello/katello/blob/628a01ad914e7c5d63c8d325e4798a8c19755cff/lib/katello/tasks/rubocop.rake


Related issues

Related to Katello - Bug #7022: Need to update rubocop to 0.24.1Closed2014-08-11
Related to Smart Proxy - Feature #7181: Add rubocop to smart-proxy codeClosed2014-08-20
Related to Website - Feature #7179: Document how to run rubocopClosed
Related to Katello - Bug #7196: Tie into the Foreman rubocop rake taskRejected
Related to Foreman - Bug #9231: Exception message missing when ENC fails to renderClosed2015-02-05
Related to Foreman - Refactor #22058: Rubocop Tracker IssueNew

Associated revisions

Revision 7ebd35e7 (diff)
Added by David Davis about 5 years ago

Fixes #3809 - Add rubocop to check Ruby code

Revision 35e26ce8 (diff)
Added by Imre Farkas about 5 years ago

refs #3809 - Fix "`ruby_20` is not a valid platform"

:ruby_20 is unknown platform for older bundler versions

Revision 96144a47 (diff)
Added by Daniel Lobato Garcia almost 5 years ago

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

Revision 4f7a4d0b (diff)
Added by David Davis almost 5 years ago

Refs #3809 - Fix a few rubocop TODOs

Revision 5f029ed6 (diff)
Added by Daniel Lobato Garcia almost 5 years ago

Refs #3809 - Use parentheses in method definitions

Revision bfcc8168 (diff)
Added by Daniel Lobato Garcia almost 5 years ago

Refs #3809 - fix shadowing outer local variables

Revision 2312cccf (diff)
Added by Daniel Lobato Garcia almost 5 years ago

Refs #3809 - Remove useless assignments

Revision 3efe1dab (diff)
Added by Daniel Lobato Garcia over 4 years ago

Refs #3809 - Enable cop BarePercentLiterals

Revision 5c02cfe5 (diff)
Added by Daniel Lobato Garcia over 4 years ago

Refs #3809 - Enable cop StringConversionInInterpolation

Revision abd8f1d1 (diff)
Added by Daniel Lobato Garcia over 4 years ago

Refs #3809 - Remove cops for empty lines

Revision afe02d30 (diff)
Added by Daniel Lobato Garcia over 4 years ago

Refs #3809 - Remove cop IndentationConsistency

Revision 9271a4bf (diff)
Added by Daniel Lobato Garcia over 4 years ago

Refs #3809 - Remove various small cops

Revision cd032085 (diff)
Added by Daniel Lobato Garcia over 4 years ago

Refs #3809 - Remove classcheck cop

Revision 6ace062d (diff)
Added by Daniel Lobato Garcia over 4 years ago

Refs #3809 - Remove cop emptyliteral

Revision 8a11eff7 (diff)
Added by Dominic Cleal over 4 years ago

refs #3809 - exclude auto-generated schema.rb from rubocop checks

Revision 2d8b4fef (diff)
Added by Daniel Lobato Garcia over 4 years ago

Refs #3809 - Remove semicolon cop

Revision b2b7a13b (diff)
Added by Daniel Lobato Garcia over 4 years ago

Refs #3809 - Remove nested ternary and nil checking

Revision 7deaced2 (diff)
Added by Daniel Lobato Garcia about 4 years ago

Refs #3809 - Style/blocks cop enabled

Revision 17622a29 (diff)
Added by Daniel Lobato Garcia about 4 years ago

Refs #3809 - Enable cop Style/AlignArray

Revision 111b0459 (diff)
Added by Daniel Lobato Garcia about 4 years ago

Refs #3809 - Enable cop Style/IfUnlessModifier

Revision c1c9649b (diff)
Added by Daniel Lobato Garcia about 4 years ago

Refs #3809 - Enable cop Style/MultilineTernaryOperator

Revision bb3572ff (diff)
Added by Daniel Lobato Garcia about 4 years ago

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.

Revision 9a9ec5b1 (diff)
Added by Daniel Lobato Garcia about 4 years ago

Refs #3809 - Enable Rails delegate cop

Revision f4459c11 (diff)
Added by David Davis over 3 years ago

Refs #3809 - Turning on some rubocop cops

Revision 2ea02ed8 (diff)
Added by David Davis about 3 years ago

Refs #3809 - Turning on some Lint cops

Revision 287082a5 (diff)
Added by David Davis about 3 years ago

Refs #3809 - Turning on the AndOr cop

Revision e263719a (diff)
Added by David Davis about 3 years ago

Refs #3809 - Using defaults for AndOr cop

Revision 379b56f2 (diff)
Added by David Davis about 3 years ago

Refs #3809 - Turn on MultilineTernaryOperator rubocop

Revision a8a35f5e (diff)
Added by Michael Moll about 1 year ago

Refs #3809 - regenerate .rubocop_todo.yml

History

#1 Updated by Dominic Cleal almost 6 years ago

  • Category set to Tests

#2 Updated by David Davis about 5 years ago

  • Assignee set to David Davis

#3 Updated by The Foreman Bot about 5 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 about 5 years ago

  • Related to Bug #7022: Need to update rubocop to 0.24.1 added

#5 Updated by Dmitri Dolguikh about 5 years ago

  • Target version changed from 1.7.5 to 1.7.4

#6 Updated by David Davis about 5 years ago

  • Related to Feature #7181: Add rubocop to smart-proxy code added

#7 Updated by David Davis about 5 years ago

#8 Updated by David Davis about 5 years ago

  • Related to Bug #7196: Tie into the Foreman rubocop rake task added

#9 Updated by Dominic Cleal about 5 years ago

  • Legacy Backlogs Release (now unused) set to 21

#10 Updated by David Davis about 5 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#11 Updated by Dominic Cleal over 4 years ago

  • Related to Bug #9231: Exception message missing when ENC fails to render added

#12 Updated by The Foreman Bot over 3 years ago

  • Pull request https://github.com/theforeman/foreman/pull/3521 added

#13 Updated by The Foreman Bot about 3 years ago

  • Pull request https://github.com/theforeman/foreman/pull/3625 added

#14 Updated by The Foreman Bot about 3 years ago

  • Pull request https://github.com/theforeman/foreman/pull/3634 added

#15 Updated by The Foreman Bot about 3 years ago

  • Pull request https://github.com/theforeman/foreman/pull/3643 added

#16 Updated by The Foreman Bot about 3 years ago

  • Pull request https://github.com/theforeman/foreman/pull/3834 added

#17 Updated by Michael Moll over 1 year ago

#18 Updated by The Foreman Bot about 1 year ago

  • Pull request https://github.com/theforeman/foreman/pull/6029 added

Also available in: Atom PDF