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

--auto-gen-config --auto-gen-only-exclude should generate a list of LineLength offending files #12819

Closed
brkn opened this issue Apr 5, 2024 · 1 comment

Comments

@brkn
Copy link
Contributor

brkn commented Apr 5, 2024

Expected behavior

Running rubocop --auto-gen-config --auto-gen-only-exclude should create a list of LineLength offending files. Example before version 1.62.1

# Offense count: 231
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
  Exclude:
    - 'app/models/book.rb'
    - 'app/models/author.rb'

Actual behavior

The command outputs this instead.

Phase 1 of 2: run Layout/LineLength cop (skipped because only excludes will be generated due to `--auto-gen-only-exclude` flag)
Phase 2 of 2: run all cops

And then todo file contains this block instead

# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
Layout/LineLength:
  Max: 842

This behaviour changed at #12730

Steps to reproduce the problem

  1. Have files violating the Layout/LineLength rule.
  2. run rubocop --auto-gen-config --auto-gen-only-exclude

RuboCop version

❯ bundle exec rubocop -V 
1.62.1 (using Parser 3.3.0.5, rubocop-ast 1.31.2, running on ruby 2.7.8) [arm64-darwin22]
  - rubocop-capybara 2.20.0
  - rubocop-factory_bot 2.25.1
  - rubocop-rails 2.24.1
  - rubocop-rspec 2.29.1
@brkn
Copy link
Contributor Author

brkn commented Apr 5, 2024

Nevermind, this happens because I switched from --exclude-limit 9999999 to --no-exclude-limit

@brkn brkn closed this as completed Apr 5, 2024
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

No branches or pull requests

1 participant