Skip to content

Commit

Permalink
Update RuboCop configuration to inherit from theforeman-rubocop (#886)
Browse files Browse the repository at this point in the history
* Update RuboCop configuration to inherit from theforeman-rubocop
  • Loading branch information
archanaserver authored Jul 17, 2024
1 parent b4e1d9a commit e939a23
Show file tree
Hide file tree
Showing 30 changed files with 588 additions and 55 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ruby_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
rubocop:
name: Rubocop
uses: theforeman/actions/.github/workflows/rubocop.yml@v0
with:
command: bundle exec rubocop --parallel --format github

test:
name: Ruby
Expand Down
75 changes: 73 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,73 @@
inherit_from:
- https://raw.githubusercontent.com/theforeman/foreman/2.3-stable/.rubocop.yml
inherit_from: .rubocop_todo.yml

inherit_gem:
theforeman-rubocop:
- default.yml

AllCops:
TargetRubyVersion: 2.7
TargetRailsVersion: 6.1
Exclude:
- "db/schema.rb"
- "node_modules/**/*"
- "vendor/**/*"

Metrics:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Layout/LineLength:
Enabled: false

Layout/DotPosition:
Enabled: false

Layout/HashAlignment:
Enabled: false

Performance/RegexpMatch:
Enabled: false

Rails/RefuteMethods:
Enabled: false

# Don't prefer is_a? over kind_of?
Style/ClassCheck:
Enabled: false

Style/ConditionalAssignment:
Enabled: false

# Support both, Ruby 1.9 hashmap and hash-rocket syntax
Style/HashSyntax:
EnforcedStyle: no_mixed_keys

Style/IfUnlessModifier:
Enabled: false

# disabled until we can configure "+" as concat sign
Style/LineEndConcatenation:
Enabled: false

Style/NumericPredicate:
Enabled: false

Style/ParenthesesAroundCondition:
Enabled: false

# Both double and single quotes are OK
Style/StringLiterals:
Enabled: false

Style/SymbolArray:
EnforcedStyle: brackets
MinSize: 1

#Allow both ['a', 'b'], %w[a b] and %w(a b) style arrays
Style/WordArray:
Enabled: false

Style/RaiseArgs:
EnforcedStyle: compact
Loading

0 comments on commit e939a23

Please sign in to comment.