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

Change to be inline disable for RSpec/SpecFilePathFormat like RSpec/FilePath #1726

Merged
merged 1 commit into from
Oct 15, 2023

Conversation

ydah
Copy link
Member

@ydah ydah commented Sep 23, 2023

Fix: #1720


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • [-] Updated documentation.
  • Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

@ydah
Copy link
Member Author

ydah commented Sep 23, 2023

@dgollahon How about this? Changed to match the behavior of RSpec/FilePath.

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@bquorning
Copy link
Collaborator

I don’t see any inline disables in the spec. Am I missing something?

@pirj
Copy link
Member

pirj commented Oct 15, 2023

The problem was that with ‘add_global_offense’ it wasn’t possible to use inline disabling.

Though now when you ask this, I feel that it’s weird to inline disable this cop.

blanket disables early in the file or when attached to the end of a RSpec.describe line. Either way worked for RSpec/FilePath.

But for the sake of continuity, it feels we are doing the right thing.

Would you guys agree to revert this and use ‘add_global_offense’ in 3.0.0?

@bquorning
Copy link
Collaborator

@dgollahon actually makes a good case for inline disables in #1720 (comment)

@pirj
Copy link
Member

pirj commented Oct 15, 2023

It makes sense to me.
There are still cases for config file disables, e.g. a directory, so one doesn’t have to inline disable each newly-added file.

The approach provided by this PR would allow both inline and config-based, so our users could use it to their preference.

Agree to keep it this way 👍

@pirj pirj merged commit 1c42da1 into master Oct 15, 2023
22 checks passed
@pirj pirj deleted the 1720 branch October 15, 2023 16:32
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 this pull request may close these issues.

Bug in RSpec/SpecFilePathFormat inline disables?
3 participants