Permalink
Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
190 lines (150 sloc) 4.26 KB
AllCops:
Exclude:
- 'bin/**/*'
- 'config/**/*'
- 'tmp/**/*'
- 'publify_core/bin/*'
- 'publify_core/spec/dummy/**/*'
- 'publify_amazon_sidebar/bin/*'
- 'publify_amazon_sidebar/spec/dummy/**/*'
- 'publify_textfilter_code/bin/*'
- 'publify_textfilter_code/spec/dummy/**/*'
- 'db/converters/*.rb'
- 'db/scripts/fix_permalinks.rb'
- 'db/schema.rb'
TargetRubyVersion: '2.2'
Rails:
Enabled: true
# We have duplication due to extra logic in the Gemfile
Bundler/DuplicatedGem:
Enabled: false
# Place . on the previous line
Layout/DotPosition:
EnforcedStyle: trailing
Layout/MultilineMethodCallBraceLayout:
EnforcedStyle: same_line
# Multi-line operations should be simply indented. Aligning them makes it even
# harder to keep a sane line length.
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
# Multi-line operations should be simply indented. Aligning them makes it even
# harder to keep a sane line length.
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
# Uniform block layout
Layout/SpaceBeforeBlockBraces:
EnforcedStyleForEmptyBraces: space
# Assume the programmer knows how bracketed block syntax works
Lint/AmbiguousBlockAssociation:
Enabled: false
# Allow if (foo = get_foo) style
Lint/AssignmentInCondition:
AllowSafeAssignment: true
# TODO: Lower Max and fix offenses
Metrics/AbcSize:
Max: 155
# Suppress BlockLength for some files:
# - Spec describe blocks can be any length
# - Routes blocks can be any length
# - Gem specification blocks can be any length
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
- '**/*.gemspec'
- 'publify_core/config/routes.rb'
- 'publify_core/spec/**/*'
- 'publify_amazon_sidebar/spec/**/*'
- 'publify_textfilter_code/spec/**/*'
# TODO: Lower Max and fix offenses
Metrics/ClassLength:
Max: 225
# TODO: Lower Max and fix offenses
Metrics/CyclomaticComplexity:
Max: 17
# TODO: Lower Max and fix offenses
Metrics/LineLength:
Max: 274
# Initial schema has a very large change method
# TODO: Lower Max and fix offenses
Metrics/MethodLength:
Exclude:
- 'publify_core/db/migrate/113_initial_schema.rb'
- 'db/migrate/113_initial_schema.publify_core_engine.rb'
Max: 45
# TODO: Lower Max and fix offenses
Metrics/ModuleLength:
Max: 211
# Offense count: 1
# Configuration parameters: CountKeywordArgs.
Metrics/ParameterLists:
Max: 6
# Offense count: 8
Metrics/PerceivedComplexity:
Max: 17
# Do not require long paths to be split by comma's.
Rails/FilePath:
Enabled: false
# Documenting all classes is not common in Rails projects.
Style/Documentation:
Enabled: false
# TODO: Lower Max and fix offenses
# Target is around 100
Metrics/LineLength:
Max: 274
# Migrations should not use ApplicationRecord
Rails/ApplicationRecord:
Exclude:
- 'db/migrate/*'
- 'publify_core/db/migrate/*'
# TODO: Re-enable once advice is more targeted
Rails/BulkChangeTable:
Enabled: false
# Migrations should not do validations in general?
Rails/SkipsModelValidations:
Exclude:
- 'db/migrate/*'
- 'publify_core/db/migrate/*'
# Allow the use of 'and' 'or' in control structures.
Style/AndOr:
EnforcedStyle: conditionals
# Allow multiple Hash parameters to look similar
Style/BracesAroundHashParameters:
EnforcedStyle: context_dependent
Style/ClassAndModuleChildren:
Enabled: false
Style/CollectionMethods:
Enabled: true
# This cop doesn't detect use of break yet
Style/EachWithObject:
Enabled: false
# Allows format strings with: format, sprintf or percent.
Style/FormatString:
Enabled: false
# This cop has too many false positives
# TODO: Re-enable once fixed
Style/FormatStringToken:
Enabled: false
# TODO: Re-enable?
Style/NumericPredicate:
Enabled: false
# Not all objects that implement #size implement #empty?
Style/ZeroLengthPredicate:
Enabled: false
# Restore previous RuboCop defaults
Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%W': ()
'%w': ()
# Always use raise to raise exceptions
Style/SignalException:
EnforcedStyle: only_raise
# Allow meaningful names for single-line reduce etc.
Style/SingleLineBlockParams:
Enabled: false
# Prefer symbols to look like symbols
Style/SymbolArray:
EnforcedStyle: brackets
# Allow small arrays of words with quotes
Style/WordArray:
MinSize: 4
inherit_from: .rubocop_todo.yml