diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54d5a3c..89f9c70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,14 +13,14 @@ jobs: strategy: matrix: include: - - os: ubuntu-latest - ruby: "3.0" - os: ubuntu-latest ruby: "3.1" - os: ubuntu-latest ruby: "3.2" - os: ubuntu-latest ruby: "3.3" + - os: ubuntu-latest + ruby: "3.4" fail-fast: false runs-on: ${{ matrix.os }} steps: diff --git a/google-style.gemspec b/google-style.gemspec index 0daf5e4..495d589 100644 --- a/google-style.gemspec +++ b/google-style.gemspec @@ -31,7 +31,7 @@ Gem::Specification.new do |gem| "README.md", "google-style.yml", "lib/google/style/version.rb"] - gem.required_ruby_version = ">= 3.0.0" + gem.required_ruby_version = ">= 3.1.0" - gem.add_dependency "rubocop", "~> 1.63" + gem.add_dependency "rubocop", "~> 1.75" end diff --git a/google-style.yml b/google-style.yml index 297125f..b438ae3 100644 --- a/google-style.yml +++ b/google-style.yml @@ -15,7 +15,10 @@ AllCops: NewCops: disable SuggestExtensions: false - TargetRubyVersion: 3.0 + TargetRubyVersion: 3.1 + +Gemspec/AddRuntimeDependency: # new in 1.65 + Enabled: true # Added in Rubocop 1.30 Gemspec/DeprecatedAttributeAssignment: @@ -62,6 +65,9 @@ Layout/LineLength: Layout/SpaceBeforeBrackets: Enabled: true +Lint/ArrayLiteralInRegexp: # new in 1.71 + Enabled: true + # Added in Rubocop 1.7 Lint/AmbiguousAssignment: Enabled: true @@ -78,6 +84,12 @@ Lint/AmbiguousRange: Lint/ConstantOverwrittenInRescue: Enabled: true +Lint/ConstantReassignment: # new in 1.70 + Enabled: true + +Lint/CopDirectiveSyntax: # new in 1.72 + Enabled: true + # Samples often use Kernel#p which Lint/Debugger doesn't like. Lint/Debugger: Exclude: @@ -104,6 +116,9 @@ Lint/DuplicateMatchPattern: Lint/DuplicateRegexpCharacterClassElement: Enabled: true +Lint/DuplicateSetElement: # new in 1.67 + Enabled: true + # Added in Rubocop 1.1 Lint/EmptyBlock: Enabled: true @@ -116,6 +131,9 @@ Lint/EmptyClass: Lint/EmptyInPattern: Enabled: true +Lint/HashNewWithKeywordArgumentsAsDefault: # new in 1.69 + Enabled: true + # Added in Rubocop 1.21 Lint/IncompatibleIoSelectWithFiberScheduler: Enabled: true @@ -148,6 +166,10 @@ Lint/NonAtomicFileOperation: Lint/NumberedParameterAssignment: Enabled: true +# Can easily appear in the generated code +Lint/NumericOperationWithConstantResult: # new in 1.69 + Enabled: false + # Added in Rubocop 1.9 Lint/OrAssignmentToConstant: Enabled: true @@ -160,6 +182,10 @@ Lint/RedundantDirGlobSort: Lint/RedundantRegexpQuantifiers: Enabled: true +# Can easily appear in the generated code +Lint/RedundantTypeConversion: # new in 1.72 + Enabled: false + # Added in Rubocop 1.27 Lint/RefinementImportMethods: Enabled: true @@ -176,6 +202,12 @@ Lint/RequireRelativeSelfPath: Lint/SafeNavigationConsistency: Enabled: false +Lint/SharedMutableDefault: # new in 1.70 + Enabled: true + +Lint/SuppressedExceptionInNumberConversion: # new in 1.72 + Enabled: true + # Added in Rubocop 1.9 Lint/SymbolConversion: Enabled: true @@ -192,10 +224,23 @@ Lint/TripleQuotes: Lint/UnexpectedBlockArity: Enabled: true +Lint/UnescapedBracketInRegexp: # new in 1.68 + Enabled: true + # Added in Rubocop 1.1 Lint/UnmodifiedReduceAccumulator: Enabled: true +Lint/UselessConstantScoping: # new in 1.72 + Enabled: true + +Lint/UselessDefined: # new in 1.69 + Enabled: true + +# Can easily appear in the generated code +Lint/UselessNumericOperation: # new in 1.66 + Enabled: false + # Added in Rubocop 1.43 Lint/UselessRescue: Enabled: true @@ -251,6 +296,9 @@ Security/IoMethods: Style/AccessorGrouping: EnforcedStyle: separated +Style/AmbiguousEndlessMethodDefinition: # new in 1.68 + Enabled: true + # Added in Rubocop 1.1 Style/ArgumentsForwarding: Enabled: true @@ -259,6 +307,9 @@ Style/ArgumentsForwarding: RedundantRestArgumentNames: [] # To support Ruby < 3.2 UseAnonymousForwarding: false # To support Ruby < 3.2 +Style/ArrayIntersect: # new in 1.40 + Enabled: true + # Problematic for generated code which might include unicode in comments. Style/AsciiComments: Enabled: false @@ -272,6 +323,9 @@ Style/CaseEquality: Style/CollectionCompact: Enabled: true +Style/CombinableDefined: # new in 1.68 + Enabled: true + # Added in Rubocop 1.44 Style/ComparableClamp: Enabled: true @@ -280,6 +334,9 @@ Style/ComparableClamp: Style/ConcatArrayLiterals: Enabled: true +Style/DigChain: # new in 1.69 + Enabled: true + # Added in Rubocop 1.48 Style/DirEmpty: Enabled: true @@ -336,6 +393,9 @@ Style/HashConversion: Style/HashExcept: Enabled: true +Style/HashFetchChain: # new in 1.75 + Enabled: true + # It is sometimes preferable to use the non-modifier form even for single-line # expressions, for readability. Style/IfUnlessModifier: @@ -349,6 +409,12 @@ Style/IfWithBooleanLiteralBranches: Style/InPatternThen: Enabled: true +Style/ItAssignment: # new in 1.70 + Enabled: true + +Style/ItBlockParameter: # new in 1.75 + Enabled: true + # Added in Rubocop 1.35 Style/MagicCommentFormat: Enabled: true @@ -516,6 +582,10 @@ Style/RescueModifier: Style/ReturnNilInPredicateMethodDefinition: Enabled: true +# Disabled since length of navigation chain is not a problem. +Style/SafeNavigationChainLength: # new in 1.68 + Enabled: false + # We disagree with this one. Grep is more specialized than select/reject. Style/SelectByRegexp: Enabled: false