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

Metrics/AbcSize with auto-gen-only-exclude option #12888

Closed
jpawlyn opened this issue May 6, 2024 · 0 comments · Fixed by #12902
Closed

Metrics/AbcSize with auto-gen-only-exclude option #12888

jpawlyn opened this issue May 6, 2024 · 0 comments · Fixed by #12902

Comments

@jpawlyn
Copy link

jpawlyn commented May 6, 2024

When comparing the .rubocop_todo.yml file generated with:

rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit

versus

rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit=100000

the exclude section for Metrics/AbcSize is absent with the former and a Max value is given instead.


Expected behavior

I would expect the two versions of .rubocop_todo.yml to be the same since the number of excluded files for Metrics/AbcSize is only 52.

Actual behavior

Using the --no-exclude-limit option gives:

# Offense count: 69
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
  Max: 43

Steps to reproduce the problem

The problem only occurred when the offense count was 25 or above but it could be the number of excluded files is also a factor.

RuboCop version

1.63.4 (using Parser 3.3.1.0, rubocop-ast 1.31.3, running on ruby 3.3.1) [arm64-darwin23]
  - rubocop-capybara 2.20.0
  - rubocop-factory_bot 2.25.1
  - rubocop-graphql 1.5.1
  - rubocop-rails 2.24.1
  - rubocop-rspec 2.29.2
  - rubocop-rspec_rails 2.28.3
Earlopain added a commit to Earlopain/rubocop that referenced this issue May 14, 2024
koic added a commit that referenced this issue May 16, 2024
[Fix #12888] Fix `--no-exclude-limit` for cops with `Max` config option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant