diff --git a/rails/rubocop-for-gem.yml b/rails/rubocop-for-gem.yml index a8543d15b130595de56bc01dd31b8b684b69350a..db625b3a24d2716d36ed18030d86f6949cd8c24e 100644 --- a/rails/rubocop-for-gem.yml +++ b/rails/rubocop-for-gem.yml @@ -82,6 +82,17 @@ Metrics/PerceivedComplexity: # END Metrics +# BEGIN Minitest +# seems kind of buggy, when a custom message is given, this is flagged +Minitest/AssertWithExpectedArgument: + Enabled: false + +# allow more assertions than default, but also not too many +Minitest/MultipleAssertions: + Max: 8 # default: 3 +# END Minitest + + # BEGIN Naming # the default gem module must be named like the gem, so allow dashes Naming/FileName: @@ -89,6 +100,37 @@ Naming/FileName: # END Naming +# BEGIN Rails +# file paths should be built with arguments instead of a single string +Rails/ApplicationController: + Exclude: ['app/controllers/api/**/*', 'app/controllers/a_p_i/**/*'] # exclude API namespace, but not others (convention) + +# exclude migrations since non-ApplicationRecord behavior might be desired +Rails/ApplicationRecord: + Exclude: ['db/migrate/*'] + +# ensure paths are built using a filesystem agnostic way, i.e. arguments instead of a single string +Rails/FilePath: + EnforcedStyle: arguments # default: slashes + +# no reason not to use an established Rails feature if developers see fit +Rails/HasAndBelongsToMany: + Enabled: false + +# prevent puts, but exclude test, config, db since Rails Logger may not have been loaded +Rails/Output: + Exclude: ['test/**/*', 'config/**/*', 'db/**/*'] + +# allow usage of methods that skip validations; we trust developers know what they are doing +Rails/SkipsModelValidations: + Enabled: false + +# allow usage of three-state boolean columns, it may be an STI table +Rails/ThreeStateBooleanColumn: + Enabled: false +# END Rails + + # BEGIN Style # allow compact style for gems that contain app directory for rails integration Style/ClassAndModuleChildren: