config/style.yml in rubocop-govuk-3.8.0 vs config/style.yml in rubocop-govuk-3.9.0
- old
+ new
@@ -78,83 +78,53 @@
# 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!
+# This is a contentious issue, since 'alias_method' works in
+# all circumstances, whereas 'alias' only works lexically. As
+# with single vs. double quotes, it seems pointless to expend
+# effort deciding between them. Our predominant style is to use
+# 'alias_method', which always works.
Style/Alias:
- Description: 'Use alias_method instead of alias.'
- Enabled: false
+ EnforcedStyle: prefer_alias_method
-# Introduced in: c69a7eb3af955d6c4c0cf0c3cec8e9f330c74429
-# TODO: unclear why this is here!
+# This prevents weird characters in comments, such as stylistic
+# quote characters and strange whitespace. We should only allow
+# special characters when they are essential for a comment. It's
+# a waste of effort to go and find the special sequence when an
+# alternative exists e.g. '×' can be replaced with '*' in maths.
Style/AsciiComments:
- Description: 'Use only ascii symbols in comments.'
- Enabled: false
+ AllowedChars: ['£']
-# 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!
+# We should only use braces in multiline blocks in a # chained
+# method call. This is consistent with the RSpec 'expect' syntax.
+#
+# expect {
+# a_long_and_complex_method_call
+# }.to raise_error(SomeError)
+#
Style/BlockDelimiters:
- Description: >-
- Avoid using {...} for multi-line blocks (multiline chaining is
- always ugly).
- Prefer {...} over do...end for single-line blocks.
- Enabled: false
+ EnforcedStyle: braces_for_chaining
# 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
@@ -167,42 +137,18 @@
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
@@ -213,16 +159,10 @@
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
@@ -255,27 +195,13 @@
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.
+# We should allow for single line empty methods, as this
+# is a convention for Rails controller 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
+ AllowIfMethodIsEmpty: true
# 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