-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Add a DisableComment Cop #18842
Add a DisableComment Cop #18842
Conversation
Evidently, something failed when I ran Good to see that the rule is working though! |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Not stale, I'll help @koddsson with this some more after the holidays. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! It works, as evidenced by the syntax check failing because a lot of our disables don’t have comments (yet). I’ll take a bit of time over 🎄 to add comments in a separate PR, since you probably don’t want to acquire the context to do that @koddsson. 😅
I’ve added some “nit” comments and some Sorbet type sigs in this review.
For the problems you were having running the test, it should work if you cd $(brew --repo); gh pr checkout 18842; brew tests --only=rubocops/disable_comment
.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I'm again probably holding this wrong 😭 😂
|
@koddsson Try to rebase and then |
Co-authored-by: Issy Long <[email protected]>
b9003d3
to
4acdcfc
Compare
6219fee
to
7b01442
Compare
Great work and perseverance here, thanks @koddsson! |
Hey 👋🏻!
I wrote this rule at work where we have a very similar codebase and @MikeMcQuaid suggested that it could be useful in Homebrew as well so I essentially just copied it over here.
The rule enforces that any
robocop:disable
have a preceding comment that explains why the rule was disabled. This can be very useful when things are disabled for seemingly obvious reasons, but they become less and less obvious over time.Everything looks good except for when I try to run the test I wrote, the test runner doesn't seem to find the test file 🤔. See the output log below.
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?I feel like I'm probably holding it wrong?