Skip to content

Commit

Permalink
Disable rails, enable rspec cops on root
Browse files Browse the repository at this point in the history
We don't lint rails code in this setup. Would have prevented
662380b to break clouduploader.
  • Loading branch information
hennevogel committed Mar 2, 2023
1 parent 0c885c2 commit 4cb43be
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 16 deletions.
14 changes: 3 additions & 11 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ inherit_from: .rubocop_todo.yml

require:
- rubocop-performance
- rubocop-rails
- rubocop-rspec

AllCops:
NewCops: enable
Expand All @@ -19,6 +19,8 @@ AllCops:
SuggestExtensions:
# We don't want extra cops for minitest since we want to migrate those tests to RSpec
rubocop-minitest: false
# We lint our rails code with the setup in src/api/.rubocop.yml
rubocop-rails: false

#################### Layout ###########################

Expand Down Expand Up @@ -84,13 +86,3 @@ Layout/LineLength:
Metrics/ModuleLength:
Severity: refactor

##################### Rails ####################################

Rails/RakeEnvironment:
Exclude:
# All tasks are executing scripts and those don't need application code nor the environment
- 'Rakefile'

# This requires texts be moved to the locale files in the config/locales directory
Rails/I18nLocaleTexts:
Enabled: false
75 changes: 70 additions & 5 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# This configuration was generated by
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 100`
# on 2023-02-23 14:22:02 UTC using RuboCop version 1.45.1.
# on 2023-03-02 13:05:04 UTC using RuboCop version 1.45.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: have_no, not_to
Capybara/NegationMatcher:
Exclude:
- 'dist/t/spec/spec_helper.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: AllowSafeAssignment.
Expand All @@ -29,21 +37,20 @@ Lint/UselessAssignment:
Exclude:
- 'dist/obs_mirror_project'

# Offense count: 4
# Offense count: 3
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
Metrics/AbcSize:
Exclude:
- 'dist/clouduploader.rb'
- 'dist/openQA_mail_notification.rb'

# Offense count: 5
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
# Offense count: 4
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
# AllowedMethods: refine
Metrics/BlockLength:
Exclude:
- 'Rakefile'
- 'dist/obs_mirror_project'
- 'dist/t/spec/features/0040_package_spec.rb'

# Offense count: 7
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
Expand All @@ -59,6 +66,64 @@ Metrics/ParameterLists:
Exclude:
- 'dist/clouduploader.rb'

# Offense count: 6
RSpec/BeforeAfterAll:
Exclude:
- 'spec/spec_helper.rb'
- 'spec/rails_helper.rb'
- 'spec/support/**/*.rb'
- 'dist/t/spec/features/0020_interconnect_spec.rb'
- 'dist/t/spec/features/0030_project_spec.rb'
- 'dist/t/spec/features/0040_package_spec.rb'

# Offense count: 8
# Configuration parameters: Max, CountAsOne.
RSpec/ExampleLength:
Exclude:
- 'dist/t/spec/features/0010_authentication_spec.rb'
- 'dist/t/spec/features/0020_interconnect_spec.rb'
- 'dist/t/spec/features/0030_project_spec.rb'
- 'dist/t/spec/features/0040_package_spec.rb'

# Offense count: 10
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples.
# DisallowedExamples: works
RSpec/ExampleWording:
Exclude:
- 'dist/t/spec/features/0010_authentication_spec.rb'
- 'dist/t/spec/features/0020_interconnect_spec.rb'
- 'dist/t/spec/features/0030_project_spec.rb'
- 'dist/t/spec/features/0040_package_spec.rb'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: implicit, each, example
RSpec/HookArgument:
Exclude:
- 'dist/t/spec/features/0010_authentication_spec.rb'
- 'dist/t/spec/spec_helper.rb'
- 'dist/t/spec/support/capybara.rb'

# Offense count: 3
# Configuration parameters: Max.
RSpec/MultipleExpectations:
Exclude:
- 'dist/t/spec/features/0010_authentication_spec.rb'
- 'dist/t/spec/features/0020_interconnect_spec.rb'
- 'dist/t/spec/features/0040_package_spec.rb'

# Offense count: 4
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Inferences.
RSpec/Rails/InferredSpecType:
Exclude:
- 'dist/t/spec/features/0010_authentication_spec.rb'
- 'dist/t/spec/features/0020_interconnect_spec.rb'
- 'dist/t/spec/features/0030_project_spec.rb'
- 'dist/t/spec/features/0040_package_spec.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
Expand Down

0 comments on commit 4cb43be

Please sign in to comment.