# https://github.com/alphagov/govuk-lint/pull/36 # "When we have sequence of if/unless statements, # some with multiple lines within the if statement # block and some with a single line, forcing the single # line statements to re-written makes it a harder # to follow the branching logic." Style/IfUnlessModifier: Description: Favor modifier if/unless usage when you have a single-line body. Enabled: false # Part of the orignal GDS styleguide # "Never chain do...end" # https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#syntax Style/MethodCalledOnDoEndBlock: Description: Avoid chaining a method call on a do...end block. Enabled: true # Part of the orignal GDS styleguide # "Omit the parentheses when the method doesn’t accept any arguments" # https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#syntax Style/MethodCallWithoutArgsParentheses: Description: 'Do not use parentheses for method calls with no arguments.' Enabled: true # Part of the orignal GDS styleguide # "Use Ruby 1.9 syntax for symbolic hash keys. # This includes method calls." # https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#collections Style/HashSyntax: Exclude: - 'db/schema.rb' # Part of the orignal GDS styleguide # "Add a trailing comma to multi-line array [...] # for clearer diffs with less line noise." # https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#collections Style/TrailingCommaInArrayLiteral: EnforcedStyleForMultiline: comma # Part of the orignal GDS styleguide # "Add a trailing comma to multi-line hash definitions [...] # for clearer diffs with less line noise." # https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#collections Style/TrailingCommaInHashLiteral: EnforcedStyleForMultiline: comma # Part of the orignal GDS styleguide # "When long lists of method arguments require # breaking over multiple lines, break each successive # argument on a new line, including the first argument # and closing paren. The final argument should include # a trailing comma." # https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#general Style/TrailingCommaInArguments: EnforcedStyleForMultiline: comma # Part of the orignal GDS styleguide # "Prefer %w to the literal array syntax when you need # an array of strings." # https://github.com/alphagov/styleguides/blob/6395a10d41c3938f4c147cda443fd83f854c3e7a/ruby.md#collections Style/WordArray: MinSize: 0 # "Try not to mix up single-quoted and double-quoted # strings within a file: it can make the code harder to read. # Definitely don't mix up single-quoted and double-quoted # strings within a method. If in doubt, use double-quoted strings, # because you’ll probably need to use interpolation somewhere. Style/StringLiterals: EnforcedStyle: double_quotes # Introduced in: 5ca6b7d20fd62a6ce890868abdeca12837e436d7 # "The wording of the description is hard to understand - it's not # immediately obvious what you have to do, and doesn't really say why # this is a good thing. # # It's not auto-fixable, which means it takes a lot of time to get the # syntax right for every occurrence of `%.2f` for example (taken from # `smart-answers`) for not very much benefit." Style/FormatStringToken: Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/Alias: Description: 'Use alias_method instead of alias.' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/AsciiComments: Description: 'Use only ascii symbols in comments.' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/BeginBlock: Description: 'Avoid the use of BEGIN blocks.' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/BlockDelimiters: Description: >- Avoid using {...} for multi-line blocks (multiline chaining is always ugly). Prefer {...} over do...end for single-line blocks. Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/CaseEquality: Description: 'Avoid explicit use of the case equality operator(===).' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/ClassAndModuleChildren: Description: 'Checks style of children classes and modules.' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/PreferredHashMethods: Description: 'Checks for use of deprecated Hash methods.' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # Documenting every class is a lot of effort and we don't # expect to get any value from this. Another risk of adding # more documentation is the potential for confusion if that # documentation gets out-of-sync with the class/module. Style/Documentation: Description: 'Document classes and non-namespace modules.' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/DoubleNegation: Description: 'Checks for uses of double negation (!!).' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/Encoding: Description: 'Use UTF-8 as the source file encoding.' Enabled: false # TODO: duplicate (other-excludes.yml), remove Style/FormatString: Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/GlobalVars: Description: 'Do not introduce global variables.' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # This can lead to excessively long lines. Consistent with # disabling "Layout/LineLength". # # "There are occasions where following this rule forces you to make the # code less readable." Style/GuardClause: Description: 'Check for conditionals that can be replaced with guard clauses' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/IfWithSemicolon: Description: 'Never use if x; .... Use the ternary operator instead.' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/Lambda: Description: 'Use the new lambda literal syntax for single-line blocks.' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/LambdaCall: Description: 'Use lambda.call(...) instead of lambda.(...).' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/MethodDefParentheses: Description: >- Checks if the method definitions have or don't have parentheses. Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/ModuleFunction: Description: 'Checks for usage of `extend self` in modules.' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/NegatedIf: Description: >- Favor unless over if for negative conditions (or control flow or). Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/Next: Description: 'Use `next` to skip iteration instead of a condition at the end.' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/NilComparison: Description: 'Prefer x.nil? to x == nil.' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/NumericLiterals: Description: >- Add underscores to large numeric literals to improve their readability. Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Suggest enabling with # "EnforcedStyle: compact" Style/RaiseArgs: Description: 'Checks the arguments passed to raise/fail.' Enabled: false # Analog of: 736b3d295f88b9ba6676fc168b823535582388c2 # "Disable opinionated cops" # # We should avoid cops that are based on heuristics, since # it's not clear what action to take to fix an issue. Style/RegexpLiteral: Description: >- Use %r for regular expressions matching more than `MaxSlashes` '/' characters. Use %r only for regular expressions matching more than `MaxSlashes` '/' character. Enabled: false # Introduced in: 7aaebf4dbdf2a8d677b4000d3cd3512d4fb91e99 # "This is a relatively new Ruby feature and is not mentioned in the Style # guide, so this commit disables it by default." # TODO: unclear why this is here! Style/SafeNavigation: Description: >- This cop transforms usages of a method call safeguarded by a check for the existance of the object to safe navigation (`&.`). Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/SignalException: Description: 'Checks for proper usage of fail and raise.' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Suggest enabling with # "AllowIfMethodIsEmpty: true" to accommodate Rails actions. Style/SingleLineMethods: Description: 'Avoid single-line methods.' Enabled: false # Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429 # TODO: unclear why this is here! Style/CommandLiteral: Description: 'Checks for %x when `` would do.' Enabled: false # Introduced in: b171d652d3e434b74ddc621df3b5be24c49bc7e8 # This cop was added in preperation for a Ruby feature # that is no longer likely to become part of the language. # https://github.com/rubocop-hq/rubocop/issues/7197 Style/FrozenStringLiteralComment: Enabled: false