# softened a bit with http://relaxed.ruby.style/rubocop.yml require: - rubocop-rspec inherit_from: .rubocop_todo.yml AllCops: # EnabledByDefault: true TargetRubyVersion: 2.5 # Cop names are not d§splayed in offense messages by default. Change behavior # by overriding DisplayCopNames, or by giving the -D/--display-cop-names # option. DisplayCopNames: true # Style guide URLs are not displayed in offense messages by default. Change # behavior by overriding DisplayStyleGuide, or by giving the # -S/--display-style-guide option. DisplayStyleGuide: false # Gems in consecutive lines should be alphabetically sorted Bundler/OrderedGems: TreatCommentsAsGroupSeparators: true # Layout ###################################################################### Layout/EmptyLinesAroundAttributeAccessor: Enabled: true # Limit lines to 80 characters. Layout/LineLength: Max: 140 # Checks that the closing brace in an array literal is either on the same line # as the last array element, or a new line. Layout/MultilineArrayBraceLayout: Enabled: true EnforcedStyle: symmetrical # Checks that the closing brace in a hash literal is either on the same line as # the last hash element, or a new line. Layout/MultilineHashBraceLayout: Enabled: true EnforcedStyle: symmetrical # Checks that the closing brace in a method call is either on the same line as # the last method argument, or a new line. Layout/MultilineMethodCallBraceLayout: Enabled: true EnforcedStyle: symmetrical # Checks indentation of binary operations that span more than one line. Layout/MultilineOperationIndentation: Enabled: true EnforcedStyle: indented Layout/SpaceAroundMethodCallOperator: Enabled: true # Checks for padding/surrounding spaces inside string interpolation. Layout/SpaceInsideStringInterpolation: EnforcedStyle: no_space Enabled: true # Naming ###################################################################### Naming/MethodParameterName: MinNameLength: 2 # Use the configured style when naming variables. Naming/VariableName: EnforcedStyle: snake_case Enabled: true # Metrics ##################################################################### # A calculated magnitude based on number of assignments, # branches, and conditions. # Metrics/AbcSize: # Enabled: true # Max: 58 # This cop checks if the length of a block exceeds some maximum value. Metrics/BlockLength: Enabled: false # Avoid excessive block nesting. # Metrics/BlockNesting: # Enabled: true # Max: 4 # Avoid classes longer than 100 lines of code. Metrics/ClassLength: Enabled: false # A complexity metric that is strongly correlated to the number # of test cases needed to validate a method. # Metrics/CyclomaticComplexity: # Enabled: true # Max: 11 # Avoid methods longer than 10 lines of code. # Metrics/MethodLength: # Max: 50 # Avoid modules longer than 100 lines of code. Metrics/ModuleLength: Enabled: false # Avoid parameter lists longer than three or four parameters. # Metrics/ParameterLists: # Enabled: true # Max: 8 # A complexity metric geared towards measuring complexity for a human reader. # Metrics/PerceivedComplexity: # Enabled: true # Max: 13 # Lint ######################################################################## Lint/DeprecatedOpenSSLConstant: Enabled: true Lint/DuplicateElsifCondition: Enabled: true Lint/MixedRegexpCaptureTypes: Enabled: true Lint/RaiseException: Enabled: true # This cop looks for use of the same name as outer local variables # for block arguments or block local variables. Lint/ShadowingOuterLocalVariable: Enabled: false Lint/StructNewOverride: Enabled: true # Rails ####################################################################### # Enables Rails cops. Rails: Enabled: false # RSpec ####################################################################### # Checks for long example. RSpec/ExampleLength: Enabled: false Max: 10 # Do not use should when describing your tests. RSpec/ExampleWording: Enabled: false CustomTransform: be: is have: has not: does not IgnoredWords: [] # Checks the file and folder naming of the spec file. RSpec/FilePath: Enabled: true CustomTransform: RuboCop: rubocop RSpec: rspec RSpec/ImplicitExpect: EnforcedStyle: should Enabled: true # incorrect treats shoulda-matchers RSpec/ImplicitSubject: Enabled: false # Checks for `subject` definitions that come after `let` definitions. RSpec/LeadingSubject: Enabled: false # Checks for explicitly referenced test subjects. RSpec/NamedSubject: Enabled: false # Enforces the usage of the same method on all negative message expectations. RSpec/NotToNot: EnforcedStyle: not_to Enabled: true # Style ####################################################################### Style/AccessorGrouping: Enabled: true # Use alias_method instead of alias. Style/Alias: EnforcedStyle: prefer_alias_method Enabled: true Style/ArrayCoercion: Enabled: true Style/AsciiComments: Enabled: false StyleGuide: http://relaxed.ruby.style/#styleasciicomments Style/BisectedAttrAccessor: Enabled: true Style/CaseLikeIf: Enabled: true Style/ExponentialNotation: Enabled: true # Checks if there is a magic comment to enforce string literals Style/FrozenStringLiteralComment: Enabled: false Style/HashAsLastArrayItem: Enabled: true Style/HashEachMethods: Enabled: true Style/HashLikeCase: Enabled: true Style/HashTransformKeys: Enabled: true Style/HashTransformValues: Enabled: true Style/IfUnlessModifier: Enabled: false Style/RedundantAssignment: Enabled: true Style/RedundantFetchBlock: Enabled: true Style/RedundantFileExtensionInRequire: Enabled: true Style/RedundantRegexpCharacterClass: Enabled: true Style/RedundantRegexpEscape: Enabled: true Style/RegexpLiteral: EnforcedStyle: mixed Enabled: false # Checks for proper usage of fail and raise. Style/SignalException: EnforcedStyle: only_raise Enabled: true # Check for the usage of parentheses around stabby lambda arguments. Style/StabbyLambdaParentheses: EnforcedStyle: require_parentheses Enabled: true # Checks if configured preferred methods are used over non-preferred. Style/StringMethods: PreferredMethods: intern: to_sym Enabled: true # Checks for %q/%Q when single quotes or double quotes would do. Style/RedundantPercentQ: Enabled: false Style/SlicingWithRange: Enabled: true