-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
disable=syntax-error doesn't work #986
Comments
What version of Pylint? I am observing a strange error related to inline disabling with Pylint 1.6.0 that I never saw with 1.5.6: # pylint: disable=unused-argument
|
Hmm, my version output shows 1.4.3 for PyLint. Not sure if this repros in a more recent version. |
If a |
@dmtucker there is a problem with the current release, a new bug fix is coming shortly (half an hour hopefully) |
Thanks for the report @bradfriedman This is actually expected. As @The-Compiler said, if the file cannot be parsed, then we cannot ignore the error at all. But why do you want to disable a syntax-error in the first case? |
Closing this, since it is the expected behavior. @dmtucker should be fixed now with 1.6.1. |
@PCManticore Thanks! I am no longer seeing the error. |
Hi all. My use case for this (which I think is valid and useful) is when running pylint on .py files which are used as jupyter notebooks. These files then sometimes have magic commands:
which obviously doesn't make for valid python syntax but are useful to have inline in the file. It's very useful to have the rest of the notebook linted so ignoring it locally could be great. Would you reconsider? |
I have some files used by Dundas BI, which is similar to what @syagev has- except the variables are flanked on each side by a dollar sign like this:
It would be great if I could at least disable pylint from running on those files using Perhaps, if there was a syntax error it could read the first line of the module as plain text. If the first line had a comment with |
As mentioned above, these wouldn't parse without As a workaround, you could use nbQA to run pylint on notebooks:
disclaimer: I'm the author of nbQA |
Labelled as "won't fix", because as @MarcoGorelli said there is an external solution and jupyter notebook are not pylint's core competency. |
I want to pylint code with cython parts, where want to skip parts. Maybe preprocessing brackets?
|
Can you open another issue for cython please @alex-eri ? |
Steps to reproduce
Current behavior
The syntax error on the line is ignored.
Expected behavior
The syntax error is still reported.
The text was updated successfully, but these errors were encountered: