2015-05-04 14:59:38 +00:00
|
|
|
# Default enabled cops
|
2018-10-09 06:17:41 +00:00
|
|
|
# https://github.com/rubocop-hq/rubocop/blob/master/config/default.yml
|
2015-05-04 14:59:38 +00:00
|
|
|
|
2019-04-07 12:27:45 +00:00
|
|
|
require: rubocop-performance
|
|
|
|
|
2018-04-12 14:57:37 +00:00
|
|
|
inherit_from: .rubocop_todo.yml
|
|
|
|
|
2015-04-27 13:34:28 +00:00
|
|
|
AllCops:
|
2018-04-12 14:57:37 +00:00
|
|
|
DisplayCopNames: true
|
2015-05-04 14:09:43 +00:00
|
|
|
Exclude:
|
|
|
|
- 'bin/rails'
|
|
|
|
- 'bin/rake'
|
|
|
|
- 'bin/spring'
|
|
|
|
- 'db/schema.rb'
|
2019-01-01 16:54:13 +00:00
|
|
|
- 'vendor/**/*'
|
2015-04-27 13:34:28 +00:00
|
|
|
|
2016-01-15 17:22:57 +00:00
|
|
|
Rails:
|
|
|
|
Enabled: true
|
|
|
|
|
2015-05-05 10:56:03 +00:00
|
|
|
# Zammad StyleGuide
|
|
|
|
|
2016-10-24 21:57:25 +00:00
|
|
|
Style/FrozenStringLiteralComment:
|
|
|
|
Enabled: false
|
|
|
|
|
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
|
|
|
|
|
2018-04-12 14:57:37 +00:00
|
|
|
Style/TrailingCommaInArrayLiteral:
|
|
|
|
Description: 'Checks for trailing comma in array literals.'
|
|
|
|
StyleGuide: '#no-trailing-array-commas'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/TrailingCommaInHashLiteral:
|
|
|
|
Description: 'Checks for trailing comma in hash literals.'
|
2016-01-15 17:22:57 +00:00
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Style/TrailingCommaInArguments:
|
|
|
|
Description: 'Checks for trailing comma in argument lists.'
|
2015-04-27 13:34:28 +00:00
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
|
|
|
Enabled: false
|
|
|
|
|
2017-11-23 08:09:44 +00:00
|
|
|
Layout/SpaceInsideParens:
|
2015-04-27 13:34:28 +00:00
|
|
|
Description: 'No spaces after ( or before ).'
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
|
|
|
|
Enabled: false
|
|
|
|
|
2017-11-23 08:09:44 +00:00
|
|
|
Layout/SpaceAfterMethodName:
|
2015-04-27 13:34:28 +00:00
|
|
|
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
|
|
|
|
|
2017-11-23 08:09:44 +00:00
|
|
|
Layout/LeadingCommentSpace:
|
2015-04-27 13:34:28 +00:00
|
|
|
Description: 'Comments should start with a space.'
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
|
|
|
|
Enabled: false
|
|
|
|
|
2017-11-23 08:09:44 +00:00
|
|
|
Style/MethodCallWithoutArgsParentheses:
|
2015-04-27 13:34:28 +00:00
|
|
|
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
|
|
|
|
|
2018-04-12 14:57:37 +00:00
|
|
|
Layout/SpaceInsideReferenceBrackets:
|
|
|
|
Description: 'Checks the spacing inside referential brackets.'
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
Layout/SpaceInsideArrayLiteralBrackets:
|
|
|
|
Description: 'Checks the spacing inside array literal brackets.'
|
2015-04-27 13:34:28 +00:00
|
|
|
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
|
|
|
|
|
2018-12-19 17:31:51 +00:00
|
|
|
Layout/AlignHash:
|
|
|
|
Description: >-
|
|
|
|
Align the elements of a hash literal if they span more than
|
|
|
|
one line.
|
|
|
|
Enabled: true
|
|
|
|
EnforcedHashRocketStyle: table
|
|
|
|
EnforcedColonStyle: table
|
|
|
|
EnforcedLastArgumentHashStyle: always_inspect
|
|
|
|
|
2017-11-23 08:09:44 +00:00
|
|
|
Layout/EmptyLinesAroundClassBody:
|
2015-04-27 13:34:28 +00:00
|
|
|
Description: "Keeps track of empty lines around class bodies."
|
|
|
|
Enabled: false
|
|
|
|
|
2017-11-23 08:09:44 +00:00
|
|
|
Layout/EmptyLinesAroundMethodBody:
|
2015-04-27 13:34:28 +00:00
|
|
|
Description: "Keeps track of empty lines around method bodies."
|
|
|
|
Enabled: false
|
|
|
|
|
2017-11-23 08:09:44 +00:00
|
|
|
Layout/EmptyLinesAroundBlockBody:
|
2015-04-27 13:34:28 +00:00
|
|
|
Description: "Keeps track of empty lines around block bodies."
|
|
|
|
Enabled: false
|
|
|
|
|
2017-11-23 08:09:44 +00:00
|
|
|
Layout/EmptyLinesAroundModuleBody:
|
2015-04-27 13:34:28 +00:00
|
|
|
Description: "Keeps track of empty lines around module bodies."
|
|
|
|
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
|
|
|
|
|
2018-10-09 06:17:41 +00:00
|
|
|
Rails/BulkChangeTable:
|
|
|
|
Description: 'Check whether alter queries are combinable.'
|
|
|
|
Enabled: false
|
|
|
|
|
2015-04-27 13:34:28 +00:00
|
|
|
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
|
|
|
|
|
2017-11-23 08:09:44 +00:00
|
|
|
Rails/SkipsModelValidations:
|
|
|
|
Description: >-
|
|
|
|
Use methods that skips model validations with caution.
|
|
|
|
See reference for more information.
|
|
|
|
Reference: 'http://guides.rubyonrails.org/active_record_validations.html#skipping-validations'
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
|
|
|
- test/**/*
|
2019-01-15 12:17:13 +00:00
|
|
|
- "**/*_spec.rb"
|
|
|
|
- "**/*_examples.rb"
|
2017-11-23 08:09:44 +00:00
|
|
|
|
2015-05-07 11:32:40 +00:00
|
|
|
Style/ClassAndModuleChildren:
|
|
|
|
Description: 'Checks style of children classes and modules.'
|
|
|
|
Enabled: false
|
|
|
|
|
2017-11-23 08:09:44 +00:00
|
|
|
Naming/FileName:
|
2015-05-08 13:58:28 +00:00
|
|
|
Description: 'Use snake_case for source file names.'
|
|
|
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
|
|
|
- 'script/websocket-server.rb'
|
|
|
|
|
2017-11-23 08:09:44 +00:00
|
|
|
Naming/VariableNumber:
|
|
|
|
Description: 'Use the configured style when numbering variables.'
|
|
|
|
Enabled: false
|
2015-05-08 13:58:28 +00:00
|
|
|
|
2018-04-12 14:57:37 +00:00
|
|
|
Naming/UncommunicativeMethodParamName:
|
2015-05-07 11:32:40 +00:00
|
|
|
Description: >-
|
2018-04-12 14:57:37 +00:00
|
|
|
Checks for method parameter names that contain capital letters,
|
|
|
|
end in numbers, or do not meet a minimal length.
|
|
|
|
Enabled: true
|
|
|
|
AllowedNames: e, id, _, ip
|
2015-08-21 21:59:18 +00:00
|
|
|
|
2018-04-12 14:57:37 +00:00
|
|
|
Lint/BooleanSymbol:
|
|
|
|
Description: 'Check for `:true` and `:false` symbols.'
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
|
|
|
- "db/seeds/object_manager_attributes.rb"
|
2018-12-05 10:43:53 +00:00
|
|
|
- "spec/requests/integration/object_manager_attributes_spec.rb"
|
2018-04-12 14:57:37 +00:00
|
|
|
- "test/integration/object_manager_test.rb"
|
2016-01-15 21:17:05 +00:00
|
|
|
|
2018-04-12 14:57:37 +00:00
|
|
|
Lint/InterpolationCheck:
|
|
|
|
Description: 'Raise warning for interpolation in single q strs'
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
|
|
|
- "test/unit/email_process_auto_response_test.rb"
|
|
|
|
- "test/unit/email_process_bounce_delivery_permanent_failed_test.rb"
|
|
|
|
- "test/unit/email_process_bounce_follow_test.rb"
|
|
|
|
- "test/unit/notification_factory_renderer_test.rb"
|
|
|
|
- "test/unit/notification_factory_template_test.rb"
|
|
|
|
- "test/unit/ticket_trigger_test.rb"
|
2018-05-29 15:42:14 +00:00
|
|
|
- "test/unit/ticket_trigger_recursive_disabled_test.rb"
|
2017-05-05 09:16:47 +00:00
|
|
|
|
|
|
|
# RSpec tests
|
|
|
|
Style/NumericPredicate:
|
|
|
|
Description: >-
|
|
|
|
Checks for the use of predicate- or comparison methods for
|
|
|
|
numeric comparisons.
|
|
|
|
StyleGuide: '#predicate-methods'
|
|
|
|
# This will change to a new method call which isn't guaranteed to be on the
|
|
|
|
# object. Switching these methods has to be done with knowledge of the types
|
|
|
|
# of the variables which rubocop doesn't have.
|
|
|
|
AutoCorrect: false
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
2017-11-23 08:09:44 +00:00
|
|
|
- "**/*_spec.rb"
|
|
|
|
|
|
|
|
Lint/AmbiguousBlockAssociation:
|
|
|
|
Description: >-
|
2019-01-14 04:13:40 +00:00
|
|
|
Checks for ambiguous block association with method when param
|
|
|
|
passed without parentheses.
|
2017-11-23 08:09:44 +00:00
|
|
|
StyleGuide: '#syntax'
|
|
|
|
Enabled: true
|
|
|
|
Exclude:
|
2018-05-08 10:10:19 +00:00
|
|
|
- "spec/support/*.rb"
|
2017-11-23 08:09:44 +00:00
|
|
|
- "**/*_spec.rb"
|
|
|
|
- "**/*_examples.rb"
|
2018-04-26 06:34:01 +00:00
|
|
|
|
2019-01-14 04:13:40 +00:00
|
|
|
Layout/MultilineMethodCallIndentation:
|
|
|
|
Description: >-
|
|
|
|
Checks the indentation of the method name part in method calls
|
|
|
|
that span more than one line.
|
|
|
|
EnforcedStyle: indented
|
|
|
|
Include:
|
|
|
|
- "**/*_spec.rb"
|
|
|
|
|
2018-04-26 06:34:01 +00:00
|
|
|
# Special exceptions
|
|
|
|
|
|
|
|
Style/HashSyntax:
|
|
|
|
Exclude:
|
|
|
|
- "**/*.rake"
|