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

Remove global pylint ignores #469

Closed
4 tasks done
marvinpfoertner opened this issue Jul 9, 2021 · 2 comments · Fixed by #522
Closed
4 tasks done

Remove global pylint ignores #469

marvinpfoertner opened this issue Jul 9, 2021 · 2 comments · Fixed by #522
Assignees
Labels
refactoring Refactoring of existing functionality testing and CI Unit tests, coverage and continuous integration

Comments

@marvinpfoertner
Copy link
Collaborator

marvinpfoertner commented Jul 9, 2021

Is your issue related to a problem? Please describe.
Several subpackages (e.g. diffeq, statespace, linops) did already resolve all individual pylint ignores on the package level.
However, since we also have many of these ignores are also defined globally in our pyproject.toml file, new pylint errors emerged in the meantime.

Describe the solution you'd like.

  • Discuss which ignores should be retained long-term (in discussion Long-term global `pylint` ignores #470)
  • Move all other ignores from pyproject.toml into tox.ini
  • Reformat pyproject.toml ignores (see example below) and add a short comment for each ignore which gives a reason why this is ignored
  • Refactor the script .github/workflows/pylint_check.py in the CI

Sample pyproject.toml format

[tool.pylint.messages_control]
disable = [
    # Exceptions suggested by Black:
    # https://github.com/psf/black/blob/7f75fe3669ebf0627b1b0476a6d02047e909b959/docs/compatible_configs.md#black-compatible-configurations
    "bad-continuation",
    "bad-whitespace",
    # Sometimes we want to use "mathematical notation" to name variables, e.g. `A` for matrices
    "invalid-name",
]

Additional context
I believe that we added these ignores globally in order to keep our local pylint runs from complaining too much when just calling pylint src/.

@marvinpfoertner marvinpfoertner added feature request Requests for features to be implemented refactoring Refactoring of existing functionality testing and CI Unit tests, coverage and continuous integration and removed feature request Requests for features to be implemented labels Jul 9, 2021
@marvinpfoertner marvinpfoertner added this to To do in ProbNum Development via automation Jul 9, 2021
@marvinpfoertner marvinpfoertner added this to the Dagstuhl Workshop milestone Jul 9, 2021
@marvinpfoertner
Copy link
Collaborator Author

@JonathanWenger @pnkraemer @nathanaelbosch @mmahsereci @alpiges FYI

@marvinpfoertner
Copy link
Collaborator Author

marvinpfoertner commented Aug 16, 2021

A complete list of pylint disables that require fixing:

  • no-member
  • import-error
  • abstract-method
  • abstract-class-instantiated
  • arguments-differ
  • arguments-renamed
  • function-redefined
  • redefined-builtin
  • redefined-outer-name
  • too-many-instance-attributes
  • too-many-arguments
  • too-many-locals
  • too-many-lines
  • too-many-statements
  • too-many-branches
  • too-complex
  • too-few-public-methods
  • protected-access
  • unnecessary-pass
  • unused-variable
  • unused-argument
  • unused-private-member
  • attribute-defined-outside-init
  • no-else-return
  • no-else-raise
  • no-self-use
  • consider-using-from-import
  • duplicate-code
  • line-too-long
  • missing-module-docstring
  • missing-class-docstring
  • missing-function-docstring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Refactoring of existing functionality testing and CI Unit tests, coverage and continuous integration
Projects
Development

Successfully merging a pull request may close this issue.

5 participants