require: rubocop-performance AllCops: DisplayCopNames: true TargetRubyVersion: 2.5 Exclude: - terser.gemspec - lib/terser/version.rb - "vendor/**/*" - "benchmark/*" - "gemfiles/vendor/**/*" Metrics/AbcSize: Max: 20 Metrics/BlockLength: Enabled: true Exclude: - "spec/**/*_spec.rb" Metrics/ClassLength: Enabled: false Layout/LineLength: Max: 150 Metrics/MethodLength: Max: 20 Style/Encoding: Enabled: false Style/HashSyntax: EnforcedStyle: hash_rockets Style/PercentLiteralDelimiters: Enabled: false Style/PreferredHashMethods: Enabled: false Style/SignalException: Enabled: false Style/StringLiterals: Enabled: false Style/SymbolArray: Enabled: false Style/Alias: Enabled: false Style/MutableConstant: Enabled: false Style/ExpandPathArguments: Enabled: false Lint/RaiseException: Enabled: true Lint/StructNewOverride: Enabled: true Style/HashEachMethods: Enabled: true Style/HashTransformKeys: Enabled: true Style/HashTransformValues: Enabled: true Layout/BeginEndAlignment: Enabled: true Layout/EmptyLinesAroundAttributeAccessor: Enabled: true Layout/SpaceAroundMethodCallOperator: Enabled: true Lint/BinaryOperatorWithIdenticalOperands: Enabled: true Lint/ConstantDefinitionInBlock: Enabled: true Lint/DeprecatedOpenSSLConstant: Enabled: true Lint/DuplicateElsifCondition: Enabled: true Lint/DuplicateRequire: Enabled: true Lint/DuplicateRescueException: Enabled: true Lint/EmptyConditionalBody: Enabled: true Lint/EmptyFile: Enabled: true Lint/FloatComparison: Enabled: true Lint/HashCompareByIdentity: Enabled: true Lint/IdentityComparison: Enabled: true Lint/MissingSuper: Enabled: true Lint/MixedRegexpCaptureTypes: Enabled: true Lint/OutOfRangeRegexpRef: Enabled: true Lint/RedundantSafeNavigation: Enabled: true Lint/SelfAssignment: Enabled: true Lint/TopLevelReturnWithArgument: Enabled: true Lint/TrailingCommaInAttributeDeclaration: Enabled: true Lint/UnreachableLoop: Enabled: true Lint/UselessMethodDefinition: Enabled: true Lint/UselessTimes: Enabled: true Style/AccessorGrouping: Enabled: true Style/BisectedAttrAccessor: Enabled: true Style/CaseLikeIf: Enabled: true Style/ClassEqualityComparison: Enabled: true Style/CombinableLoops: Enabled: true Style/ExplicitBlockArgument: Enabled: true Style/ExponentialNotation: Enabled: true Style/GlobalStdStream: Enabled: true Style/HashAsLastArrayItem: Enabled: true Style/HashLikeCase: Enabled: true Style/KeywordParametersOrder: Enabled: true Style/OptionalBooleanParameter: Enabled: true Style/RedundantAssignment: Enabled: true Style/RedundantFetchBlock: Enabled: true Style/RedundantFileExtensionInRequire: Enabled: true Style/RedundantRegexpCharacterClass: Enabled: true Style/RedundantRegexpEscape: Enabled: true Style/RedundantSelfAssignment: Enabled: true Style/RedundantBegin: Enabled: false Style/SingleArgumentDig: Enabled: true Style/SlicingWithRange: Enabled: true Style/SoleNestedConditional: Enabled: true Style/StringConcatenation: Enabled: true Lint/DuplicateRegexpCharacterClassElement: Enabled: true Lint/EmptyBlock: Enabled: true Lint/NoReturnInBeginEndBlocks: Enabled: true Lint/ToEnumArguments: Enabled: true Lint/UnmodifiedReduceAccumulator: Enabled: true Style/ArgumentsForwarding: Enabled: true Style/CollectionCompact: Enabled: true Style/DocumentDynamicEvalDefinition: Enabled: true Style/NegatedIfElseCondition: Enabled: true Style/SwapValues: Enabled: true Lint/DuplicateBranch: Enabled: true Lint/EmptyClass: Enabled: true Style/NilLambda: Enabled: true Layout/LineEndStringConcatenationIndentation: # (new in 1.18) Enabled: true Layout/SpaceBeforeBrackets: # (new in 1.7) Enabled: true Lint/AmbiguousAssignment: # (new in 1.7) Enabled: true Lint/DeprecatedConstants: # (new in 1.8) Enabled: true Lint/EmptyInPattern: # (new in 1.16) Enabled: true Lint/LambdaWithoutLiteralBlock: # (new in 1.8) Enabled: true Lint/NumberedParameterAssignment: # (new in 1.9) Enabled: true Lint/OrAssignmentToConstant: # (new in 1.9) Enabled: true Lint/RedundantDirGlobSort: # (new in 1.8) Enabled: true Lint/SymbolConversion: # (new in 1.9) Enabled: true Lint/TripleQuotes: # (new in 1.9) Enabled: true Lint/UnexpectedBlockArity: # (new in 1.5) Enabled: true Naming/InclusiveLanguage: # (new in 1.18) Enabled: true Style/EndlessMethod: # (new in 1.8) Enabled: true Style/HashConversion: # (new in 1.10) Enabled: true Style/HashExcept: # (new in 1.7) Enabled: true Style/IfWithBooleanLiteralBranches: # (new in 1.9) Enabled: true Style/InPatternThen: # (new in 1.16) Enabled: true Style/MultilineInPatternThen: # (new in 1.16) Enabled: true Style/QuotedSymbols: # (new in 1.16) Enabled: true Style/RedundantArgument: # (new in 1.4) Enabled: true Style/StringChars: # (new in 1.12) Enabled: true Gemspec/DeprecatedAttributeAssignment: # new in 1.30 Enabled: true Gemspec/DevelopmentDependencies: # new in 1.44 Enabled: true Gemspec/RequireMFA: # new in 1.23 Enabled: true Layout/LineContinuationLeadingSpace: # new in 1.31 Enabled: true Layout/LineContinuationSpacing: # new in 1.31 Enabled: true Lint/AmbiguousOperatorPrecedence: # new in 1.21 Enabled: true Lint/AmbiguousRange: # new in 1.19 Enabled: true Lint/ConstantOverwrittenInRescue: # new in 1.31 Enabled: true Lint/DuplicateMagicComment: # new in 1.37 Enabled: true Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21 Enabled: true Lint/NonAtomicFileOperation: # new in 1.31 Enabled: true Lint/RefinementImportMethods: # new in 1.27 Enabled: true Lint/RequireRangeParentheses: # new in 1.32 Enabled: true Lint/RequireRelativeSelfPath: # new in 1.22 Enabled: true Lint/UselessRescue: # new in 1.43 Enabled: true Lint/UselessRuby2Keywords: # new in 1.23 Enabled: true Naming/BlockForwarding: # new in 1.24 Enabled: true Security/CompoundHash: # new in 1.28 Enabled: true Security/IoMethods: # new in 1.22 Enabled: true Style/ArrayIntersect: # new in 1.40 Enabled: true Style/ComparableClamp: # new in 1.44 Enabled: true Style/ConcatArrayLiterals: # new in 1.41 Enabled: true Style/EmptyHeredoc: # new in 1.32 Enabled: true Style/EnvHome: # new in 1.29 Enabled: true Style/FetchEnvVar: # new in 1.28 Enabled: true Style/FileRead: # new in 1.24 Enabled: true Style/FileWrite: # new in 1.24 Enabled: true Style/MagicCommentFormat: # new in 1.35 Enabled: true Style/MapCompactWithConditionalBlock: # new in 1.30 Enabled: true Style/MapToHash: # new in 1.24 Enabled: true Style/MapToSet: # new in 1.42 Enabled: true Style/MinMaxComparison: # new in 1.42 Enabled: true Style/NestedFileDirname: # new in 1.26 Enabled: true Style/NumberedParameters: # new in 1.22 Enabled: true Style/NumberedParametersLimit: # new in 1.22 Enabled: true Style/ObjectThen: # new in 1.28 Enabled: true Style/OpenStructUse: # new in 1.23 Enabled: true Style/OperatorMethodCall: # new in 1.37 Enabled: true Style/RedundantConstantBase: # new in 1.40 Enabled: true Style/RedundantDoubleSplatHashBraces: # new in 1.41 Enabled: true Style/RedundantEach: # new in 1.38 Enabled: true Style/RedundantHeredocDelimiterQuotes: # new in 1.45 Enabled: true Style/RedundantInitialize: # new in 1.27 Enabled: true Style/RedundantSelfAssignmentBranch: # new in 1.19 Enabled: true Style/RedundantStringEscape: # new in 1.37 Enabled: true Style/SelectByRegexp: # new in 1.22 Enabled: true Performance/AncestorsInclude: Enabled: true Performance/ArraySemiInfiniteRangeSlice: Enabled: true Performance/BigDecimalWithNumericArgument: Enabled: true Performance/BlockGivenWithExplicitBlock: Enabled: true Performance/CollectionLiteralInLoop: Enabled: true Performance/ConstantRegexp: Enabled: true Performance/MethodObjectAsBlock: Enabled: true Performance/RedundantSortBlock: Enabled: true Performance/RedundantStringChars: Enabled: true Performance/ReverseFirst: Enabled: true Performance/SortReverse: Enabled: true Performance/Squeeze: Enabled: true Performance/StringInclude: Enabled: true Performance/Sum: Enabled: true Performance/MapCompact: # (new in 1.11) Enabled: true Performance/RedundantEqualityComparisonBlock: # (new in 1.10) Enabled: true Performance/RedundantSplitRegexpArgument: # (new in 1.10) Enabled: true Performance/ConcurrentMonotonicTime: # new in 1.12 Enabled: true Performance/StringIdentifierArgument: # new in 1.13 Enabled: true