Skip to content

Update pre-commit & linting configuration#166

Merged
C-Achard merged 10 commits intomainfrom
cy/lint-config
Mar 11, 2026
Merged

Update pre-commit & linting configuration#166
C-Achard merged 10 commits intomainfrom
cy/lint-config

Conversation

@C-Achard
Copy link
Copy Markdown
Collaborator

@C-Achard C-Achard commented Mar 4, 2026

Following standardization efforts across repos, this PR introduces an updated pre-commit config that follows those introduced in DLC-live and DeepLabCut.


This pull request updates pre-commit hooks and linting configurations to improve code quality enforcement and consistency. The most important changes include adding new pre-commit hooks for various file checks, updating hook versions, and specifying a docstring style convention for linting.

Pre-commit hook improvements:

  • Added new hooks to .pre-commit-config.yaml for checking large files, YAML and TOML syntax, test naming conventions, and merge conflicts, increasing the breadth of automated checks.
  • Updated the ruff-pre-commit hook to version v0.15.4 and the pyproject-fmt hook to version v2.16.2, ensuring the latest features and bug fixes are included.

Linting configuration:

  • Specified the google convention for docstring style in the pyproject.toml file under [tool.ruff.lint.pydocstyle], standardizing documentation format across the codebase.

C-Achard added 6 commits March 4, 2026 10:02
… config

Populate pyproject.toml with PEP 621 project metadata and setuptools configuration: set build-system requirements (setuptools>=64, wheel, setuptools_scm[toml]>=7), declare package name, description, python requirement, license, authors, classifiers, dependencies, project URLs and napari entry-point. Configure setuptools to use src layout, include package data (napari.yaml), mark version as dynamic (setuptools-scm), and add optional testing dependencies. Minor whitespace/qt_api line adjustments preserved.
Update pyproject.toml: raise build-system requirement to setuptools>=77 and replace the license table with license = "LGPL-3.0-only" plus license-files = ["LICENSE"]. These changes align packaging metadata with newer setuptools/PEP expectations and ensure the license file is included.
Add GNU Lesser General Public License v3 (LGPLv3) to the project classifiers in pyproject.toml to explicitly declare the license. Also rephrase the setuptools-scm comment for clarity that the version is derived from git tags.
Add pyproject-fmt and validate-pyproject to pre-commit to enforce and validate pyproject.toml formatting. Add [tool.pyproject-fmt] settings in pyproject.toml to set max_supported_python to 3.12, enable generation of Python version classifiers, and keep tables in long format to preserve readability.
Delete the GNU Lesser General Public License v3 trove classifier from pyproject.toml to correct package metadata, following PEP 639
@C-Achard C-Achard added this to the Core plugin overhaul (2026) milestone Mar 4, 2026
@C-Achard C-Achard self-assigned this Mar 4, 2026
@C-Achard C-Achard added the enhancement New feature or request label Mar 4, 2026
@C-Achard C-Achard added the CI Related to CI/CD and workflows label Mar 4, 2026
Remove the setup-cfg-fmt hook from .pre-commit-config.yaml. Correct a grammar/casing issue in pyproject.toml by changing the author line from "Lead by Jessy Lauer" to "led by Jessy Lauer".
C-Achard added 2 commits March 4, 2026 11:02
Add several pre-commit hooks (check-added-large-files, check-yaml, check-toml, name-tests-test, check-merge-conflict) alongside existing EOF and trailing-whitespace fixes to improve repo hygiene and catch common issues early. Also configure ruff's pydocstyle convention to "google" in pyproject.toml to enforce Google-style docstrings.
@C-Achard C-Achard marked this pull request as ready for review March 4, 2026 10:03
@C-Achard C-Achard requested a review from deruyter92 March 11, 2026 13:41
@C-Achard C-Achard changed the base branch from cy/migrate-pyproject-from-setup-cfg to main March 11, 2026 13:44
@C-Achard C-Achard merged commit 8a72588 into main Mar 11, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Related to CI/CD and workflows enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants