2015-05-04 14:59:38 +00:00
|
|
|
# Default enabled cops
|
|
|
|
# https://github.com/bbatsov/rubocop/blob/master/config/enabled.yml
|
|
|
|
|
|
|
|
# TODO:
|
|
|
|
# https://github.com/bbatsov/rubocop#includingexcluding-files
|
|
|
|
|
2015-04-27 13:34:28 +00:00
|
|
|
AllCops:
|
|
|
|
RunRailsCops: true
|
2015-05-04 14:09:43 +00:00
|
|
|
Exclude:
|
|
|
|
- 'bin/rails'
|
|
|
|
- 'bin/rake'
|
|
|
|
- 'bin/spring'
|
|
|
|
- 'db/schema.rb'
|
2015-04-27 13:34:28 +00:00
|
|
|
|
2015-05-05 10:56:03 +00:00
|
|
|
# Zammad StyleGuide
|
|
|
|
|
2015-04-27 19:24:14 +00:00
|
|
|
Metrics/LineLength:
|
|
|
|
Description: 'Limit lines to 80 characters.'
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
|
|
|
|
Enabled: false
|
|
|
|
|
2015-04-27 13:34:28 +00:00
|
|
|
Style/NegatedIf:
|
|
|
|
Description: >-
|
|
|
|
Favor unless over if for negative conditions
|
|
|
|
(or control flow or).
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/IfUnlessModifier:
|
|
|
|
Description: >-
|
|
|
|
Favor modifier if/unless usage when you have a
|
|
|
|
single-line body.
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/TrailingComma:
|
|
|
|
Description: 'Checks for trailing comma in parameter lists and literals.'
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/SpaceInsideParens:
|
|
|
|
Description: 'No spaces after ( or before ).'
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/SpaceAfterMethodName:
|
|
|
|
Description: >-
|
|
|
|
Do not put a space between a method name and the opening
|
|
|
|
parenthesis in a method definition.
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/SingleSpaceBeforeFirstArg:
|
|
|
|
Description: >-
|
|
|
|
Checks that exactly one space is used between a method name
|
|
|
|
and the first argument for method calls without parentheses.
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/LeadingCommentSpace:
|
|
|
|
Description: 'Comments should start with a space.'
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/MethodCallParentheses:
|
|
|
|
Description: 'Do not use parentheses for method calls with no arguments.'
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/SpaceInsideBrackets:
|
|
|
|
Description: 'No spaces after [ or before ].'
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/DefWithParentheses:
|
|
|
|
Description: 'Use def with parentheses when there are arguments.'
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
|
|
|
|
Enabled: false
|
|
|
|
Style/MethodDefParentheses:
|
|
|
|
Description: >-
|
|
|
|
Checks if the method definitions have or don't have
|
|
|
|
parentheses.
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/EmptyLinesAroundClassBody:
|
|
|
|
Description: "Keeps track of empty lines around class bodies."
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/EmptyLinesAroundMethodBody:
|
|
|
|
Description: "Keeps track of empty lines around method bodies."
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/EmptyLinesAroundBlockBody:
|
|
|
|
Description: "Keeps track of empty lines around block bodies."
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/EmptyLinesAroundModuleBody:
|
|
|
|
Description: "Keeps track of empty lines around module bodies."
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/BlockDelimiters:
|
|
|
|
Description: >-
|
|
|
|
Avoid using {...} for multi-line blocks (multiline chaining is
|
|
|
|
always ugly).
|
|
|
|
Prefer {...} over do...end for single-line blocks.
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/MultilineBlockChain:
|
|
|
|
Description: 'Avoid multi-line chains of blocks.'
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Metrics/ClassLength:
|
|
|
|
Description: 'Avoid classes longer than 100 lines of code.'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Metrics/MethodLength:
|
|
|
|
Description: 'Avoid methods longer than 10 lines of code.'
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/BlockComments:
|
|
|
|
Description: 'Do not use block comments.'
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/PerlBackrefs:
|
|
|
|
Description: 'Avoid Perl-style regex back references.'
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/SelfAssignment:
|
|
|
|
Description: >-
|
|
|
|
Checks for places where self-assignment shorthand should have
|
|
|
|
been used.
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/BracesAroundHashParameters:
|
|
|
|
Description: 'Enforce braces style around hash parameters.'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Rails/FindEach:
|
|
|
|
Description: 'Prefer all.find_each over all.find.'
|
|
|
|
Enabled: false
|
|
|
|
|
2015-05-05 10:56:03 +00:00
|
|
|
Rails/HasAndBelongsToMany:
|
2015-05-05 10:56:26 +00:00
|
|
|
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
|
2015-05-05 10:57:54 +00:00
|
|
|
# StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has-many-through'
|
2015-05-05 10:56:03 +00:00
|
|
|
Enabled: false
|
|
|
|
|
2015-05-07 11:32:40 +00:00
|
|
|
Style/ClassAndModuleChildren:
|
|
|
|
Description: 'Checks style of children classes and modules.'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
# 2.0
|
|
|
|
|
2015-05-06 09:23:51 +00:00
|
|
|
Metrics/PerceivedComplexity:
|
|
|
|
Description: >-
|
|
|
|
A complexity metric geared towards measuring complexity for a
|
|
|
|
human reader.
|
|
|
|
Enabled: false
|
2015-04-27 13:34:28 +00:00
|
|
|
|
2015-05-07 11:32:40 +00:00
|
|
|
Metrics/AbcSize:
|
|
|
|
Description: >-
|
|
|
|
A calculated magnitude based on number of assignments,
|
|
|
|
branches, and conditions.
|
2015-05-06 13:00:11 +00:00
|
|
|
Enabled: false
|
|
|
|
|
2015-05-07 11:36:09 +00:00
|
|
|
Metrics/CyclomaticComplexity:
|
|
|
|
Description: >-
|
|
|
|
A complexity metric that is strongly correlated to the number
|
|
|
|
of test cases needed to validate a method.
|
2015-05-07 11:46:49 +00:00
|
|
|
Enabled: false
|
2015-05-07 11:36:09 +00:00
|
|
|
|
2015-05-07 12:39:19 +00:00
|
|
|
Metrics/BlockNesting:
|
|
|
|
Description: 'Avoid excessive block nesting'
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
|
|
|
|
Enabled: false
|
|
|
|
|
2015-05-04 14:59:38 +00:00
|
|
|
# TODO
|
2015-04-27 13:34:28 +00:00
|
|
|
|
|
|
|
Style/Documentation:
|
|
|
|
Description: 'Document classes and non-namespace modules.'
|
|
|
|
Enabled: false
|
|
|
|
|
2015-05-04 14:59:38 +00:00
|
|
|
Lint/RescueException:
|
|
|
|
Enabled: false
|
|
|
|
Lint/UselessAssignment:
|
|
|
|
Enabled: false
|