config/upstream.yml in cookstyle-1.2.0 vs config/upstream.yml in cookstyle-1.3.0
- old
+ new
@@ -27,39 +27,39 @@
- '**/Vagabondfile'
- '**/Fastfile'
- '**/*Fastfile'
Exclude:
- 'vendor/**/*'
- # Default formatter will be used if no -f/--format option is given.
+ # Default formatter will be used if no `-f/--format` option is given.
DefaultFormatter: progress
# Cop names are not displayed in offense messages by default. Change behavior
- # by overriding DisplayCopNames, or by giving the -D/--display-cop-names
+ # by overriding DisplayCopNames, or by giving the `-D/--display-cop-names`
# option.
DisplayCopNames: false
# Style guide URLs are not displayed in offense messages by default. Change
- # behavior by overriding DisplayStyleGuide, or by giving the
- # -S/--display-style-guide option.
+ # behavior by overriding `DisplayStyleGuide`, or by giving the
+ # `-S/--display-style-guide` option.
DisplayStyleGuide: false
# When specifying style guide URLs, any paths and/or fragments will be
# evaluated relative to the base URL.
StyleGuideBaseURL: https://github.com/bbatsov/ruby-style-guide
# Extra details are not displayed in offense messages by default. Change
# behavior by overriding ExtraDetails, or by giving the
- # -E/--extra-details option.
+ # `-E/--extra-details` option.
ExtraDetails: false
# Additional cops that do not reference a style guide rule may be enabled by
- # default. Change behavior by overriding StyleGuideCopsOnly, or by giving
- # the --only-guide-cops option.
+ # default. Change behavior by overriding `StyleGuideCopsOnly`, or by giving
+ # the `--only-guide-cops` option.
StyleGuideCopsOnly: false
# All cops except the ones in disabled.yml are enabled by default. Change
- # this behavior by overriding DisabledByDefault. When DisabledByDefault is
- # true, all cops in the default configuration are disabled, and and only cops
+ # this behavior by overriding `DisabledByDefault`. When `DisabledByDefault` is
+ # `true`, all cops in the default configuration are disabled, and only cops
# in user configuration are enabled. This makes cops opt-in instead of
- # opt-out. Note that when DisabledByDefault is true, cops in user
+ # opt-out. Note that when `DisabledByDefault` is `true`, cops in user
# configuration will be enabled even if they don't set the Enabled parameter.
DisabledByDefault: false
- # Enables the result cache if true. Can be overridden by the --cache command
+ # Enables the result cache if `true`. Can be overridden by the `--cache` command
# line option.
UseCache: true
# Threshold for how many files can be stored in the result cache before some
# of the files are automatically removed.
MaxFilesInCache: 20000
@@ -111,10 +111,14 @@
# 'bb' => 3
# table - left alignment of keys, hash rockets, and values
# 'a' => 2
# 'bb' => 3
EnforcedHashRocketStyle: key
+ SupportedHashRocketStyles:
+ - key
+ - separator
+ - table
# Alignment of entries using colon as separator. Valid values are:
#
# key - left alignment of keys
# a: 0
# bb: 1
@@ -123,10 +127,14 @@
# bb: 1
# table - left alignment of keys and values
# a: 0
# bb: 1
EnforcedColonStyle: key
+ SupportedColonStyles:
+ - key
+ - separator
+ - table
# Select whether hashes that are the last argument in a method call should be
# inspected? Valid values are:
#
# always_inspect - Inspect both implicit and explicit hashes.
# Registers an offense for:
@@ -192,11 +200,11 @@
SupportedStyles:
- always
- conditionals
-# Checks if usage of %() or %Q() matches configuration.
+# Checks if usage of `%()` or `%Q()` matches configuration.
Style/BarePercentLiterals:
EnforcedStyle: bare_percent
SupportedStyles:
- percent_q
- bare_percent
@@ -286,18 +294,18 @@
# also a hash literal.
- context_dependent
# Indentation of `when`.
Style/CaseIndentation:
- IndentWhenRelativeTo: case
+ EnforcedStyle: case
SupportedStyles:
- case
- end
IndentOneStep: false
- # By default, the indentation width from Style/IndentationWidth is used
- # But it can be overridden by setting this parameter
- # This only matters if IndentOneStep is true
+ # By default, the indentation width from `Style/IndentationWidth` is used.
+ # But it can be overridden by setting this parameter.
+ # This only matters if `IndentOneStep` is `true`
IndentationWidth: ~
Style/ClassAndModuleChildren:
# Checks the style of children definitions at classes and modules.
#
@@ -311,11 +319,11 @@
#
# `compact` - combine definitions as much as possible
# class Foo::Bar
# end
#
- # The compact style is only forced, for classes / modules with one child.
+ # The compact style is only forced, for classes or modules with one child.
EnforcedStyle: nested
SupportedStyles:
- nested
- compact
@@ -338,21 +346,21 @@
collect!: 'map!'
inject: 'reduce'
detect: 'find'
find_all: 'select'
-# Use ` or %x around command literals.
+# Use '`' or '%x' around command literals.
Style/CommandLiteral:
EnforcedStyle: backticks
# backticks: Always use backticks.
- # percent_x: Always use %x.
- # mixed: Use backticks on single-line commands, and %x on multi-line commands.
+ # percent_x: Always use `%x`.
+ # mixed: Use backticks on single-line commands, and `%x` on multi-line commands.
SupportedStyles:
- backticks
- percent_x
- mixed
- # If false, the cop will always recommend using %x if one or more backticks
+ # If `false`, the cop will always recommend using `%x` if one or more backticks
# are found in the command string.
AllowInnerBackticks: false
# Checks formatting of special comments
Style/CommentAnnotation:
@@ -373,18 +381,19 @@
# a single line.
# When configured to `assign_inside_condition`, `SingleLineConditionsOnly`
# will only register an offense for assignment to a condition that has
# at least one multiline branch.
SingleLineConditionsOnly: true
+ IncludeTernaryExpressions: true
# Checks that you have put a copyright in a comment before any code.
#
# You can override the default Notice in your .rubocop.yml file.
#
# In order to use autocorrect, you must supply a value for the
-# AutocorrectNotice key that matches the regexp Notice. A blank
-# AutocorrectNotice will cause an error during autocorrect.
+# `AutocorrectNotice` key that matches the regexp Notice. A blank
+# `AutocorrectNotice` will cause an error during autocorrect.
#
# Autocorrect will add a copyright notice in a comment at the top
# of the file immediately after any shebang or encoding comments.
#
# Example rubocop.yml:
@@ -407,23 +416,23 @@
SupportedStyles:
- leading
- trailing
# Warn on empty else statements
-# empty - warn only on empty else
-# nil - warn on else with nil in it
-# both - warn on empty else and else with nil in it
+# empty - warn only on empty `else`
+# nil - warn on `else` with nil in it
+# both - warn on empty `else` and `else` with nil in it
Style/EmptyElse:
EnforcedStyle: both
SupportedStyles:
- empty
- nil
- both
# Use empty lines between defs.
Style/EmptyLineBetweenDefs:
- # If true, this parameter means that single line method definitions don't
+ # If `true`, this parameter means that single line method definitions don't
# need an empty line between them.
AllowAdjacentOneLineDefs: false
Style/EmptyLinesAroundBlockBody:
EnforcedStyle: no_empty_lines
@@ -467,31 +476,72 @@
Style/ExtraSpacing:
# When true, allows most uses of extra spacing if the intent is to align
# things with the previous or next line, not counting empty lines or comment
# lines.
AllowForAlignment: true
- # When true, forces the alignment of = in assignments on consecutive lines.
+ # When true, forces the alignment of `=` in assignments on consecutive lines.
ForceEqualSignAlignment: false
Style/FileName:
- # File names listed in AllCops:Include are excluded by default. Add extra
+ # File names listed in `AllCops:Include` are excluded by default. Add extra
# excludes here.
Exclude: []
- # When true, requires that each source file should define a class or module
+ # When `true`, requires that each source file should define a class or module
# with a name which matches the file name (converted to ... case).
# It further expects it to be nested inside modules which match the names
# of subdirectories in its path.
ExpectMatchingDefinition: false
- # If non-nil, expect all source file names to match the following regex.
+ # If non-`nil`, expect all source file names to match the following regex.
# Only the file name itself is matched, not the entire file path.
# Use anchors as necessary if you want to match the entire name rather than
# just a part of it.
Regex: ~
# With `IgnoreExecutableScripts` set to `true`, this cop does not
# report offending filenames for executable scripts (i.e. source
# files with a shebang in the first line).
IgnoreExecutableScripts: true
+ AllowedAcronyms:
+ - CLI
+ - DSL
+ - ACL
+ - API
+ - ASCII
+ - CPU
+ - CSS
+ - DNS
+ - EOF
+ - GUID
+ - HTML
+ - HTTP
+ - HTTPS
+ - ID
+ - IP
+ - JSON
+ - LHS
+ - QPS
+ - RAM
+ - RHS
+ - RPC
+ - SLA
+ - SMTP
+ - SQL
+ - SSH
+ - TCP
+ - TLS
+ - TTL
+ - UDP
+ - UI
+ - UID
+ - UUID
+ - URI
+ - URL
+ - UTF8
+ - VM
+ - XML
+ - XMPP
+ - XSRF
+ - XSS
Style/FirstParameterIndentation:
EnforcedStyle: special_for_inner_method_call_in_parentheses
SupportedStyles:
# The first parameter should always be indented one step more than the
@@ -500,14 +550,14 @@
# The first parameter should normally be indented one step more than the
# preceding line, but if it's a parameter for a method call that is itself
# a parameter in a method call, then the inner parameter should be indented
# relative to the inner method.
- special_for_inner_method_call
- # Same as special_for_inner_method_call except that the special rule only
+ # Same as `special_for_inner_method_call` except that the special rule only
# applies if the outer method call encloses its arguments in parentheses.
- special_for_inner_method_call_in_parentheses
- # By default, the indentation width from Style/IndentationWidth is used
+ # By default, the indentation width from `Style/IndentationWidth` is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
# Checks use of for or each in multiline loops.
Style/For:
@@ -533,16 +583,19 @@
# `always` will always add the frozen string literal comment to a file
# regardless of the Ruby version or if `freeze` or `<<` are called on a
# string literal. If you run code against multiple versions of Ruby, it is
# possible that this will create errors in Ruby 2.3.0+.
- always
+ # `never` will enforce that the frozen string literal comment does not
+ # exist in a file.
+ - never
# Built-in global variables are allowed by default.
Style/GlobalVars:
AllowedVariables: []
-# `MinBodyLength` defines the number of lines of the a body of an if / unless
+# `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
# needs to have to trigger this cop
Style/GuardClause:
MinBodyLength: 1
Style/HashSyntax:
@@ -596,17 +649,17 @@
EnforcedStyle: special_inside_parentheses
SupportedStyles:
- special_inside_parentheses
- consistent
- align_brackets
- # By default, the indentation width from Style/IndentationWidth is used
+ # By default, the indentation width from `Style/IndentationWidth` is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
# Checks the indentation of assignment RHS, when on a different line from LHS
Style/IndentAssignment:
- # By default, the indentation width from Style/IndentationWidth is used
+ # By default, the indentation width from `Style/IndentationWidth` is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
# Checks the indentation of the first key in a hash literal.
Style/IndentHash:
@@ -624,11 +677,11 @@
EnforcedStyle: special_inside_parentheses
SupportedStyles:
- special_inside_parentheses
- consistent
- align_braces
- # By default, the indentation width from Style/IndentationWidth is used
+ # By default, the indentation width from `Style/IndentationWidth` is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
Style/Lambda:
EnforcedStyle: line_count_dependent
@@ -652,11 +705,11 @@
Style/Next:
# With `always` all conditions at the end of an iteration needs to be
# replaced by next - with `skip_modifier_ifs` the modifier if like this one
# are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
EnforcedStyle: skip_modifier_ifs
- # `MinBodyLength` defines the number of lines of the a body of an if / unless
+ # `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
# needs to have to trigger this cop
MinBodyLength: 3
SupportedStyles:
- skip_modifier_ifs
- always
@@ -685,10 +738,13 @@
SupportedStyles:
- require_parentheses
- require_no_parentheses
- require_no_parentheses_except_multiline
+Style/MethodCallWithArgsParentheses:
+ IgnoredMethods: []
+
Style/MethodName:
EnforcedStyle: snake_case
SupportedStyles:
- snake_case
- camelCase
@@ -770,11 +826,11 @@
Style/MultilineOperationIndentation:
EnforcedStyle: aligned
SupportedStyles:
- aligned
- indented
- # By default, the indentation width from Style/IndentationWidth is used
+ # By default, the indentation width from `Style/IndentationWidth` is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
Style/NumericLiterals:
MinDigits: 5
@@ -812,12 +868,12 @@
'%x': ()
Style/PercentQLiterals:
EnforcedStyle: lower_case_q
SupportedStyles:
- - lower_case_q # Use %q when possible, %Q when necessary
- - upper_case_q # Always use %Q
+ - lower_case_q # Use `%q` when possible, `%Q` when necessary
+ - upper_case_q # Always use `%Q`
Style/PredicateName:
# Predicate name prefixes.
NamePrefix:
- is_
@@ -826,11 +882,11 @@
# Predicate name prefixes that should be removed.
NamePrefixBlacklist:
- is_
- has_
- have_
- # Predicate names which, despite having a blacklisted prefix, or no ?,
+ # Predicate names which, despite having a blacklisted prefix, or no `?`,
# should still be accepted
NameWhitelist:
- is_a?
# Exclude Rspec specs because there is a strong convetion to write spec
# helpers in the form of `have_something` or `be_something`.
@@ -848,34 +904,34 @@
SupportedStyles:
- compact # raise Exception.new(msg)
- exploded # raise Exception, msg
Style/RedundantReturn:
- # When true allows code like `return x, y`.
+ # When `true` allows code like `return x, y`.
AllowMultipleReturnValues: false
-# Use / or %r around regular expressions.
+# Use `/` or `%r` around regular expressions.
Style/RegexpLiteral:
EnforcedStyle: slashes
# slashes: Always use slashes.
- # percent_r: Always use %r.
- # mixed: Use slashes on single-line regexes, and %r on multi-line regexes.
+ # percent_r: Always use `%r`.
+ # mixed: Use slashes on single-line regexes, and `%r` on multi-line regexes.
SupportedStyles:
- slashes
- percent_r
- mixed
- # If false, the cop will always recommend using %r if one or more slashes
+ # If `false`, the cop will always recommend using `%r` if one or more slashes
# are found in the regexp string.
AllowInnerSlashes: false
Style/SafeNavigation:
# Safe navigation may cause a statement to start returning `nil` in addition
# to whatever it used to return.
ConvertCodeThatCanStartToReturnNil: false
Style/Semicolon:
- # Allow ; to separate several expressions on the same line.
+ # Allow `;` to separate several expressions on the same line.
AllowAsExpressionSeparator: false
Style/SignalException:
EnforcedStyle: only_raise
SupportedStyles:
@@ -894,11 +950,11 @@
Style/SingleLineMethods:
AllowIfMethodIsEmpty: true
Style/SpaceBeforeFirstArg:
- # When true, allows most uses of extra spacing if the intent is to align
+ # When `true`, allows most uses of extra spacing if the intent is to align
# things with the previous or next line, not counting empty lines or comment
# lines.
AllowForAlignment: true
Style/SpecialGlobalVars:
@@ -916,11 +972,11 @@
Style/StringLiterals:
EnforcedStyle: single_quotes
SupportedStyles:
- single_quotes
- double_quotes
- # If true, strings which span multiple lines using \ for continuation must
+ # If `true`, strings which span multiple lines using `\` for continuation must
# use the same type of quotes on each line.
ConsistentQuotesInMultiline: false
Style/StringLiteralsInInterpolation:
EnforcedStyle: single_quotes
@@ -938,22 +994,22 @@
PreferredMethods:
intern: to_sym
Style/SpaceAroundBlockParameters:
EnforcedStyleInsidePipes: no_space
- SupportedStyles:
+ SupportedStylesInsidePipes:
- space
- no_space
Style/SpaceAroundEqualsInParameterDefault:
EnforcedStyle: space
SupportedStyles:
- space
- no_space
Style/SpaceAroundOperators:
- # When true, allows most uses of extra spacing if the intent is to align
+ # When `true`, allows most uses of extra spacing if the intent is to align
# with an operator on the previous or next line, not counting empty lines
# or comment lines.
AllowForAlignment: true
Style/SpaceBeforeBlockBraces:
@@ -965,24 +1021,29 @@
Style/SpaceInsideBlockBraces:
EnforcedStyle: space
SupportedStyles:
- space
- no_space
- # Valid values are: space, no_space
EnforcedStyleForEmptyBraces: no_space
+ SupportedStylesForEmptyBraces:
+ - space
+ - no_space
# Space between { and |. Overrides EnforcedStyle if there is a conflict.
SpaceBeforeBlockParameters: true
Style/SpaceInsideHashLiteralBraces:
EnforcedStyle: space
- EnforcedStyleForEmptyBraces: no_space
SupportedStyles:
- space
- no_space
# 'compact' normally requires a space inside hash braces, with the exception
# that successive left braces or right braces are collapsed together
- compact
+ EnforcedStyleForEmptyBraces: no_space
+ SupportedStylesForEmptyBraces:
+ - space
+ - no_space
Style/SpaceInsideStringInterpolation:
EnforcedStyle: no_space
SupportedStyles:
- space
@@ -1019,30 +1080,30 @@
# If `comma`, the cop requires a comma after the last argument, but only for
# parenthesized method calls where each argument is on its own line.
# If `consistent_comma`, the cop requires a comma after the last argument,
# for all parenthesized method calls with arguments.
EnforcedStyleForMultiline: no_comma
- SupportedStyles:
+ SupportedStylesForMultiline:
- comma
- consistent_comma
- no_comma
Style/TrailingCommaInLiteral:
# If `comma`, the cop requires a comma after the last item in an array or
# hash, but only when each item is on its own line.
# If `consistent_comma`, the cop requires a comma after the last item of all
# non-empty array and hash literals.
EnforcedStyleForMultiline: no_comma
- SupportedStyles:
+ SupportedStylesForMultiline:
- comma
- consistent_comma
- no_comma
# TrivialAccessors requires exact name matches and doesn't allow
# predicated methods by default.
Style/TrivialAccessors:
- # When set to false the cop will suggest the use of accessor methods
+ # When set to `false` the cop will suggest the use of accessor methods
# in situations like:
#
# def name
# @other_name
# end
@@ -1093,33 +1154,34 @@
- non_integer
Style/WhileUntilModifier:
MaxLineLength: 80
-# WordArray enforces how array literals of word-like strings should be expressed.
+# `WordArray` enforces how array literals of word-like strings should be expressed.
Style/WordArray:
EnforcedStyle: percent
SupportedStyles:
# percent style: %w(word1 word2)
- percent
# bracket style: ['word1', 'word2']
- brackets
- # The MinSize option causes the WordArray rule to be ignored for arrays
+ # The `MinSize` option causes the `WordArray` rule to be ignored for arrays
# smaller than a certain size. The rule is only applied to arrays
- # whose element count is greater than or equal to MinSize.
+ # whose element count is greater than or equal to `MinSize`.
MinSize: 0
- # The regular expression WordRegex decides what is considered a word.
+ # The regular expression `WordRegex` decides what is considered a word.
WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/'
##################### Metrics ##################################
Metrics/AbcSize:
# The ABC size is a calculated magnitude, so this number can be an Integer or
# a Float.
Max: 15
Metrics/BlockNesting:
+ CountBlocks: false
Max: 3
Metrics/ClassLength:
CountComments: false # count full line comments?
Max: 100
@@ -1154,14 +1216,11 @@
Max: 10
Metrics/BlockLength:
CountComments: false # count full line comments?
Max: 25
- Exclude:
- - 'Rakefile'
- - '**/*.rake'
- - 'spec/**/*.rb'
+ ExcludedMethods: []
Metrics/ParameterLists:
Max: 5
CountKeywordArgs: true
@@ -1179,39 +1238,39 @@
# The value `start_of_block` means that the `end` should be aligned with line
# where the `do` keyword appears.
# The value `start_of_line` means it should be aligned with the whole
# expression's starting line.
# The value `either` means both are allowed.
- AlignWith: either
- SupportedStyles:
+ EnforcedStyleAlignWith: either
+ SupportedStylesAlignWith:
- either
- start_of_block
- start_of_line
# Align ends correctly.
Lint/EndAlignment:
# The value `keyword` means that `end` should be aligned with the matching
- # keyword (if, while, etc.).
+ # keyword (`if`, `while`, etc.).
# The value `variable` means that in assignments, `end` should be aligned
# with the start of the variable on the left hand side of `=`. In all other
# situations, `end` should still be aligned with the keyword.
# The value `start_of_line` means that `end` should be aligned with the start
# of the line which the matching keyword appears on.
- AlignWith: keyword
- SupportedStyles:
+ EnforcedStyleAlignWith: keyword
+ SupportedStylesAlignWith:
- keyword
- variable
- start_of_line
AutoCorrect: false
Lint/DefEndAlignment:
# The value `def` means that `end` should be aligned with the def keyword.
# The value `start_of_line` means that `end` should be aligned with method
# calls like `private`, `public`, etc, if present in front of the `def`
# keyword on the same line.
- AlignWith: start_of_line
- SupportedStyles:
+ EnforcedStyleAlignWith: start_of_line
+ SupportedStylesAlignWith:
- start_of_line
- def
AutoCorrect: false
Lint/InheritException:
@@ -1305,10 +1364,14 @@
EnforcedStyle: referer
SupportedStyles:
- referer
- referrer
+Rails/ReversibleMigration:
+ Include:
+ - db/migrate/*.rb
+
Rails/SafeNavigation:
# This will convert usages of `try` to use safe navigation as well as `try!`.
# `try` and `try!` work slighly differently. `try!` and safe navigation will
# both raise a `NoMethodError` if the receiver of the method call does not
# implement the intended method. `try` will not raise an exception for this.
@@ -1325,14 +1388,28 @@
SupportedStyles:
- strict
- flexible
Rails/UniqBeforePluck:
- EnforcedMode: conservative
- SupportedModes:
+ EnforcedStyle: conservative
+ SupportedStyles:
- conservative
- aggressive
AutoCorrect: false
+
+Rails/SkipsModelValidations:
+ Blacklist:
+ - decrement!
+ - decrement_counter
+ - increment!
+ - increment_counter
+ - toggle!
+ - touch
+ - update_all
+ - update_attribute
+ - update_column
+ - update_columns
+ - update_counters
Rails/Validation:
Include:
- app/models/**/*.rb