config/upstream.yml in cookstyle-7.1.2 vs config/upstream.yml in cookstyle-7.2.1

- old
+ new

@@ -889,11 +889,11 @@ Layout/LineLength: Description: 'Checks that line length does not exceed the configured limit.' StyleGuide: '#max-line-length' Enabled: true VersionAdded: '0.25' - VersionChanged: '0.84' + VersionChanged: '1.3' AutoCorrect: false Max: 120 # To make it possible to copy or click on URIs in the code, we allow lines # containing a URI to be longer than Max. AllowHeredoc: true @@ -1174,11 +1174,11 @@ - no_space EnforcedStyleForEmptyBraces: space SupportedStylesForEmptyBraces: - space - no_space - VersionChanged: '0.52.1' + VersionChanged: '0.52' Layout/SpaceBeforeComma: Description: 'No spaces before commas.' Enabled: true VersionAdded: '0.49' @@ -1398,10 +1398,15 @@ Lint/ConstantDefinitionInBlock: Description: 'Do not define constants within a block.' StyleGuide: '#no-constant-definition-in-block' Enabled: true VersionAdded: '0.91' + VersionChanged: '1.3' + # `enums` for Typed Enums via T::Enum in Sorbet. + # https://sorbet.org/docs/tenum + AllowedMethods: + - enums Lint/ConstantResolution: Description: 'Check that constants are fully qualified with `::`.' Enabled: false VersionAdded: '0.86' @@ -1413,10 +1418,26 @@ Lint/Debugger: Description: 'Check for debugger calls.' Enabled: true VersionAdded: '0.14' VersionChanged: '0.49' + DebuggerReceivers: + - binding + - Kernel + - Pry + DebuggerMethods: + - debugger + - byebug + - remote_byebug + - pry + - remote_pry + - pry_remote + - console + - rescue + - save_and_open_page + - save_and_open_screenshot + - irb Lint/DeprecatedClassMethods: Description: 'Check for deprecated class method calls.' Enabled: true VersionAdded: '0.19' @@ -1431,10 +1452,15 @@ Enabled: true Safe: false VersionAdded: '0.62' VersionChanged: '0.88' +Lint/DuplicateBranch: + Description: Checks that there are no repeated bodies within `if/unless`, `case-when` and `rescue` constructs. + Enabled: pending + VersionAdded: '1.3' + Lint/DuplicateCaseCondition: Description: 'Do not repeat values in case conditionals.' Enabled: true VersionAdded: '0.45' @@ -1482,12 +1508,20 @@ Lint/EmptyBlock: Description: 'This cop checks for blocks without a body.' Enabled: pending VersionAdded: '1.1' + VersionChanged: '1.3' AllowComments: true + AllowEmptyLambdas: true +Lint/EmptyClass: + Description: 'Checks for classes and metaclasses without a body.' + Enabled: pending + VersionAdded: '1.3' + AllowComments: false + Lint/EmptyConditionalBody: Description: 'This cop checks for the presence of `if`, `elsif` and `unless` branches without a body.' Enabled: true AllowComments: true VersionAdded: '0.89' @@ -1626,11 +1660,12 @@ Use Kernel#loop with break rather than begin/end/until or begin/end/while for post-loop tests. StyleGuide: '#loop-with-break' Enabled: true VersionAdded: '0.9' - VersionChanged: '0.89' + VersionChanged: '1.3' + Safe: false Lint/MissingCopEnableDirective: Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`.' Enabled: true VersionAdded: '0.52' @@ -1828,11 +1863,11 @@ Lint/RescueException: Description: 'Avoid rescuing the Exception class.' StyleGuide: '#no-blind-rescues' Enabled: true VersionAdded: '0.9' - VersionChanged: '0.27.1' + VersionChanged: '0.27' Lint/RescueType: Description: 'Avoid rescuing from non constants that could result in a `TypeError`.' Enabled: true VersionAdded: '0.49' @@ -2414,18 +2449,19 @@ Naming/VariableNumber: Description: 'Use the configured style when numbering symbols, methods and variables.' StyleGuide: '#snake-case-symbols-methods-vars-with-numbers' Enabled: true VersionAdded: '0.50' - VersionChanged: '1.2' + VersionChanged: '1.3' EnforcedStyle: normalcase SupportedStyles: - snake_case - normalcase - non_integer CheckMethodNames: true CheckSymbols: true + AllowedIdentifiers: [] #################### Security ############################## Security/Eval: Description: 'The use of eval represents a serious security risk.' @@ -2803,11 +2839,13 @@ VersionAdded: '0.13' Style/CollectionCompact: Description: 'Use `{Array,Hash}#{compact,compact!}` instead of custom logic to reject nils.' Enabled: pending + Safe: false VersionAdded: '1.2' + VersionChanged: '1.3' # Align with the style guide. Style/CollectionMethods: Description: 'Preferred collection methods.' StyleGuide: '#map-find-select-reduce-include-size' @@ -2868,21 +2906,22 @@ # Checks formatting of special comments Style/CommentAnnotation: Description: >- Checks formatting of special comments - (TODO, FIXME, OPTIMIZE, HACK, REVIEW). + (TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE). StyleGuide: '#annotate-keywords' Enabled: true VersionAdded: '0.10' - VersionChanged: '0.31' + VersionChanged: '1.3' Keywords: - TODO - FIXME - OPTIMIZE - HACK - REVIEW + - NOTE Style/CommentedKeyword: Description: 'Do not place comments on the same line as certain keywords.' Enabled: true VersionAdded: '0.51' @@ -2974,10 +3013,11 @@ When using `class_eval` (or other `eval`) with string interpolation, add a comment block showing its appearance if interpolated. StyleGuide: '#eval-comment-docs' Enabled: pending VersionAdded: '1.1' + VersionChanged: '1.3' Style/Documentation: Description: 'Document classes and non-namespace modules.' Enabled: true VersionAdded: '0.9' @@ -3301,10 +3341,11 @@ Style/IfInsideElse: Description: 'Finds if nodes inside else, which can be converted to elsif.' Enabled: true AllowIfModifier: false VersionAdded: '0.36' + VersionChanged: '1.3' Style/IfUnlessModifier: Description: >- Favor modifier if/unless usage when you have a single-line body. @@ -3333,16 +3374,18 @@ message, rather than just a message. Enabled: false VersionAdded: '0.41' Style/InfiniteLoop: - Description: 'Use Kernel#loop for infinite loops.' + Description: >- + Use Kernel#loop for infinite loops. + This cop is unsafe in the body may raise a `StopIteration` exception. + Safe: false StyleGuide: '#infinite-loop' Enabled: true VersionAdded: '0.26' VersionChanged: '0.61' - SafeAutoCorrect: true Style/InlineComment: Description: 'Avoid trailing inline comments.' Enabled: false VersionAdded: '0.23' @@ -3721,10 +3764,15 @@ EnforcedStyle: predicate SupportedStyles: - predicate - comparison +Style/NilLambda: + Description: 'Prefer `-> {}` to `-> { nil }`.' + Enabled: pending + VersionAdded: '1.3' + Style/NonNilCheck: Description: 'Checks for redundant nil checks.' StyleGuide: '#no-non-nil-checks' Enabled: true VersionAdded: '0.20' @@ -3870,11 +3918,11 @@ '%i': '[]' '%I': '[]' '%r': '{}' '%w': '[]' '%W': '[]' - VersionChanged: '0.48.1' + VersionChanged: '0.48' Style/PercentQLiterals: Description: 'Checks if uses of %Q/%q match the configured preference.' Enabled: true VersionAdded: '0.25' @@ -4220,10 +4268,17 @@ EnforcedStyle: require_parentheses SupportedStyles: - require_parentheses - require_no_parentheses +Style/StaticClass: + Description: 'Prefer modules to classes with only class methods.' + StyleGuide: '#modules-vs-classes' + Enabled: false + Safe: false + VersionAdded: '1.3' + Style/StderrPuts: Description: 'Use `warn` instead of `$stderr.puts`.' StyleGuide: '#warn' Enabled: true VersionAdded: '0.51' @@ -4270,10 +4325,10 @@ Style/StringMethods: Description: 'Checks if configured preferred methods are used over non-preferred.' Enabled: false VersionAdded: '0.34' - VersionChanged: '0.34.2' + VersionChanged: '0.34' # Mapping from undesired method to desired_method # e.g. to use `to_sym` over `intern`: # # StringMethods: # PreferredMethods: