summaryrefslogtreecommitdiff
path: root/.rubocop.yml
Commit message (Collapse)AuthorAgeFilesLines
* Add leading comment space copissue_15557Felipe Artur2016-05-311-1/+1
|
* 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
* Add descriptive comments for rubocop-rspec copsRobert Speicher2016-05-231-0/+14
| | | | [ci skip]
* Add rubocop-rspecrs-rubocop-rspecRobert Speicher2016-05-231-0/+50
| | | | | Almost all cops are starting as disabled until we can fix their violations.
* Merge branch 'complexity/enable-multiple-rubocop-cops' into 'master' Robert Speicher2016-05-231-34/+31
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable multiple Rubocop cops that can be enabled See https://gitlab.com/gitlab-org/gitlab-ce/issues/17406 This enabled following cops: ```text Lint/CircularArgumentReference: Description: Default values in optional keyword arguments and optional ordinal arguments ---------------- Lint/ConditionPosition: Description: Checks for condition placed in a confusing position relative to the keyword. StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition ---------------- Lint/Debugger: Description: Check for debugger calls. ---------------- Lint/DefEndAlignment: Description: Align ends corresponding to defs correctly. ---------------- Lint/DuplicateMethods: Description: Check for duplicate method definitions. ---------------- Lint/DuplicatedKey: Description: Check for duplicate keys in hash literals. ---------------- Lint/EachWithObjectArgument: Description: Check for immutable argument given to each_with_object. ---------------- Lint/ElseLayout: Description: Check for odd code arrangement in an else block. ---------------- Lint/EmptyEnsure: Description: Checks for empty ensure block. ---------------- Lint/EmptyInterpolation: Description: Checks for empty string interpolation. ---------------- Lint/EndAlignment: Description: Align ends correctly. ---------------- Lint/EndInMethod: Description: END blocks should not be placed inside method definitions. ---------------- Lint/EnsureReturn: Description: Do not use return in an ensure block. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure ---------------- Lint/Eval: Description: The use of eval represents a serious security risk. ---------------- Lint/FloatOutOfRange: Description: Catches floating-point literals too large or small for Ruby to represent. ---------------- Lint/FormatParameterMismatch: Description: The number of parameters to format/sprint must match the fields. ---------------- Lint/ImplicitStringConcatenation: Description: Checks for adjacent string literals on the same line, which could better be represented as a single string literal. ---------------- Lint/InvalidCharacterLiteral: Description: Checks for invalid character literals with a non-escaped whitespace character. ---------------- Lint/LiteralInInterpolation: Description: Checks for literals used in interpolation. ---------------- Lint/NestedMethodDefinition: Description: Do not use nested method definitions. StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-methods ---------------- Lint/NextWithoutAccumulator: Description: Do not omit the accumulator when calling `next` in a `reduce`/`inject` block. ---------------- Lint/RandOne: Description: Checks for `rand(1)` calls. Such calls always return `0` and most likely a mistake. ---------------- Lint/RequireParentheses: Description: Use parentheses in the method call to avoid confusion about precedence. ---------------- Lint/UnreachableCode: Description: Unreachable code. ---------------- Lint/UselessComparison: Description: Checks for comparison of something with itself. ---------------- Lint/UselessElseWithoutRescue: Description: Checks for useless `else` in `begin..end` without `rescue`. ---------------- Lint/UselessSetterCall: Description: Checks for useless setter call to a local variable. ---------------- Lint/Void: Description: Possible use of operator/literal/variable in void context. ---------------- Performance/DoubleStartEndWith: Description: Use `str.{start,end}_with?(x, ..., y, ...)` instead of `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`. ---------------- Performance/RedundantSortBy: Description: Use `sort` instead of `sort_by { |x| x }`. ---------------- Rails/FindBy: Description: Prefer find_by over where.first. Include: - app/models/**/*.rb ---------------- Rails/FindEach: Description: Prefer all.find_each over all.find. Include: - app/models/**/*.rb ---------------- Rails/PluralizationGrammar: Description: Checks for incorrect grammar when using methods like `3.day.ago`. ---------------- Rails/ScopeArgs: Description: Checks the arguments of ActiveRecord scopes. Include: - app/models/**/*.rb ``` See merge request !4261
| * Enabled multiple Rubocop cops that can be enabledGrzegorz Bizon2016-05-231-34/+31
| | | | | | | | | | This enables multiple Rubocop cops that already conform to our codebase and do not require fixes.
* | Merge branch 'rs-space-around-keyword' into 'master' Robert Speicher2016-05-231-2/+1
|\ \ | | | | | | | | | | | | | | | | | | Enable Style/SpaceAroundKeyword cop and fix offenses Ref: https://gitlab.com/gitlab-org/gitlab-ce/issues/17478 See merge request !4259
| * | Enable Style/SpaceAroundKeyword cop and fix offensesRobert Speicher2016-05-231-2/+1
| | |
* | | Merge branch 'rs-update-rubocop' into 'master' Robert Speicher2016-05-231-0/+18
|\ \ \ | | | | | | | | | | | | | | | | Update rubocop to 0.40.0 See merge request !4258
| * | | Update rubocop to 0.40.0Robert Speicher2016-05-231-0/+18
| |/ /
* | | Merge branch 'complexity/rubocop-style-loop' into 'master' Robert Speicher2016-05-231-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable Style/InfiniteLoop Rubocop cop This MR enabled Style/InfiniteLoop Rubocop cop, and fixes offenses. See https://gitlab.com/gitlab-org/gitlab-ce/issues/17478 See merge request !4257
| * | | Enable Style/InfiniteLoop Rubocop copcomplexity/rubocop-style-loopGrzegorz Bizon2016-05-231-1/+1
| |/ /
* | | Merge branch 'rs-range-include' into 'master' Robert Speicher2016-05-231-2/+1
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | Enable Performance/RangeInclude cop and fix single offense Ref: https://gitlab.com/gitlab-org/gitlab-ce/issues/17478 See merge request !4255
| * | Enable Performance/RangeInclude cop and fix single offensers-range-includeRobert Speicher2016-05-231-2/+1
| |/
* | Merge branch 'rs-start-with' into 'master' Robert Speicher2016-05-231-2/+1
|\ \ | | | | | | | | | | | | | | | | | | Enable Performance/StartWith cop and fix offenses Ref: https://gitlab.com/gitlab-org/gitlab-ce/issues/17478 See merge request !4256
| * | Enable Performance/StartWith cop and fix offensesrs-start-withRobert Speicher2016-05-231-2/+1
| |/
* | Enable Style/DefWithParentheses cop and fix single offenseRobert Speicher2016-05-231-1/+1
|/
* Updated Rubocop for generator_templates/fix-generator-templates-directoryYorick Peterse2016-05-191-1/+1
|
* Merge branch 'migration-helpers' into 'master' Robert Speicher2016-05-191-0/+1
|\ | | | | | | | | | | | | | | | | | | Added helper methods for database migrations These helpers can ultimately be used to write migrations that don't require downtime. See #15464 for more information. See merge request !3860
| * Tell Rubocop to ignore lib/templatesYorick Peterse2016-05-121-1/+2
| |
* | Require space around operatorsGabriel Mazetto2016-05-131-2/+2
| |
* | Merge branch 'deprecated-class-methods-cop' into 'master' Robert Speicher2016-05-121-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Enable the Rubocop DeprecatedClassMethods cop This reports uses of `File.exists?` and `Dir.exists?`, which were both deprecated in Ruby and will eventually be removed in favor of `.exist?`. Also fixes all existing uses of the deprecated methods. See merge request !4087
| * | Enable the Rubocop DeprecatedClassMethods copConnor Shea2016-05-081-1/+1
| |/ | | | | | | | | | | This reports uses of `File.exists?` and `Dir.exists?`, which were both deprecated in Ruby and will eventually be removed in favor of `.exist?`. Also fixes all existing uses of the deprecated methods.
* | Merge branch 'casecmp-cop' into 'master' Rémy Coutable2016-05-111-2/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable Rubocop Casecmp Performance Cop. Also fixes the errors caused by enabling the cop. `casecmp` is more performant than `.downcase` and `==`. See also: https://github.com/bbatsov/rubocop/blob/master/lib/rubocop/cop/performance/casecmp.rb See merge request !3957
| * | Enable Rubocop Casecmp Performance Cop.Connor Shea2016-05-101-2/+1
| |/ | | | | | | Also fixes the errors caused by enabling the cop. casecmp is more performant than `.downcase` and `==`.
* | Enable the StringReplacement cop.Connor Shea2016-05-101-1/+2
|/ | | | | | | | Also fix one use of `gsub` that would be faster as `delete`. Use `tr` instead of `gsub` when you are replacing the same number of characters. Use `delete` instead of `gsub` when you are deleting characters.
* Enable LstripRstrip copConnor Shea2016-04-271-2/+1
| | | | | This requires no code changes since it doesn't actually change anything in the codebase, just preventative.
* Backport select_helper from EEbackport_changes_from_eeValery Sizov2016-04-201-1/+1
|
* Decrease threshold for ABC Size metric in Rubocopcomplexity/descrease-abc-size-thresholdGrzegorz Bizon2016-04-111-1/+1
| | | | To 60.
* Update Rubocop from 0.35.1 to 0.38.0.connorshea2016-03-201-469/+489
| | | | | | | | | | | | | | | | Discussed in #14233. See [their releases](https://github.com/bbatsov/rubocop/releases) for more info. Changes: - Enable DisplayCopNames for lint output. - Default behavior for `Alias` changed, set to enforce `prefer_alias_method`. - Enabling Rails cops changed to new syntax. - Remove StyleGuides and move Descriptions to comments. - Add missing cops. - Add TODOs for cops that should be enabled in the future. - Set TargetRubyVersion to 2.1.
* Disabled Rails/Date copGabriel Mazetto2015-12-151-0/+6
|
* Updated .rubocop.yml to match 0.35.x changesGabriel Mazetto2015-12-141-6/+30
|
* Bump cyclomatic and perceived complexity threshold by oneGrzegorz Bizon2015-12-081-2/+2
|
* Enable rubocop metricsGrzegorz Bizon2015-12-081-19/+24
| | | | | This enables rubocop metrics like CyclomaticComplexity and ABCSize. Initial threshold values are high, should be probably decreased.
* Enable the Lint/RescueException coprs-rescueexception-copRobert Speicher2015-11-241-1/+1
|
* Enable "UselessAssignment" rubocop lintGuilherme Garnier2015-10-031-1/+1
|
* fix rubocopValery Sizov2015-09-161-0/+1
|
* fix specs. Stage 5Valery Sizov2015-09-151-0/+1
|
* Enable rubocop for tests tooDmitriy Zaporozhets2015-06-221-2/+0
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Fixed the Rails/ActionFilter copJeroen van Baarsen2015-04-201-1/+1
| | | | Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
* No tabs in code!Dmitriy Zaporozhets2015-04-151-1/+1
| | | | Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
* Style/RedundantReturn enabledmore-rubocop-stylesDmitriy Zaporozhets2015-03-241-1/+1
|
* Enable more rubocop style checksDmitriy Zaporozhets2015-03-241-7/+7
|
* Enable ParenthesesAsGroupedExpression ruleDmitriy Zaporozhets2015-03-021-1/+1
|
* Rubocop: indentation fixes Yay!!!Dmitriy Zaporozhets2015-02-021-2/+2
|
* Rubocop: no trailing newlinesDmitriy Zaporozhets2015-02-021-3/+3
|
* Rubocop: Dont allow puts or print to stdoutDmitriy Zaporozhets2015-02-021-1/+4
|