Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rubocop #607

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading