-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
tools: check-imports.py false negatives #29226
Comments
Hey, I'm a bit new to opensource. Have some experience with Python and regex, and this looks interesting. Can I take this up? |
@ayushmandey97 Yes, you are welcome to, thanks. |
The script check-imports.py will now ignore the usage of module names in commented lines. Additionally, while searching for the usage, word boundaries will be used. Eg: 'Just' would not be considered in a sentence containing 'FromJust'. Fixes: nodejs#29226
I'll be adding support for multi-line comments as well. There's one issue though, I added a dummy 'using' statement in one of the .cc files to check if an error was thrown, but the check-imports.py file ran without any log statements. Another thing, since this is my first PR for Node, please feel free to let me know if I've made mistakes in the process or the code itself. |
The script check-imports.py will now ignore commented lines with spaces/tabs, and this fix also pointed the check to the correct src folder. Fixes: nodejs#29226
The script check-imports.py will now ignore the usage of module names in commented lines. Additionally, while searching for the usage, word boundaries will be used. Eg: 'Just' would not be considered in a sentence containing 'FromJust'. Fixes: nodejs#29226
The script check-imports.py will now ignore commented lines with spaces/tabs, and this fix also pointed the check to the correct src folder. Fixes: nodejs#29226
@sam-github the checks have been implemented. Please review once and let me know if any changes are required. @bnoordhuis please have a look at the PR. |
This commit removes the unused using declarations reported by lint-cpp. PR-URL: nodejs#33268 Refs: nodejs#29226 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Beth Griggs <[email protected]>
`check-imports.py` was missing some unused `using` statements as it was not matching on word boundaries (e.g. `MaybeLocal` was considered a use of `Local`). Fix that and add some unit tests (which required the script to be renamed to drop the `-` so it could be imported into the test script). PR-URL: nodejs#33268 Refs: nodejs#29226 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Beth Griggs <[email protected]>
@sam-github looks like another PR for this issue got merged while I didn't get any feedback on the one I raised, was there a reason for this? Let me know if I missed something |
This commit removes the unused using declarations reported by lint-cpp. PR-URL: #33268 Refs: #29226 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Beth Griggs <[email protected]>
`check-imports.py` was missing some unused `using` statements as it was not matching on word boundaries (e.g. `MaybeLocal` was considered a use of `Local`). Fix that and add some unit tests (which required the script to be renamed to drop the `-` so it could be imported into the test script). PR-URL: #33268 Refs: #29226 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Beth Griggs <[email protected]>
This commit removes the unused using declarations reported by lint-cpp. PR-URL: #33268 Refs: #29226 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Beth Griggs <[email protected]>
`check-imports.py` was missing some unused `using` statements as it was not matching on word boundaries (e.g. `MaybeLocal` was considered a use of `Local`). Fix that and add some unit tests (which required the script to be renamed to drop the `-` so it could be imported into the test script). PR-URL: #33268 Refs: #29226 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Beth Griggs <[email protected]>
`check-imports.py` was missing some unused `using` statements as it was not matching on word boundaries (e.g. `MaybeLocal` was considered a use of `Local`). Fix that and add some unit tests (which required the script to be renamed to drop the `-` so it could be imported into the test script). PR-URL: #33268 Refs: #29226 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Beth Griggs <[email protected]>
This commit removes the unused using declarations reported by lint-cpp. PR-URL: #33268 Refs: #29226 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Beth Griggs <[email protected]>
Refs: #29222
As that PR shows, there are some unused imports that
tools/check-imports.py
doesn't catch because:FromJust
is considered a use ofJust
.)The text was updated successfully, but these errors were encountered: