chore(rubocop): enable most of new rails cops

This commit is contained in:
Colin Darie 2023-04-19 10:46:36 +02:00
parent ca11ec8380
commit 923923f67d
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4

View file

@ -14,6 +14,7 @@ AllCops:
TargetRubyVersion: 3.1 TargetRubyVersion: 3.1
DisabledByDefault: true DisabledByDefault: true
SuggestExtensions: false SuggestExtensions: false
NewCops: enable
Include: Include:
- "app/**/*.prawn" - "app/**/*.prawn"
Exclude: Exclude:
@ -683,9 +684,18 @@ Performance/UriDefaultParser:
Rails: Rails:
Enabled: true Enabled: true
Rails/ActionControllerFlashBeforeRender:
Enabled: true
Rails/ActionControllerTestCase:
Enabled: true
Rails/ActionFilter: Rails/ActionFilter:
Enabled: true Enabled: true
Rails/ActionOrder:
Enabled: false
Rails/ActiveRecordAliases: Rails/ActiveRecordAliases:
Enabled: true Enabled: true
@ -695,18 +705,24 @@ Rails/ActiveRecordCallbacksOrder:
Rails/ActiveSupportAliases: Rails/ActiveSupportAliases:
Enabled: true Enabled: true
Rails/ActiveSupportOnLoad:
Enabled: true
Rails/AddColumnIndex:
Enabled: true
Rails/AfterCommitOverride: Rails/AfterCommitOverride:
Enabled: true Enabled: true
Rails/ApplicationController:
Enabled: false
Rails/ApplicationJob: Rails/ApplicationJob:
Enabled: true Enabled: true
Rails/ApplicationRecord: Rails/ApplicationRecord:
Enabled: true Enabled: true
Rails/ApplicationController:
Enabled: false
Rails/AttributeDefaultBlockValue: Rails/AttributeDefaultBlockValue:
Enabled: true Enabled: true
@ -716,6 +732,9 @@ Rails/Blank:
Rails/BulkChangeTable: Rails/BulkChangeTable:
Enabled: false Enabled: false
Rails/CompactBlank:
Enabled: true
Rails/CreateTableWithTimestamps: Rails/CreateTableWithTimestamps:
Enabled: true Enabled: true
Exclude: Exclude:
@ -734,10 +753,28 @@ Rails/Delegate:
Rails/DelegateAllowBlank: Rails/DelegateAllowBlank:
Enabled: true Enabled: true
Rails/DeprecatedActiveModelErrorsMethods:
Enabled: false # re-enable in rails 7
Rails/DotSeparatedKeys:
Enabled: true
Rails/DuplicateAssociation:
Enabled: true
Rails/DuplicateScope:
Enabled: true
Rails/DurationArithmetic:
Enabled: true
Rails/DynamicFindBy: Rails/DynamicFindBy:
Enabled: true Enabled: true
Exclude: Exclude:
- "spec/system/**/*.rb" - spec/system/**/*.rb
Rails/EagerEvaluationLogMessage:
Enabled: true
Rails/EnumUniqueness: Rails/EnumUniqueness:
Enabled: true Enabled: true
@ -748,6 +785,9 @@ Rails/EnvironmentComparison:
Rails/Exit: Rails/Exit:
Enabled: true Enabled: true
Rails/ExpandedDateRange:
Enabled: true
Rails/FilePath: Rails/FilePath:
Enabled: false Enabled: false
@ -760,6 +800,9 @@ Rails/FindById:
Rails/FindEach: Rails/FindEach:
Enabled: true Enabled: true
Rails/FreezeTime:
Enabled: true
Rails/HasAndBelongsToMany: Rails/HasAndBelongsToMany:
Enabled: false Enabled: false
@ -772,6 +815,18 @@ Rails/HttpPositionalArguments:
Rails/HttpStatus: Rails/HttpStatus:
Enabled: false Enabled: false
Rails/I18nLazyLookup:
Enabled: true
Rails/I18nLocaleAssignment:
Enabled: true
Rails/I18nLocaleTexts:
Enabled: false
Rails/IgnoredColumnsAssignment:
Enabled: true
Rails/Inquiry: Rails/Inquiry:
Enabled: true Enabled: true
@ -787,6 +842,9 @@ Rails/MailerName:
Rails/MatchRoute: Rails/MatchRoute:
Enabled: true Enabled: true
Rails/MigrationClassName:
Enabled: true
Rails/NegateInclude: Rails/NegateInclude:
Enabled: false Enabled: false
@ -823,9 +881,15 @@ Rails/ReadWriteAttribute:
Rails/RedundantAllowNil: Rails/RedundantAllowNil:
Enabled: false Enabled: false
Rails/RedundantPresenceValidationOnBelongsTo:
Enabled: true
Rails/RedundantReceiverInWithOptions: Rails/RedundantReceiverInWithOptions:
Enabled: true Enabled: true
Rails/RedundantTravelBack:
Enabled: true
Rails/RelativeDateConstant: Rails/RelativeDateConstant:
Enabled: true Enabled: true
@ -838,9 +902,21 @@ Rails/RenderPlainText:
Rails/RequestReferer: Rails/RequestReferer:
Enabled: true Enabled: true
Rails/ResponseParsedBody:
Enabled: true
Rails/ReversibleMigration: Rails/ReversibleMigration:
Enabled: false Enabled: false
Rails/RootJoinChain:
Enabled: true
Rails/RootPathnameMethods:
Enabled: true
Rails/RootPublicPath:
Enabled: true
Rails/SaveBang: Rails/SaveBang:
Enabled: false Enabled: false
@ -856,9 +932,30 @@ Rails/SkipsModelValidations:
Rails/SquishedSQLHeredocs: Rails/SquishedSQLHeredocs:
Enabled: true Enabled: true
Rails/StripHeredoc:
Enabled: true
Rails/ThreeStateBooleanColumn:
Enabled: true
Rails/TimeZone: Rails/TimeZone:
EnforcedStyle: strict EnforcedStyle: strict
Rails/TimeZoneAssignment:
Enabled: true
Rails/ToFormattedS:
Enabled: true
Rails/ToSWithArgument:
Enabled: true
Rails/TopLevelHashWithIndifferentAccess:
Enabled: true
Rails/TransactionExitStatement:
Enabled: true
Rails/UniqBeforePluck: Rails/UniqBeforePluck:
Enabled: true Enabled: true
@ -868,6 +965,9 @@ Rails/UniqueValidationWithoutIndex:
Rails/UnknownEnv: Rails/UnknownEnv:
Enabled: false Enabled: false
Rails/UnusedIgnoredColumns:
Enabled: true
Rails/Validation: Rails/Validation:
Enabled: true Enabled: true
@ -877,9 +977,15 @@ Rails/WhereEquals:
Rails/WhereExists: Rails/WhereExists:
Enabled: true Enabled: true
Rails/WhereMissing:
Enabled: true
Rails/WhereNot: Rails/WhereNot:
Enabled: true Enabled: true
Rails/WhereNotWithMultipleConditions:
Enabled: true
RSpec/Focus: RSpec/Focus:
Enabled: true Enabled: true