Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new rubocop rules #16

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
343 changes: 343 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Gemspec

Gemspec/AddRuntimeDependency:
Enabled: true

Gemspec/DeprecatedAttributeAssignment:
Enabled: true

Gemspec/DevelopmentDependencies:
Enabled: true

Gemspec/RequireMFA:
Enabled: true

# Layout

Layout/LineLength:
Expand All @@ -6,6 +20,18 @@ Layout/LineLength:
Layout/EmptyLineAfterGuardClause:
Enabled: false

Layout/LineContinuationLeadingSpace:
Enabled: true

Layout/LineContinuationSpacing:
Enabled: true

Layout/LineEndStringConcatenationIndentation:
Enabled: true

Layout/SpaceBeforeBrackets:
Enabled: true

# Lint

Lint/DuplicateMethods:
Expand All @@ -14,6 +40,114 @@ Lint/DuplicateMethods:
Lint/MissingSuper:
Enabled: false

Lint/AmbiguousAssignment:
Enabled: true

Lint/AmbiguousOperatorPrecedence:
Enabled: true

Lint/AmbiguousRange:
Enabled: true

Lint/ConstantOverwrittenInRescue:
Enabled: true

Lint/DeprecatedConstants:
Enabled: true

Lint/DuplicateBranch:
Enabled: true

Lint/DuplicateMagicComment:
Enabled: true

Lint/DuplicateMatchPattern:
Enabled: true

Lint/DuplicateRegexpCharacterClassElement:
Enabled: true

Lint/DuplicateSetElement:
Enabled: true

Lint/EmptyBlock:
Enabled: true

Lint/EmptyClass:
Enabled: true

Lint/EmptyInPattern:
Enabled: true

Lint/IncompatibleIoSelectWithFiberScheduler:
Enabled: true

Lint/ItWithoutArgumentsInBlock:
Enabled: true

Lint/LambdaWithoutLiteralBlock:
Enabled: true

Lint/LiteralAssignmentInCondition:
Enabled: true

Lint/MixedCaseRange:
Enabled: true

Lint/NoReturnInBeginEndBlocks:
Enabled: true

Lint/NonAtomicFileOperation:
Enabled: true

Lint/NumberedParameterAssignment:
Enabled: true

Lint/OrAssignmentToConstant:
Enabled: true

Lint/RedundantDirGlobSort:
Enabled: true

Lint/RedundantRegexpQuantifiers:
Enabled: true

Lint/RefinementImportMethods:
Enabled: true

Lint/RequireRangeParentheses:
Enabled: true

Lint/RequireRelativeSelfPath:
Enabled: true

Lint/SymbolConversion:
Enabled: true

Lint/ToEnumArguments:
Enabled: true

Lint/TripleQuotes:
Enabled: true

Lint/UnescapedBracketInRegexp:
Enabled: true

Lint/UnexpectedBlockArity:
Enabled: true

Lint/UnmodifiedReduceAccumulator:
Enabled: true

Lint/UselessNumericOperation:
Enabled: true

Lint/UselessRescue:
Enabled: true

Lint/UselessRuby2Keywords:
Enabled: true

# Metrics

Metrics/AbcSize:
Expand All @@ -40,6 +174,9 @@ Metrics/BlockLength:
Metrics/ModuleLength:
Max: 300

Metrics/CollectionLiteralLength:
Enabled: true

# Naming

Naming/AccessorMethodName:
Expand All @@ -48,10 +185,22 @@ Naming/AccessorMethodName:
Naming/MethodParameterName:
Enabled: false

Naming/BlockForwarding:
Enabled: true

# Security

Security/CompoundHash:
Enabled: true

Security/IoMethods:
Enabled: true

# Style

Style/Documentation:
Enabled: false

Style/FormatString:
Enabled: false

Expand Down Expand Up @@ -91,3 +240,197 @@ Style/TrivialAccessors:
Style/ZeroLengthPredicate:
Enabled: false

