Skip to content

Commit

Permalink
Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
stejskalleos committed Oct 6, 2023
1 parent cd3e581 commit a928e42
Show file tree
Hide file tree
Showing 4 changed files with 556 additions and 245 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@ env:
RAILS_ENV: test
DATABASE_URL: postgresql://postgres:@localhost/test
DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL: true
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true
jobs:
rubocop:
uses: theforeman/actions/.github/workflows/rubocop.yml@v0
with:
command: bundle exec rubocop --parallel --format github
test_ruby:
runs-on: ubuntu-latest
needs: rubocop
services:
postgres:
image: postgres:12.1
Expand Down
154 changes: 4 additions & 150 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,151 +1,5 @@
require:
- rubocop-performance
- rubocop-rails
- rubocop-minitest
inherit_from: .rubocop_todo.yml

inherit_from:
- .rubocop_todo.yml

AllCops:
TargetRubyVersion: 2.5
TargetRailsVersion: 5.2
Include:
- 'app/views/api/**/*.rabl'
- 'app/**/*.rb'
- 'lib/**/*.rb'
- 'test/**/*.rb'
- 'test/**/*.rb'
Exclude:
- 'db/schema.rb'
- 'node_modules/**/*'
- 'vendor/**/*'
- 'release-gem'
- 'extra/discover-host'

Bundler/OrderedGems:
Enabled: false

Layout/ArgumentAlignment:
EnforcedStyle: with_fixed_indentation
IndentationWidth: 2

Layout/DotPosition:
Enabled: false

Layout/FirstArgumentIndentation:
EnforcedStyle: consistent

Layout/HashAlignment:
Enabled: false

Layout/LineLength:
Enabled: false

Layout/ParameterAlignment:
Enabled: false

Metrics:
Enabled: false

Performance/Casecmp:
Enabled: false

Performance/RedundantMatch:
Enabled: true

Performance/RedundantMerge:
Enabled: true

Performance/RegexpMatch:
Enabled: false

Rails:
Enabled: true

Rails/Blank:
UnlessPresent: false

# Won't work with sqlite
Rails/BulkChangeTable:
Enabled: false

Rails/RefuteMethods:
Enabled: false

Style/Alias:
EnforcedStyle: prefer_alias_method

Style/AndOr:
EnforcedStyle: conditionals

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

# Don't enforce certain methods, e.g. detect over find
Style/CollectionMethods:
Enabled: false

Style/ConditionalAssignment:
Enabled: false

# Don't enforce documentation
Style/Documentation:
Enabled: false

Style/EmptyMethod:
EnforcedStyle: expanded

# Don't enforce frozen string literals
Style/FrozenStringLiteralComment:
Enabled: false

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

Style/IfUnlessModifier:
Enabled: false

Style/InverseMethods:
Enabled: false

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

Style/MultipleComparison:
Enabled: false

Style/NumericPredicate:
Enabled: false

Style/ParallelAssignment:
Enabled: false

Style/ParenthesesAroundCondition:
Enabled: false

Style/PreferredHashMethods:
Enabled: false

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

Style/SymbolArray:
EnforcedStyle: brackets
MinSize: 1

Style/TernaryParentheses:
EnforcedStyle: require_parentheses_when_complex

Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma

Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma

#Allow both ['a', 'b'], %w[a b] and %w(a b) style arrays
Style/WordArray:
Enabled: false
inherit_gem:
theforeman-rubocop:
- default.yml
Loading

0 comments on commit a928e42

Please sign in to comment.