scinote-web/.rubocop.yml

486 lines
8.3 KiB
YAML
Raw Normal View History

2016-08-23 20:01:08 +08:00
AllCops:
Exclude:
- "vendor/**/*"
- "db/schema.rb"
UseCache: false
2016-10-07 00:36:55 +08:00
TargetRubyVersion: 2.2
2016-08-23 20:01:08 +08:00
##################### Style ####################################
Layout/AccessModifierIndentation:
2016-08-23 20:01:08 +08:00
EnforcedStyle: indent
Layout/AlignHash:
2016-08-23 20:01:08 +08:00
EnforcedHashRocketStyle: key
EnforcedColonStyle: key
EnforcedLastArgumentHashStyle: ignore_implicit
Layout/AlignParameters:
2016-08-23 20:01:08 +08:00
EnforcedStyle: with_first_parameter
Style/AndOr:
EnforcedStyle: conditionals
Style/BarePercentLiterals:
EnforcedStyle: bare_percent
Style/BlockDelimiters:
EnforcedStyle: line_count_based
Style/BracesAroundHashParameters:
EnforcedStyle: no_braces
Layout/CaseIndentation:
EnforcedStyle: case
2016-08-23 20:01:08 +08:00
Style/ClassAndModuleChildren:
EnforcedStyle: nested
Style/ClassCheck:
EnforcedStyle: is_a?
Style/CollectionMethods:
PreferredMethods:
collect: map
collect!: map!
detect: find
find_all: select
reduce: inject
Style/CommandLiteral:
EnforcedStyle: backticks
Style/DocumentationMethod:
RequireForNonPublicMethods: false
Layout/DotPosition:
2016-08-23 20:01:08 +08:00
EnforcedStyle: leading
Style/EmptyElse:
EnforcedStyle: both
Layout/EmptyLineBetweenDefs:
2016-08-23 20:01:08 +08:00
AllowAdjacentOneLineDefs: false
Layout/EmptyLinesAroundBlockBody:
2016-08-23 20:01:08 +08:00
EnforcedStyle: no_empty_lines
Layout/EmptyLinesAroundClassBody:
2016-08-23 20:01:08 +08:00
EnforcedStyle: no_empty_lines
Layout/EmptyLinesAroundModuleBody:
2016-08-23 20:01:08 +08:00
EnforcedStyle: no_empty_lines
Layout/ExtraSpacing:
2016-08-23 20:01:08 +08:00
AllowForAlignment: true
ForceEqualSignAlignment: false
Naming/FileName:
2016-08-23 20:01:08 +08:00
Enabled: false
Exclude: []
Layout/FirstParameterIndentation:
2016-08-23 20:01:08 +08:00
EnforcedStyle: special_for_inner_method_call_in_parentheses
Style/For:
EnforcedStyle: each
Style/FormatString:
EnforcedStyle: format
Style/FrozenStringLiteralComment:
EnforcedStyle: when_needed
Style/GuardClause:
Enabled: false
MinBodyLength: 1
Style/HashSyntax:
EnforcedStyle: ruby19
Style/IfUnlessModifier:
Enabled: true
Metrics/LineLength: 80
2016-08-23 20:01:08 +08:00
Layout/IndentationConsistency:
2016-08-23 20:01:08 +08:00
EnforcedStyle: normal
Layout/IndentationWidth:
2016-08-23 20:01:08 +08:00
Width: 2
Layout/IndentArray:
2016-08-23 20:01:08 +08:00
EnforcedStyle: special_inside_parentheses
Layout/IndentHash:
2016-08-23 20:01:08 +08:00
EnforcedStyle: special_inside_parentheses
Style/Next:
EnforcedStyle: skip_modifier_ifs
Style/NonNilCheck:
IncludeSemanticChanges: false
Style/MethodDefParentheses:
EnforcedStyle: require_parentheses
Naming/MethodName:
2016-08-23 20:01:08 +08:00
EnforcedStyle: snake_case
Style/ModuleFunction:
EnforcedStyle: module_function
Layout/MultilineArrayBraceLayout:
2016-08-23 20:01:08 +08:00
EnforcedStyle: symmetrical
Layout/MultilineAssignmentLayout:
2016-08-23 20:01:08 +08:00
SupportedTypes:
- block
- case
- class
- if
- kwbegin
- module
EnforcedStyle: new_line
Layout/MultilineHashBraceLayout:
2016-08-23 20:01:08 +08:00
EnforcedStyle: symmetrical
Layout/MultilineMethodCallBraceLayout:
2016-08-23 20:01:08 +08:00
EnforcedStyle: symmetrical
Layout/MultilineMethodCallIndentation:
2016-08-23 20:01:08 +08:00
EnforcedStyle: aligned
Layout/MultilineMethodDefinitionBraceLayout:
2016-08-23 20:01:08 +08:00
EnforcedStyle: symmetrical
Layout/MultilineOperationIndentation:
2016-08-23 20:01:08 +08:00
EnforcedStyle: aligned
Style/NumericLiterals:
Enabled: false
Style/NumericLiteralPrefix:
EnforcedOctalStyle: zero_with_o
Style/OptionHash:
SuspiciousParamNames:
- options
- opts
- args
- params
- parameters
Style/ParenthesesAroundCondition:
AllowSafeAssignment: true
Style/PercentLiteralDelimiters:
PreferredDelimiters:
"%": "()"
"%i": "()"
"%q": "()"
"%Q": "()"
"%r": "{}"
"%s": "()"
"%w": "()"
"%W": "()"
"%x": "()"
Style/PercentQLiterals:
EnforcedStyle: lower_case_q
Naming/PredicateName:
2016-08-23 20:01:08 +08:00
Description: Check the names of predicate methods.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark
Enabled: true
NamePrefix:
- is_
- has_
- have_
NamePrefixBlacklist:
- is_
NameWhitelist:
- is_a?
Exclude:
- spec/**/*
Style/RaiseArgs:
Description: Checks the arguments passed to raise/fail.
EnforcedStyle: exploded
SupportedStyles:
- compact
- exploded
Style/RedundantReturn:
AllowMultipleReturnValues: true
Style/RegexpLiteral:
EnforcedStyle: slashes
AllowInnerSlashes: false
Style/Semicolon:
AllowAsExpressionSeparator: true
Style/SignalException:
Enabled: true
EnforcedStyle: only_raise
Style/SingleLineBlockParams:
Enabled: false
Style/SingleLineMethods:
Enabled: false
Layout/SpaceBeforeFirstArg:
2016-08-23 20:01:08 +08:00
AllowForAlignment: true
Style/StringLiterals:
Enabled: true
EnforcedStyle: single_quotes
ConsistentQuotesInMultiline: true
Style/StringLiteralsInInterpolation:
EnforcedStyle: single_quotes
Style/StringMethods:
PreferredMethods:
intern: to_sym
Layout/SpaceAroundBlockParameters:
2016-08-23 20:01:08 +08:00
EnforcedStyleInsidePipes: no_space
Layout/SpaceAroundEqualsInParameterDefault:
2016-08-23 20:01:08 +08:00
EnforcedStyle: space
Layout/SpaceAroundOperators:
2016-08-23 20:01:08 +08:00
AllowForAlignment: true
Layout/SpaceBeforeBlockBraces:
2016-08-23 20:01:08 +08:00
EnforcedStyle: space
Layout/SpaceInsideBlockBraces:
2016-08-23 20:01:08 +08:00
EnforcedStyle: space
EnforcedStyleForEmptyBraces: no_space
SpaceBeforeBlockParameters: true
Layout/SpaceInsideHashLiteralBraces:
2016-08-23 20:01:08 +08:00
EnforcedStyle: space
EnforcedStyleForEmptyBraces: no_space
Layout/SpaceInsideStringInterpolation:
2016-08-23 20:01:08 +08:00
EnforcedStyle: no_space
Style/SymbolArray:
EnforcedStyle: percent
Style/SymbolProc:
IgnoredMethods:
- respond_to
- define_method
Style/TernaryParentheses:
EnforcedStyle: require_no_parentheses
AllowSafeAssignment: true
Layout/TrailingBlankLines:
2016-08-23 20:01:08 +08:00
EnforcedStyle: final_newline
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: no_comma
Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: no_comma
Naming/VariableName:
2016-08-23 20:01:08 +08:00
EnforcedStyle: snake_case
Naming/VariableNumber:
2016-08-23 20:01:08 +08:00
EnforcedStyle: normalcase
Style/WordArray:
EnforcedStyle: percent
MinSize: 0
Style/InlineComment:
Enabled: false
Naming/AccessorMethodName:
2016-08-23 20:01:08 +08:00
Enabled: true
Style/Alias:
Enabled: true
Style/Documentation:
Enabled: false
Style/DoubleNegation:
Enabled: true
Style/EachWithObject:
Enabled: true
Style/EmptyLiteral:
Enabled: true
Style/ModuleFunction:
Enabled: true
Style/OneLineConditional:
Enabled: true
Style/PerlBackrefs:
Enabled: true
Style/Send:
Enabled: true
Style/SpecialGlobalVars:
Enabled: true
Style/VariableInterpolation:
Enabled: true
Style/WhenThen:
Enabled: true
##################### Metrics ##################################
Metrics/AbcSize:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/LineLength:
Max: 80
AllowHeredoc: true
AllowURI: true
URISchemes:
- http
- https
Metrics/MethodLength:
Enabled: false
Metrics/ParameterLists:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
##################### Lint #####################################
Lint/AssignmentInCondition:
AllowSafeAssignment: true
Lint/BlockAlignment:
EnforcedStyleAlignWith: either
2016-08-23 20:01:08 +08:00
Lint/EndAlignment:
EnforcedStyleAlignWith: keyword
2016-08-23 20:01:08 +08:00
Lint/DuplicateMethods:
Enabled: false
Lint/DefEndAlignment:
EnforcedStyleAlignWith: start_of_line
2016-08-23 20:01:08 +08:00
Lint/UnusedBlockArgument:
IgnoreEmptyBlocks: true
AllowUnusedKeywordArguments: false
Lint/UnusedMethodArgument:
AllowUnusedKeywordArguments: false
IgnoreEmptyMethods: true
Lint/EachWithObjectArgument:
Enabled: true
Lint/HandleExceptions:
Enabled: false
Lint/LiteralInCondition:
Enabled: true
Lint/EmptyInterpolation:
Enabled: false
2016-08-23 20:01:08 +08:00
Lint/LiteralInInterpolation:
Enabled: true
##################### Rails ####################################
Rails/ActionFilter:
EnforcedStyle: action
Include:
- app/controllers/**/*.rb
Rails/Date:
EnforcedStyle: flexible
Rails/Exit:
Include:
- app/**/*.rb
- config/**/*.rb
- lib/**/*.rb
Exclude:
- lib/**/*.rake
Rails/FindBy:
Include:
- app/models/**/*.rb
Rails/FindEach:
Include:
- app/models/**/*.rb
Rails/HasAndBelongsToMany:
Include:
- app/models/**/*.rb
Rails/NotNullColumn:
Include:
- db/migrate/*.rb
Rails/Output:
Include:
- app/**/*.rb
- config/**/*.rb
- db/**/*.rb
- lib/**/*.rb
Rails/ReadWriteAttribute:
Include:
- app/models/**/*.rb
Rails/RequestReferer:
EnforcedStyle: referer
Rails/SafeNavigation:
ConvertTry: false
Rails/ScopeArgs:
Include:
- app/models/**/*.rb
Rails/TimeZone:
EnforcedStyle: flexible
Rails/UniqBeforePluck:
EnforcedStyle: conservative
2016-08-23 20:01:08 +08:00
Rails/Validation:
Include:
- app/models/**/*.rb
##################### Performance ##############################
Performance/RedundantMerge:
Enabled: true