Style/AmbiguousEndlessMethodDefinition:
Enabled: true

Style/ArgumentsForwarding:
Enabled: true

Style/ArrayIntersect:
Enabled: true

Style/BitwisePredicate:
Enabled: true

Style/CollectionCompact:
Enabled: true

Style/CombinableDefined:
Enabled: true

Style/ComparableClamp:
Enabled: true

Style/ConcatArrayLiterals:
Enabled: true

Style/DataInheritance:
Enabled: true

Style/DirEmpty:
Enabled: true

Style/DocumentDynamicEvalDefinition:
Enabled: true

Style/EmptyHeredoc:
Enabled: true

Style/EndlessMethod:
Enabled: true

Style/EnvHome:
Enabled: true

Style/ExactRegexpMatch:
Enabled: true

Style/FetchEnvVar:
Enabled: true

Style/FileEmpty:
Enabled: true

Style/FileRead:
Enabled: true

Style/FileWrite:
Enabled: true

Style/HashConversion:
Enabled: true

Style/HashExcept:
Enabled: true

Style/IfWithBooleanLiteralBranches:
Enabled: true

Style/InPatternThen:
Enabled: true

Style/KeywordArgumentsMerging:
Enabled: true

Style/MagicCommentFormat:
Enabled: true

Style/MapCompactWithConditionalBlock:
Enabled: true

Style/MapIntoArray:
Enabled: true

Style/MapToHash:
Enabled: true

Style/MapToSet:
Enabled: true

Style/MinMaxComparison:
Enabled: true

Style/MultilineInPatternThen:
Enabled: true

Style/NegatedIfElseCondition:
Enabled: true

Style/NestedFileDirname:
Enabled: true

Style/NilLambda:
Enabled: true

Style/NumberedParameters:
Enabled: true

Style/NumberedParametersLimit:
Enabled: true

Style/ObjectThen:
Enabled: true

Style/OpenStructUse:
Enabled: true

Style/OperatorMethodCall:
Enabled: true

Style/QuotedSymbols:
Enabled: true

Style/RedundantArgument:
Enabled: true

Style/RedundantArrayConstructor:
Enabled: true

Style/RedundantConstantBase:
Enabled: true

Style/RedundantCurrentDirectoryInPath:
Enabled: true

Style/RedundantDoubleSplatHashBraces:
Enabled: true

Style/RedundantEach:
Enabled: true

Style/RedundantFilterChain:
Enabled: true

Style/RedundantHeredocDelimiterQuotes:
Enabled: true

Style/RedundantInitialize:
Enabled: true

Style/RedundantInterpolationUnfreeze:
Enabled: true

Style/RedundantLineContinuation:
Enabled: true

Style/RedundantRegexpArgument:
Enabled: true

Style/RedundantRegexpConstructor:
Enabled: true

Style/RedundantSelfAssignmentBranch:
Enabled: true

Style/RedundantStringEscape:
Enabled: true

Style/ReturnNilInPredicateMethodDefinition:
Enabled: true

Style/SafeNavigationChainLength:
Enabled: true

Style/SelectByRegexp:
Enabled: true

Style/SendWithLiteralMethodName:
Enabled: true

Style/SingleLineDoEndBlock:
Enabled: true

Style/StringChars:
Enabled: true

Style/SuperArguments:
Enabled: true

Style/SuperWithArgsParentheses:
Enabled: true

Style/SwapValues:
Enabled: true

Style/YAMLFileRead:
Enabled: true
10 changes: 10 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
source 'https://rubygems.org'

gemspec

group :development, :test do
gem 'minitest', '~> 5.25.1'
gem 'minitest-reporters', '~> 1.7.1'
gem 'pry', '~> 0.15.0'
gem 'rake', '~> 13.2.1'
gem 'rspec', '~> 3.13.0'
gem 'rubocop', '~> 1.68.0'
gem 'simplecov', '~> 0.22.0'
end
Loading