Skip to content

Introduce linter to enforce consistent coding conventionsΒ #412

@moritzsommer

Description

@moritzsommer

Current Situation

Currently, there are no consistent coding conventions for contributions to this codebase. As the project is open source, inconsistencies and with that reduced code readability may be introduced by people following different coding guidelines.

Examples for inconsistencies are:

Proposed Change

To avoid inconsistencies and style violations in both existing and future code, I suggest adding a linter. This linter could be used for pre-commit checks, as well as for CI checks. Since we already use mypy for type checking, adding a linter would be the next logical step. If we wanted to take it a step further, we could also check for code smells.

I have researched the following linter options:

  • Ruff: Probably the newest and most efficient linter out there, with many out-of-the-box tools
  • Pylint: Very customisable, best if we want to enforce project-specific guidelines
  • Flake8: Quite lightweight, easy to use, many plugins
  • Black: Classic code formatter

Metadata

Metadata

Assignees

No one assigned

    Labels

    generalSomething to do with the BaSyx Python SDK repository in general

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions