Skip to content

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

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

Apply linting to entire codebase & add CI workflow to check linting#167
C-Achard merged 11 commits intomainfrom
cy/lint-apply

Conversation

@C-Achard
Copy link
Copy Markdown
Collaborator

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

Following standardization efforts across repos, this PR introduces a workflow to automatically enforce linting on PRs and applies the configuration introduced in #166 to all existing files.


Changes:
(Copies the procedure from DeepLabCut/DeepLabCut-live#166)

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

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 self-assigned this Mar 4, 2026
@C-Achard C-Achard added enhancement New feature or request CI Related to CI/CD and workflows labels Mar 4, 2026
@C-Achard C-Achard added this to the Core plugin overhaul (2026) milestone 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 added 2 commits March 4, 2026 11:03
Add a GitHub Actions workflow that runs pre-commit checks only on files changed in a pull request. The workflow triggers on PR opened/synchronize/reopened, fetches full git history to detect changed files against the base branch, and exposes that list as an output. A conditional precommit job runs only when changes exist: it checks out the PR branch, sets up Python 3.12, installs pre-commit, and executes pre-commit in CI check-only mode on the changed files (--hook-stage manual --show-diff-on-failure).
@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/lint-config to main March 11, 2026 14:18
@C-Achard C-Achard merged commit fa4e71e into main Mar 11, 2026
2 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