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

Does pep8speaks follow #noqa flags? #96

Closed
fmaussion opened this issue Oct 7, 2018 · 4 comments
Closed

Does pep8speaks follow #noqa flags? #96

fmaussion opened this issue Oct 7, 2018 · 4 comments
Projects

Comments

@fmaussion
Copy link

fmaussion commented Oct 7, 2018

We are in the process of moving from stickler-ci to pep8speaks, but we get false alarms from lines annotated with a #noqa (see this PR).

Is this expected? Is there a way to avoid these? Thanks a lot!

@OrkoHunter
Copy link
Collaborator

Hey @fmaussion! Thank you for reaching out to me about the issue.

I wasn't aware of #noqa until now. PEP8Speaks uses pycodestyle as the linter. So, the error messages are not up to me.

I found some discussion about implementing it in pycodestyle, but if I am not wrong, it still remains a missing feature.

So, yes this is expected as of now, and the only way to avoid it is to put E741 in the ignores list of .pep8speaks.yml

@fmaussion
Copy link
Author

Thanks for the info! Maybe we'll keep this issue open for future reference.

@OrkoHunter
Copy link
Collaborator

Hi @fmaussion !

I can see that E741 has been added to the ignore list in .pep8speaks.yml. Does @pep8speaks still complain about any #noqa errors other than E741?

I would also like to let you know that there is no need to maintain two copies of pycodestyle/flake8 settings in .pep8speaks.yml and setup.cfg. You can go ahead and remove pycodestyle: section from .pep8speaks.yml and it will read the [flake8] section of setup.cfg file. See #95 and pandas-dev/pandas#25605

@OrkoHunter
Copy link
Collaborator

OrkoHunter commented Mar 13, 2019

Hi @fmaussion !

PEP 8 Speaks can now support #noqa. After #115, projects can choose between pycodestyle and flake8 as their linter. The scanner.linter option .pep8speaks.yml should be set to flake8.

Example .pep8speaks.yml -

scanner:
    diff_only: True
    linter: flake8

flake8:  # Skip this if you have [flake8] in your setup.cfg file
    ignore:
        - EXXX
        - WXXX

Complete configuration details is in the README. I am going to close this issue. Let me know if you have any questions/comments!

Main board automation moved this from To do to Done Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Main board
  
Done
Development

No branches or pull requests

2 participants