Skip to content

Apply linting to entire codebase & add CI workflow to check linting#3216

Draft
deruyter92 wants to merge 51 commits intomainfrom
jaap/reformat_codebase
Draft

Apply linting to entire codebase & add CI workflow to check linting#3216
deruyter92 wants to merge 51 commits intomainfrom
jaap/reformat_codebase

Conversation

@deruyter92
Copy link
Collaborator

@deruyter92 deruyter92 commented Feb 23, 2026

This PR is part of the task described in issue #3217

Motivation:
Linting has not been applied consistently in existing codebase. Following DeepLabCut/DeepLabCut-live#166, it would be great to introduce a modern and consistent linting configuration again, after reformatting the codebase.

Order of merging:

Changes:
(Copies the procedure from DeepLabCut/DeepLabCut-live#166, by @C-Achard )

  • Add format.yaml
  • Apply linting to the entire codebase by running:
ruff format . --config pyproject.toml

Note: By running this command, the formatting could be applied easily in a separate PR. This requires step 2 to be completed (having an updated pyproject.toml which include the new linting configuration).

arashsm79 and others added 30 commits October 24, 2025 17:00
- Edit pyproject.toml
- Keep setup.py for backward compatibility
deruyter92 and others added 21 commits February 5, 2026 11:46
Co-authored-by: Cyril Achard <[email protected]>
Co-authored-by: Cyril Achard <[email protected]>
Co-authored-by: Cyril Achard <[email protected]>
Co-authored-by: Cyril Achard <[email protected]>
Co-authored-by: Cyril Achard <[email protected]>
Update .pre-commit-config.yaml to add TOML support and pyproject checks: include the check-toml hook and add pyproject-fmt (rev v2.15.2) and validate-pyproject (rev v0.25) repositories. These hooks enforce formatting and validation for pyproject.toml files as part of pre-commit.
[tool.ruff]
lint.select = ["E", "F", "B", "I", "UP"]
lint.ignore = ["E741"]
target-version = "py310"
fix = true
line-length = 120

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.pyproject-fmt]
max_supported_python = "3.12"
generate_python_version_classifiers = true
# Avoid collapsing tables to field.key = value format (less readable)
table_format = "long"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task: Fix linting & and pre-commit-hooks and add to CI workflow

3 participants