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

Add pylint #4100

Closed
wants to merge 1 commit into from
Closed

Add pylint #4100

wants to merge 1 commit into from

Conversation

zundertj
Copy link
Collaborator

For discussion

https:/PyCQA/pylint is a different, and arguably more strict linter than flake8. This PR shows the impact by fixing issues on several files (almost, still some errors). I have added some acceptable (up for discussion) errors in pyproject.toml, but there are probably more.

To run locally, when having installed pylint and inside the py-polars dir:

pylint polars

@zundertj zundertj changed the title Add pylint dependency, fix a couple of files (partially) to show impact Add pylint Jul 20, 2022
@github-actions github-actions bot added the python Related to Python Polars label Jul 20, 2022
@ghuls
Copy link
Collaborator

ghuls commented Jul 21, 2022

Personally I am not a fan of the removal of elif and else after a return statement or with raises, as the "branching" code is less clear for me (although the code does exactly the same).

I think it can be disabled with: no-else-raise and no-else-return

On a project I recently worked on, the following lints were disabled:

disable=raw-checker-failed,
        bad-inline-option,
        locally-disabled,
        file-ignored,
        suppressed-message,
        useless-suppression,
        deprecated-pragma,
        use-symbolic-message-instead,
        invalid-name,
        too-many-instance-attributes,
        too-many-arguments,
        unused-argument,
        wrong-import-order,
        missing-module-docstring,
        missing-class-docstring,
        missing-function-docstring,
        too-many-branches,
        too-many-nested-blocks,
        no-else-break,
        broad-except,
        pointless-string-statement,
        use-list-literal,
        no-else-raise,
        no-else-return

50561fe#diff-4c94e013bf5cbe1352b49c01958d0a6d58948f0abf030bf26f6f6c9089e4706eL281-R287

@stinodego
Copy link
Member

There's definitely some nice lints in pylint. Thanks for looking into this! I think most are available in flake8 as well through the plugin system. I propose we keep the discussion to the related issue #4044.

@ritchie46
Copy link
Member

I think we can incrementally add the lints we'd like with flake8 so I am closing this for now.

@ritchie46 ritchie46 closed this Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants