123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- # Default enabled cops
- # https://github.com/bbatsov/rubocop/blob/master/config/enabled.yml
- AllCops:
- Exclude:
- - 'bin/rails'
- - 'bin/rake'
- - 'bin/spring'
- - 'db/schema.rb'
- Rails:
- Enabled: true
- # Zammad StyleGuide
- Style/FrozenStringLiteralComment:
- Enabled: false
- Metrics/LineLength:
- Description: 'Limit lines to 80 characters.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
- Enabled: false
- 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/TrailingCommaInLiteral:
- Description: 'Checks for trailing comma in array and hash literals.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
- Enabled: false
- Style/TrailingCommaInArguments:
- Description: 'Checks for trailing comma in argument lists.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
- Enabled: false
- Layout/SpaceInsideParens:
- Description: 'No spaces after ( or before ).'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
- Enabled: false
- Layout/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
- Layout/LeadingCommentSpace:
- Description: 'Comments should start with a space.'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
- Enabled: false
- Style/MethodCallWithoutArgsParentheses:
- 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
- Layout/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
- Layout/EmptyLinesAroundClassBody:
- Description: "Keeps track of empty lines around class bodies."
- Enabled: false
- Layout/EmptyLinesAroundMethodBody:
- Description: "Keeps track of empty lines around method bodies."
- Enabled: false
- Layout/EmptyLinesAroundBlockBody:
- Description: "Keeps track of empty lines around block bodies."
- Enabled: false
- Layout/EmptyLinesAroundModuleBody:
- 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
- Rails/FindEach:
- Description: 'Prefer all.find_each over all.find.'
- Enabled: false
- Rails/HasAndBelongsToMany:
- Description: 'Prefer has_many :through to has_and_belongs_to_many.'
- # StyleGuide: 'https://github.com/bbatsov/rails-style-guide#has-many-through'
- Enabled: false
- 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/**/*
- Style/ClassAndModuleChildren:
- Description: 'Checks style of children classes and modules.'
- Enabled: false
- Naming/FileName:
- 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'
- Naming/VariableNumber:
- Description: 'Use the configured style when numbering variables.'
- Enabled: false
- # 2.0
- Metrics/PerceivedComplexity:
- Description: >-
- A complexity metric geared towards measuring complexity for a
- human reader.
- Enabled: false
- Metrics/AbcSize:
- Description: >-
- A calculated magnitude based on number of assignments,
- branches, and conditions.
- Enabled: false
- Metrics/CyclomaticComplexity:
- Description: >-
- A complexity metric that is strongly correlated to the number
- of test cases needed to validate a method.
- Enabled: false
- Metrics/BlockNesting:
- Description: 'Avoid excessive block nesting'
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
- Enabled: false
- Metrics/ModuleLength:
- Description: 'Avoid modules longer than 100 lines of code.'
- Enabled: false
- Metrics/BlockLength:
- Enabled: false
- Lint/RescueWithoutErrorClass:
- Enabled: false
- Rails/ApplicationRecord:
- Enabled: false
- # TODO
- Rails/HasManyOrHasOneDependent:
- Enabled: false
- Style/DateTime:
- Enabled: false
- Style/Documentation:
- Description: 'Document classes and non-namespace modules.'
- Enabled: false
- Lint/UselessAssignment:
- Enabled: false
- Layout/ExtraSpacing:
- Description: 'Do not use unnecessary spacing.'
- Enabled: false
- # Broken!!!! Generates broken code since "String".downcase == "strinG".downcase is not equals "String".casecmp("strinG") but "String".casecmp("strinG") == 0 !!!
- Performance/Casecmp:
- Description: 'Use `casecmp` rather than `downcase ==`.'
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code'
- Enabled: false
- # 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:
- - "**/*_spec.rb"
- Lint/AmbiguousBlockAssociation:
- Description: >-
- Checks for ambiguous block association with method when param passed without
- parentheses.
- StyleGuide: '#syntax'
- Enabled: true
- Exclude:
- - "**/*_spec.rb"
- - "**/*_examples.rb"
|