Skip to content

Replace pre commit with prek#133

Merged
erwindouna merged 10 commits intoerwindouna:mainfrom
wmalgadey:replace-pre-commit
Feb 18, 2026
Merged

Replace pre commit with prek#133
erwindouna merged 10 commits intoerwindouna:mainfrom
wmalgadey:replace-pre-commit

Conversation

@wmalgadey
Copy link
Collaborator

Proposed Changes

prek is a faster and better supported implementation of the pre-commit framework, mostly compatible with the original framework.

Related Issues

closes #132

@wmalgadey wmalgadey self-assigned this Feb 18, 2026
Copilot AI review requested due to automatic review settings February 18, 2026 21:35
@erwindouna erwindouna added the ci Work that improve the CI/CD label Feb 18, 2026
@erwindouna erwindouna merged commit 69a8f93 into erwindouna:main Feb 18, 2026
10 of 18 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request replaces the pre-commit framework with prek, a faster and more compatible alternative. The migration includes updating dependencies, configuration files, documentation, and GitHub Actions workflows. Additionally, Python code has been updated to follow modern Python 3.12+ conventions through Ruff auto-fixes (using UTC instead of timezone.utc and collections.abc instead of typing).

Changes:

  • Replaced pre-commit with prek in dependencies (pyproject.toml and uv.lock)
  • Updated .pre-commit-config.yaml to use prek's "builtin" repo feature for faster hook execution
  • Modified GitHub Actions linting workflow to use uv run prek commands
  • Updated README and devcontainer configuration to reference prek instead of pre-commit
  • Applied Ruff auto-fixes for Python 3.12+ conventions (UTC usage, collections.abc imports)

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
uv.lock Removed pre-commit, pre-commit-hooks, and related dependencies (cfgv, distlib, filelock, identify, nodeenv, virtualenv); added prek 0.3.3
pyproject.toml Replaced pinned pre-commit and pre-commit-hooks versions with unpinned prek dependency
.pre-commit-config.yaml Restructured to use prek's "builtin" repo for common hooks, added remote pre-commit-hooks repository, organized local hooks
.github/workflows/linting.yaml Updated pre-commit-hooks and pylint jobs to use uv run prek commands; added duplicate check-yaml step
README.md Updated documentation to reference uv and prek instead of Poetry and pre-commit
.devcontainer/devcontainer.json Removed pre-commit feature, switched to custom Dockerfile, updated commands to use uv and prek
.devcontainer/Containerfile New file to customize devcontainer with apt cleanup for deprecated yarn repository
tests/test_tado.py Applied Ruff auto-fix: replaced timezone.utc with UTC constant
tests/conftest.py Applied Ruff auto-fix: replaced typing imports with collections.abc
src/tadoasync/tadoasync.py Applied Ruff auto-fix: replaced timezone.utc with UTC constant

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 79 to +80
- name: 🚀 Check YAML files
run: poetry run pre-commit run check-yaml --all-files
run: uv run prek run check-yaml --all-files
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

Duplicate step: "Check YAML files" is executed twice (lines 77-78 and 79-80). One of these steps should be removed.

Copilot uses AI. Check for mistakes.
Comment on lines 94 to 107
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The workflow is still using Poetry for dependency management (installing poetry, using poetry cache, running poetry install), but then executing prek with "uv run". This is inconsistent with the project's migration to uv. The workflow should be updated to use uv throughout, replacing poetry setup and installation steps with uv installation and "uv sync".

Copilot uses AI. Check for mistakes.
"mypy==1.9.0",
"pre-commit==3.6.0",
"pre-commit-hooks==4.5.0",
"prek",
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The prek dependency is not pinned to a specific version, which is inconsistent with most other dev dependencies in this file (e.g., mypy==1.9.0, pylint==3.0.3, pytest==8.1.1). Consider pinning prek to a specific version for reproducibility. However, if the intent is to always use the latest version, this approach is acceptable but should be documented or made consistent across all dev dependencies.

Suggested change
"prek",
"prek==0.6.5",

Copilot uses AI. Check for mistakes.
Comment on lines 45 to 58
- name: 🏗 Set up Poetry
run: pipx install poetry
- name: 🏗 Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.0.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: 🏗 Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: 🏗 Install Python dependencies
run: poetry install --no-interaction
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The workflow is still using Poetry for dependency management (installing poetry, using poetry cache, running poetry install), but then executing prek commands with "uv run". This is inconsistent and inefficient. Since the project has migrated to uv (as evidenced by uv.lock, pyproject.toml dependency-groups, and the README updates), the workflow should be updated to use uv throughout. Replace poetry setup and installation steps with uv installation and "uv sync".

Copilot uses AI. Check for mistakes.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

ci Work that improve the CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace pre-commit with prek

3 participants