-
Notifications
You must be signed in to change notification settings - Fork 187
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
Remove pipe on end of commented code prior to checking parsability #2672
Conversation
@AshesITR / @IndrajeetPatil WDYT? |
I have often seen commented pipe steps in code I reviewed. I think it's a useful addition unlikely to produce many false positives. Maybe we could also change the linters behavior to check if the code parses when removing the comment character from a consecutive block of comments as well, i.e. make it "context-aware". That would necessitate making it file-level, though and might break some stuff, so that's definitively out-pf-scope here. |
Co-authored-by: AshesITR <[email protected]>
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.
Thanks!
Closes #2671
The PR removes pipes from the end of
extracted_code
when checking parsability of code. A test to check that a lint is detected on commented lines ending with a pipe (which are otherwise parsable) are indeed detected.This solves a common false negative occurrence in, for example, data wrangling
The above snippet detect no commented code lints, but changes in this PR would lead to a commented code linter being detected