mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-11 18:26:50 +00:00
Use relaxed Rubocop styleguide as basis
We then refine it with our own rules.
This commit is contained in:
@@ -10,6 +10,9 @@ inherit_from:
|
|||||||
# The automatically generated todo list to ignore all current violations.
|
# The automatically generated todo list to ignore all current violations.
|
||||||
- .rubocop_todo.yml
|
- .rubocop_todo.yml
|
||||||
|
|
||||||
|
# The relaxed style rules as a common starting point which we can refine.
|
||||||
|
- .rubocop_relaxed_styleguide.yml
|
||||||
|
|
||||||
# Our Open Food Network style guide. If you want to see all violations,
|
# Our Open Food Network style guide. If you want to see all violations,
|
||||||
# then use only that configuration:
|
# then use only that configuration:
|
||||||
#
|
#
|
||||||
|
|||||||
153
.rubocop_relaxed_styleguide.yml
Normal file
153
.rubocop_relaxed_styleguide.yml
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
# Relaxed.Ruby.Style
|
||||||
|
## Version 2.5
|
||||||
|
|
||||||
|
Style/Alias:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylealias
|
||||||
|
|
||||||
|
Style/AsciiComments:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#styleasciicomments
|
||||||
|
|
||||||
|
Style/BeginBlock:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylebeginblock
|
||||||
|
|
||||||
|
Style/BlockDelimiters:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#styleblockdelimiters
|
||||||
|
|
||||||
|
Style/CommentAnnotation:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylecommentannotation
|
||||||
|
|
||||||
|
Style/Documentation:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#styledocumentation
|
||||||
|
|
||||||
|
Layout/DotPosition:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#layoutdotposition
|
||||||
|
|
||||||
|
Style/DoubleNegation:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#styledoublenegation
|
||||||
|
|
||||||
|
Style/EndBlock:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#styleendblock
|
||||||
|
|
||||||
|
Style/FormatString:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#styleformatstring
|
||||||
|
|
||||||
|
Style/IfUnlessModifier:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#styleifunlessmodifier
|
||||||
|
|
||||||
|
Style/Lambda:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylelambda
|
||||||
|
|
||||||
|
Style/ModuleFunction:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylemodulefunction
|
||||||
|
|
||||||
|
Style/MultilineBlockChain:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylemultilineblockchain
|
||||||
|
|
||||||
|
Style/NegatedIf:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylenegatedif
|
||||||
|
|
||||||
|
Style/NegatedWhile:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylenegatedwhile
|
||||||
|
|
||||||
|
Style/NumericPredicate:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylenumericpredicate
|
||||||
|
|
||||||
|
Style/ParallelAssignment:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#styleparallelassignment
|
||||||
|
|
||||||
|
Style/PercentLiteralDelimiters:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylepercentliteraldelimiters
|
||||||
|
|
||||||
|
Style/PerlBackrefs:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#styleperlbackrefs
|
||||||
|
|
||||||
|
Style/Semicolon:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylesemicolon
|
||||||
|
|
||||||
|
Style/SignalException:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylesignalexception
|
||||||
|
|
||||||
|
Style/SingleLineBlockParams:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylesinglelineblockparams
|
||||||
|
|
||||||
|
Style/SingleLineMethods:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylesinglelinemethods
|
||||||
|
|
||||||
|
Layout/SpaceBeforeBlockBraces:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#layoutspacebeforeblockbraces
|
||||||
|
|
||||||
|
Layout/SpaceInsideParens:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#layoutspaceinsideparens
|
||||||
|
|
||||||
|
Style/SpecialGlobalVars:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylespecialglobalvars
|
||||||
|
|
||||||
|
Style/StringLiterals:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylestringliterals
|
||||||
|
|
||||||
|
Style/TrailingCommaInArguments:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarguments
|
||||||
|
|
||||||
|
Style/TrailingCommaInArrayLiteral:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarrayliteral
|
||||||
|
|
||||||
|
Style/TrailingCommaInHashLiteral:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainhashliteral
|
||||||
|
|
||||||
|
Style/SymbolArray:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: http://relaxed.ruby.style/#stylesymbolarray
|
||||||
|
|
||||||
|
Style/WhileUntilModifier:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylewhileuntilmodifier
|
||||||
|
|
||||||
|
Style/WordArray:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#stylewordarray
|
||||||
|
|
||||||
|
Lint/AmbiguousRegexpLiteral:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#lintambiguousregexpliteral
|
||||||
|
|
||||||
|
Lint/AssignmentInCondition:
|
||||||
|
Enabled: false
|
||||||
|
StyleGuide: https://relaxed.ruby.style/#lintassignmentincondition
|
||||||
|
|
||||||
|
Layout/LineLength:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
Metrics:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
@@ -46,6 +46,7 @@ Layout/MultilineMethodCallIndentation:
|
|||||||
EnforcedStyle: indented
|
EnforcedStyle: indented
|
||||||
|
|
||||||
Layout/LineLength:
|
Layout/LineLength:
|
||||||
|
Enabled: true
|
||||||
Max: 100
|
Max: 100
|
||||||
|
|
||||||
Lint/RaiseException:
|
Lint/RaiseException:
|
||||||
@@ -187,9 +188,11 @@ Lint/AssignmentInCondition:
|
|||||||
StyleGuide: http://relaxed.ruby.style/#lintassignmentincondition
|
StyleGuide: http://relaxed.ruby.style/#lintassignmentincondition
|
||||||
|
|
||||||
Metrics/AbcSize:
|
Metrics/AbcSize:
|
||||||
|
Enabled: true
|
||||||
Max: 15
|
Max: 15
|
||||||
|
|
||||||
Metrics/BlockLength:
|
Metrics/BlockLength:
|
||||||
|
Enabled: true
|
||||||
Max: 25
|
Max: 25
|
||||||
IgnoredMethods: [
|
IgnoredMethods: [
|
||||||
"class_eval",
|
"class_eval",
|
||||||
@@ -207,24 +210,31 @@ Metrics/BlockLength:
|
|||||||
]
|
]
|
||||||
|
|
||||||
Metrics/BlockNesting:
|
Metrics/BlockNesting:
|
||||||
|
Enabled: true
|
||||||
Max: 3
|
Max: 3
|
||||||
|
|
||||||
Metrics/ClassLength:
|
Metrics/ClassLength:
|
||||||
|
Enabled: true
|
||||||
Max: 100
|
Max: 100
|
||||||
|
|
||||||
Metrics/ModuleLength:
|
Metrics/ModuleLength:
|
||||||
|
Enabled: true
|
||||||
Max: 100
|
Max: 100
|
||||||
|
|
||||||
Metrics/CyclomaticComplexity:
|
Metrics/CyclomaticComplexity:
|
||||||
|
Enabled: true
|
||||||
Max: 6
|
Max: 6
|
||||||
|
|
||||||
Metrics/MethodLength:
|
Metrics/MethodLength:
|
||||||
|
Enabled: true
|
||||||
Max: 10
|
Max: 10
|
||||||
|
|
||||||
Metrics/ParameterLists:
|
Metrics/ParameterLists:
|
||||||
|
Enabled: true
|
||||||
Max: 5
|
Max: 5
|
||||||
|
|
||||||
Metrics/PerceivedComplexity:
|
Metrics/PerceivedComplexity:
|
||||||
|
Enabled: true
|
||||||
Max: 7
|
Max: 7
|
||||||
|
|
||||||
Naming/PredicateName:
|
Naming/PredicateName:
|
||||||
|
|||||||
Reference in New Issue
Block a user