summaryrefslogtreecommitdiff
path: root/.rubocop.yml
Commit message (Collapse)AuthorAgeFilesLines
* Enable Style/IdenticalConditionalBranches Rubocop copGrzegorz Bizon2016-07-081-1/+1
|
* Enable Style/EmptyLines cop, remove redundant onesrubocop/enable-cops-for-empty-linesGrzegorz Bizon2016-07-011-1/+1
|
* Enable Style/UnneededCapitalW Rubocop coprubocop/enable-unneeded-capital-w-copGrzegorz Bizon2016-06-301-1/+1
|
* Merge branch 'rubocop/enable-space-after-cops' into 'master' Robert Speicher2016-06-291-2/+2
|\ | | | | | | | | | | | | Enable Style/SpaceAfterComma and Colon Rubocop cops See #17478 See merge request !4991
| * Enable Style/SpaceAfterComma Rubocop coprubocop/enable-space-after-copsGrzegorz Bizon2016-06-291-1/+1
| |
| * Enable Style/SpaceAfterColon Rubocop copsGrzegorz Bizon2016-06-291-1/+1
| |
* | Added RuboCop cops for checking DB migrationsmigration-copsYorick Peterse2016-06-291-1/+3
|/ | | | | | | | | | | | | | There are currently two cops for this: * Migration/AddIndex: checks if indexes are added concurrently * Migration/ColumnWithDefault: checks if columns with default values are added in a concurrent manner Both cops are fairly simple and make no attempt at correcting the code as this is quite hard to do (e.g. modifications may need to be applied in various places in the same file). They however should provide enough to catch people ignoring the comments in generated migrations telling them to use add_concurrent_index or add_column_with_default.
* Merge branch 'style/enable-multiline-block-chain-rubocop-cop' into 'master' Robert Speicher2016-06-131-1/+1
|\ | | | | | | | | | | | | | | | | Enable Style/MultilineBlockChain rubocop style cop Avoid multi-line chains of blocks. See #17478. See merge request !4349
| * Enable Style/MultilineBlockChain rubocop style copstyle/enable-multiline-block-chain-rubocop-copGrzegorz Bizon2016-06-101-1/+1
| | | | | | | | See #17478
* | Enable RuboCop for migrationsenable-rubocop-for-migrationsSean McGivern2016-06-091-1/+2
|/ | | | | | | Migrations shouldn't fail RuboCop checks - especially lint checks, such as the nested method check. To avoid changing code in existing migrations, add the magic comment to the top of each of them to skip that file.
* Merge branch 'rubocop/disable-uniq-before-pluck-cop' into 'master' Robert Speicher2016-06-081-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | Disable Rails/UniqBeforePluck rubocop cop Rails/UniqBeforePluck seems to have some bugs * https://github.com/bbatsov/rubocop/issues/3122 * https://github.com/bbatsov/rubocop/issues/3148 and we had some problems in EE with that https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/425#note_12245005 See merge request !4477
| * Disable Rails/UniqBeforePluck rubocop coprubocop/disable-uniq-before-pluck-copGrzegorz Bizon2016-06-041-0/+3
| |
* | Merge branch 'rubocop/enable-ambiguous-operator-rubocop-lint' into 'master' Robert Speicher2016-06-051-1/+1
|\ \ | |/ |/| | | | | | | | | | | | | Enable Lint/AmbiguousOperator rubocop cop Enforce using parentheses if ambiguous operators are detected, like `header *some_method` or `array.select &:even?`. See #17478 See merge request !4454
| * Enable Lint/AmbiguousOperator rubocop coprubocop/enable-ambiguous-operator-rubocop-lintGrzegorz Bizon2016-06-031-1/+1
| | | | | | | | See #17478
* | Enable Style/EmptyLinesAroundAccessModifier rubocop coprubocop/enable-empty-lines-around-access-modifier-copGrzegorz Bizon2016-06-031-1/+1
|/ | | | See #17478
* Merge branch 'style/enable-semicolon-rubocop-cop' into 'master' Robert Speicher2016-06-011-1/+1
|\ | | | | | | | | | | | | | | | | Enable Style/Semicolon rubocop style cop Don't use semicolons to terminate expressions. See #17478. See merge request !4351
| * Enable Style/Semicolon rubocop style copstyle/enable-semicolon-rubocop-copGrzegorz Bizon2016-06-011-1/+1
| | | | | | | | See #17478
* | Merge branch 'rubocop/enable-style-for-cop' into 'master' Robert Speicher2016-06-011-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Enable Style/For rubocop cop > Do not use `for`, unless you know exactly why. Most of the time iterators should be used instead. `for` is implemented in terms of `each` (so you're adding a level of indirection), but with a twist - `for` doesn't introduce a new scope (unlike `each`) and variables defined in its block will be visible outside it. See #17478 See merge request !4397
| * | Enable Style/For rubocop coprubocop/enable-style-for-copGrzegorz Bizon2016-06-011-1/+1
| |/ | | | | | | | | | | Do not use for, unless you know exactly why. See #17478
* | Merge branch 'issue_15557' into 'master' Rémy Coutable2016-06-011-1/+1
|\ \ | |/ |/| | | | | | | | | Fix error 500 when sorting issues by milestone due date and filtering by labels fixes #15557 See merge request !4327
| * Add leading comment space copissue_15557Felipe Artur2016-05-311-1/+1
| |
* | Merge branch 'rubocop/enable-space-before-comma-cop' into 'master' Robert Speicher2016-05-301-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Enable Style/SpaceBeforeComma rubocop cop No spaces before commas. See #17478 See merge request !4360
| * | Enable Style/SpaceBeforeComma rubocop coprubocop/enable-space-before-comma-copGrzegorz Bizon2016-05-301-1/+1
| |/ | | | | | | | | | | No spaces before commas. See #17478
* | Merge branch 'rubocop/enable-performance-times-map-cop' into 'master' Robert Speicher2016-05-301-2/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Enable Performance/TimesMap Rubocop cop Use Array.new with a block instead of `.times.collect` / `.times.map`. See #17478 See merge request !4357
| * | Enable Performance/TimesMap Rubocop coprubocop/enable-performance-times-map-copGrzegorz Bizon2016-05-301-2/+1
| |/ | | | | | | | | | | Use Array.new with a block instead of `.times.collect` / `.times.map`. See #17478
* | Merge branch 'rubocop/enable-negatedif-style-cop' into 'master' Robert Speicher2016-05-301-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable Style/NegatedIf Rubocop cop Favor `unless` over `if` for negative conditions (or control flow ||). ```ruby # bad do_something if !some_condition # bad do_something if not some_condition # good do_something unless some_condition # good some_condition || do_something ``` See #17478 See merge request !4355
| * | Enable Style/NegatedIf Rubocop coprubocop/enable-negatedif-style-copGrzegorz Bizon2016-05-301-1/+1
| |/ | | | | | | | | | | | | Favor `unless` over `if` for negative conditions (or control flow ||). See #17478
* | Merge branch 'rubocop/enable-literal-in-condition-cop' into 'master' Robert Speicher2016-05-301-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Enable Lint/LiteralInCondition rubocop cop Detects literals used in conditions. See #17478 See merge request !4354
| * | Enable Lint/LiteralInCondition rubocop coprubocop/enable-literal-in-condition-copGrzegorz Bizon2016-05-301-1/+1
| |/ | | | | | | | | | | Checks of literals used in conditions. See #17478
* | Merge branch 'style/enable-multiline-if-then-rubocop-cop' into 'master' Robert Speicher2016-05-301-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Enable Style/MultilineIfThen rubocop cop Do not use then for multi-line if. See #7478. See merge request !4353
| * | Enable Style/MultilineIfThen rubocop copstyle/enable-multiline-if-then-rubocop-copGrzegorz Bizon2016-05-301-1/+1
| |/ | | | | | | | | | | Do not use then for multi-line if. See #7478.
* | Merge branch 'style/enable-method-def-parentheses-rubocop-cop' into 'master' Robert Speicher2016-05-301-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Enable Style/MethodDefParentheses rubocop cop Use def with parentheses when there are parameters. See #17478 See merge request !4352
| * | Enable Style/MethodDefParentheses rubocop copstyle/enable-method-def-parentheses-rubocop-copGrzegorz Bizon2016-05-301-1/+1
| |/ | | | | | | | | | | Use def with parentheses when there are parameters. See #17478
* | Merge branch 'style/enable-rubocop-indent-assignment-cop' into 'master' Robert Speicher2016-05-301-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Enable Style/IndentAssignment Rubocop style cop Checks the indentation of the first line of the right-hand-side of a multi-line assignment. See #17478 See merge request !4348
| * | Enable Style/IndentAssignment Rubocop style copstyle/enable-rubocop-indent-assignment-copGrzegorz Bizon2016-05-301-1/+1
| |/ | | | | | | See #17478
* | Merge branch 'style/enable-while-until-do-rubocop-style-cop' into 'master' Robert Speicher2016-05-301-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Enable Style/WhileUntilDo rubocop style cop Checks for redundant `do` after `while` or `until`. See #17478 See merge request !4350
| * | Enable Style/WhileUntilDo rubocop style copstyle/enable-while-until-do-rubocop-style-copGrzegorz Bizon2016-05-301-1/+1
| |/ | | | | | | See #17478
* | Merge branch 'style/enable-rubocop-end-of-line-cop' into 'master' Robert Speicher2016-05-301-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable Style/EndOfLine Rubocop style cop Use Unix-style line endings. Removed carriage return character from end of each line in `app/controllers/projects/find_file_controller.rb` See #17478 See merge request !4347
| * | Enable Style/EndOfLine Rubocop style copstyle/enable-rubocop-end-of-line-copGrzegorz Bizon2016-05-301-1/+1
| |/ | | | | | | Use Unix-style line endings. See #17478.
* | Merge branch 'style/enable-block-alignment-rubocop-lint' into 'master' Robert Speicher2016-05-301-1/+1
|\ \ | | | | | | | | | | | | | | | | | | Enable Lint/BlockAlignment Rubocop cop See #17478 See merge request !4346
| * | Enable Lint/BlockAlignment Rubocop copstyle/enable-block-alignment-rubocop-lintGrzegorz Bizon2016-05-301-1/+1
| |/ | | | | | | See #17478
* | Merge branch 'rubocop/enable-redundant-parentheses-cop' into 'master' Robert Speicher2016-05-301-2/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Enable Style/RedundantParentheses rubocop cop Checks for parentheses that seem not to serve any purpose. See #17478 See merge request !4361
| * | Enable Style/RedundantParentheses rubocop coprubocop/enable-redundant-parentheses-copGrzegorz Bizon2016-05-301-2/+1
| |/ | | | | | | See #17478
* | Merge branch 'rubocop/enable-space-before-comment-cop' into 'master' Robert Speicher2016-05-301-1/+1
|\ \ | | | | | | | | | | | | | | | | | | Enable Style/SpaceBeforeComment rubocop cop See #17478 See merge request !4358
| * | Enable Style/SpaceBeforeComment rubocop coprubocop/enable-space-before-comment-copGrzegorz Bizon2016-05-301-1/+1
| |/ | | | | | | See #17478
* | Enable Style/SpaceAfterMethodName rubocop coprubocop/enable-space-after-method-name-copGrzegorz Bizon2016-05-301-1/+1
|/ | | | See #17478
* Merge branch 'complexity/enable-multiple-rubocop-cops-2' into 'master' Robert Speicher2016-05-251-26/+42
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable multiple compatible Rubocop cops ## What does this MR do? This MR enables multiple Rubocop cops, that are already compatible with our codebase. See #17406. Cops enabled: ```text Style/ArrayJoin: Description: Use Array#join instead of Array#*. StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join ---------------- Style/Attr: Description: Checks for uses of Module#attr. StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr ---------------- Style/BlockComments: Description: Do not use block comments. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments ---------------- Style/ClassMethods: Description: Use self when defining module/class methods. StyleGuide: https://github.com/bbatsov/ruby-style-guide#def-self-class-methods ---------------- Style/EndBlock: Description: Avoid the use of END blocks. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks ---------------- Style/EvenOdd: Description: Favor the use of Fixnum#even? && Fixnum#odd? StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods ---------------- Style/FileName: Description: Use snake_case for source file names. StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files ExpectMatchingDefinition: false ---------------- Style/FirstMethodParameterLineBreak: Description: Checks for a line break before the first parameter in a multi-line method parameter definition. ---------------- Style/FlipFlop: Description: Checks for flip flops StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops ---------------- Style/GlobalVars: Description: Do not introduce global variables. StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars Reference: http://www.zenspider.com/Languages/Ruby/QuickRef.html ---------------- Style/IfWithSemicolon: Description: Do not use if x; .... Use the ternary operator instead. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs ---------------- Style/LambdaCall: Description: Use lambda.call(...) instead of lambda.(...). StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call EnforcedStyle: call ---------------- Style/MethodName: Description: Use the configured style when naming methods. StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars EnforcedStyle: snake_case ---------------- Style/MultilineMethodDefinitionBraceLayout: Description: Checks that the closing brace in a method definition is symmetrical with respect to the opening brace and the method parameters. ---------------- Style/NestedModifier: Description: Avoid using nested modifiers. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-modifiers ---------------- Style/OpMethod: Description: When defining binary operators, name the argument other. StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg ---------------- Style/SignalException: Description: Checks for proper usage of fail and raise. StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-raise-over-fail EnforcedStyle: only_raise ---------------- Style/SpaceAfterNot: Description: Tracks redundant space after the ! operator. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang ---------------- Style/SpaceBeforeSemicolon: Description: No spaces before semicolons. ---------------- Style/SpaceInsideRangeLiteral: Description: No spaces inside range literals. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals ---------------- Style/SpaceInsideStringInterpolation: Description: Checks for padding/surrounding spaces inside string interpolation. StyleGuide: https://github.com/bbatsov/ruby-style-guide#string-interpolation EnforcedStyle: no_space ---------------- Style/StabbyLambdaParentheses: Description: Check for the usage of parentheses around stabby lambda arguments. StyleGuide: https://github.com/bbatsov/ruby-style-guide#stabby-lambda-with-args EnforcedStyle: require_parentheses ---------------- Style/StringMethods: Description: Checks if configured preferred methods are used over non-preferred. PreferredMethods: intern: to_sym ---------------- Style/VariableInterpolation: Description: Don't interpolate global, instance and class variables directly in strings. StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate ---------------- Style/VariableName: Description: Use the configured style when naming variables. StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars EnforcedStyle: snake_case ---------------- Style/WhenThen: Description: Use when x then ... for one-line cases. StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases ---------------- Style/WhileUntilModifier: Description: Favor modifier while/until usage when you have a single-line body. StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier MaxLineLength: 80 ``` Closes #17406 See merge request !4286
| * Remove unneeded indentation from RuboCop configRobert Speicher2016-05-251-1/+1
| | | | | | | | [ci skip]
| * Enable multiple compatible Rubocop copscomplexity/enable-multiple-rubocop-cops-2Grzegorz Bizon2016-05-251-26/+42
| | | | | | | | Closes #17406
* | Enable RSpec/NotToNot cop and auto-correct offensesrs-rubocop-nottonotRobert Speicher2016-05-241-1/+1
|/ | | | Also removes the note from the development/testing.md guide