Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.5
hooks:
- id: ruff-check
args: [ --fix ]
# Run the formatter.
- id: ruff-format
Comment on lines +2 to +8
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Ruff version used by this pre-commit hook is pinned via rev, but CI currently runs ruff check from the version installed via TEKDB/requirements.txt. If these drift, developers may get different fixes/formatting locally than what CI expects. Consider aligning the versions by pinning ruff in requirements.txt to the same version as the hook (or updating CI to run pre-commit run --all-files).

Suggested change
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.5
hooks:
- id: ruff-check
args: [ --fix ]
# Run the formatter.
- id: ruff-format
- repo: local
hooks:
- id: ruff-check
name: ruff-check
entry: ruff
language: system
types: [python]
args: [ --fix ]
# Run the formatter.
- id: ruff-format
name: ruff-format
entry: ruff
language: system
types: [python]
args: [ format ]

Copilot uses AI. Check for mistakes.
4 changes: 3 additions & 1 deletion TEKDB/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ ipython
# Serve static files in production containers
whitenoise>=6.0.0,<7.0.0
# FORMATTING AND LINTING
ruff
ruff
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are now two separate sources of truth for Ruff: CI installs and runs ruff from TEKDB/requirements.txt (currently unpinned), while pre-commit will run the Ruff version pinned by the hook rev. This can lead to developers auto-fixing/formatting with one Ruff version and then failing CI with another. Consider pinning ruff to a specific version in requirements.txt (ideally matching the pre-commit rev), or switching CI to run pre-commit run --all-files so both environments use the same pinned hook versions.

Suggested change
ruff
ruff==0.6.9

Copilot uses AI. Check for mistakes.
#pre-commit
pre-commit
Comment on lines +39 to +40
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pre-commit is being added to TEKDB/requirements.txt, which is installed in the production Docker image and used by update/provisioning scripts. This makes a dev-only tool part of the runtime dependency set and increases image size/attack surface unnecessarily. Consider moving pre-commit (and other lint/format tooling) into a separate dev requirements file (e.g., requirements_dev.txt) or an optional extra, and keep production installs on runtime-only dependencies.

Suggested change
#pre-commit
pre-commit
#pre-commit

Copilot uses AI. Check for mistakes.
Loading