Skip to content

Conversation

@CoMPaTech
Copy link
Member

@CoMPaTech CoMPaTech commented Jan 12, 2026

  • Migrating pre-commit to prek (still backwards compatible)
    • For contributors, uv pip install prek; prek install -f to migrate and prek run --all-files to check your bearings
  • As we reintroduced prettier, drop complicated biomejs approach
  • Adjust plugwise/gh-actions moving pre-commit->prek and default (v2 so other repo's can continue functioning)
  • As well migrate away from node-based markdown linting to python markdown linting
  • Fix two typo's from codespel (in comments)

Summary by CodeRabbit

  • Chores

    • Updated CI workflows to v2, bumped cache version, and migrated tooling/terminology from pre-commit to prek across workflows and scripts.
    • Replaced node-based markdownlint with a Python-based linter (pymarkdown) and removed biome formatting steps.
    • Updated setup and test scripts to install prek hooks.
  • Bug Fixes

    • Fixed minor docstring typos.

✏️ Tip: You can customize this high-level summary in your review settings.

@CoMPaTech CoMPaTech requested a review from a team as a code owner January 12, 2026 16:25
@CoMPaTech CoMPaTech added enhancement New feature or request dependencies Pull requests that update a dependency file quality pre-commit labels Jan 12, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Migrate CI and developer tooling from pre-commit to prek, replace node-based markdownlint with pymarkdown, remove Biome formatter and related hooks, update GitHub Actions inputs/versions and cache version, and adjust scripts, requirements, and linting configs accordingly.

Changes

Cohort / File(s) Summary
GitHub Actions & Workflow
.github/workflows/verify.yml
Bump CACHE_VERSION 2→3; rename PRE_COMMIT_HOMEPREK_HOME; update action versions to v2; replace pre-commit invocations/inputs with prek equivalents; adjust step names and caching/restore usage.
Linting & Hooks Config
.pre-commit-config.yaml, .pymarkdown, .markdownlint.yaml
Remove setup_test and biome hooks; switch markdown hook to jackdewinter/pymarkdown (rev v0.9.34) and add .pymarkdown config disabling md013; remove explicit defaults from .markdownlint.yaml.
Scripts (dev/setup/test)
scripts/setup.sh, scripts/setup_test.sh, scripts/tests_and_coverage.sh
Replace pre-commit install with prek install --install-hooks; remove biome CLI/install and biome_format() usage; update comments and conditional blocks accordingly.
Dependencies
requirements_commit.txt
Replace pre-commit with prek>=0.2.27.
Formatter & Biome config
biome.json, scripts/manual_fixtures.py
Remove maxSize entry from biome.json; formatting-only rewrap in scripts/manual_fixtures.py (no logic change).
Changelog & Minor fixes
CHANGELOG.md, plugwise/smile.py, plugwise/legacy/smile.py
Add Changelog notes about prek migration, Biome removal, pymarkdown adoption; fix typo "succesful" → "successful" in docstrings.

Sequence Diagram(s)

(omitted — changes are configuration/tooling migrations without new multi-component runtime control flow)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

github_actions

Suggested reviewers

  • bouwew
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Chores (mainly migrating to prek)' accurately reflects the primary change in the changeset: a major migration from pre-commit to prek tooling, which is the dominant theme across workflow, configuration, and script files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch prek


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0901f89 and 371f99e.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • requirements_commit.txt
  • scripts/setup.sh
  • scripts/setup_test.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • requirements_commit.txt
  • CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Run mypy
🔇 Additional comments (2)
scripts/setup.sh (1)

22-23: LGTM!

The migration to prek install --install-hooks is correct, and the comment "Install prek/pre-commit hook" appropriately reflects the backward compatibility goal mentioned in the PR description. This helps contributors who may still be familiar with pre-commit terminology.

scripts/setup_test.sh (1)

24-27: LGTM!

The changes are consistent with scripts/setup.sh and correctly implement the prek migration. The conditional guard (if [ "$#" -eq 0 ]) appropriately prevents hook re-installation when the script is invoked from within prek/pre-commit, and the comment accurately describes this behavior while maintaining backward compatibility terminology.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In @.github/workflows/verify.yml:
- Around line 6-9: The workflow fails to define PREK_HOME while referencing `${{
env.PREK_HOME }}`; add a PREK_HOME entry to the top-level env block (alongside
CACHE_VERSION, DEFAULT_PYTHON, VENV) so the variable is populated for all steps
— e.g., set PREK_HOME to the intended workspace/root path used by the repo (such
as the repo root or a subdirectory), or to `${{ github.workspace }}` if
appropriate, ensuring all steps that reference PREK_HOME receive a non-empty
value.
- Around line 116-119: The workflow step labeled "Lint markdown files" is
invoking the wrong pre-commit hook id; change the hook id from "markdownlint" to
"pymarkdown" so it matches the hook defined in .pre-commit-config.yaml; update
the run command that calls prek to use --hook-stage manual pymarkdown (replacing
markdownlint) to ensure the correct hook runs.

In @.pymarkdown:
- Line 1: Rename the unrecognized configuration file `.pymarkdown` to a
supported pymarkdown config filename (e.g., `pymarkdown.json`,
`pymarkdown.yaml`, or `pymarkdown.toml`) and move the existing JSON content `{
"plugins": { "md013": { "enabled": false } } }` into that new file so pymarkdown
can detect and load the configuration; if you choose YAML or TOML, convert the
JSON to the appropriate syntax.
🧹 Nitpick comments (4)
scripts/manual_fixtures.py (1)

33-33: Consider using context managers for file operations.

Files are opened without context managers (with statement) and never explicitly closed. While the OS will clean up when the script exits, using context managers is a best practice that ensures proper resource cleanup.

♻️ Example refactor for line 33
-io = open(basefile)
-base = json.load(io)
+with open(basefile) as io:
+    base = json.load(io)

Apply similar changes to lines 51, 69, and 207.

Also applies to: 51-51, 69-69, 207-207

CHANGELOG.md (1)

6-9: LGTM! Minor wording suggestion.

The changelog entries clearly document the tooling changes. Consider changing "pythonesk" to "Python-based" for clarity, as "pythonesk" is non-standard spelling (the conventional form would be "Pythonesque", but "Python-based" is more commonly used in technical contexts).

scripts/setup_test.sh (1)

24-26: Comment still references "pre-commit".

The comment on line 24 mentions "pre-commit" but the tool has been migrated to prek. Consider updating the comment for consistency.

Suggested fix
-# Install prek hook unless running from within pre-commit
+# Install prek hook unless running from within prek
 if [ "$#" -eq 0 ]; then
   prek install --install-hooks
 fi
scripts/setup.sh (1)

22-23: Stale comment references old tool.

The comment on line 22 still says "Install pre-commit hook" but the command now uses prek. Update the comment for consistency with the migration.

Suggested fix
-# Install pre-commit hook
+# Install prek hook
 prek install --install-hooks
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b26e2b and e0f33d0.

📒 Files selected for processing (13)
  • .github/workflows/verify.yml
  • .markdownlint.yaml
  • .pre-commit-config.yaml
  • .pymarkdown
  • CHANGELOG.md
  • biome.json
  • plugwise/legacy/smile.py
  • plugwise/smile.py
  • requirements_commit.txt
  • scripts/manual_fixtures.py
  • scripts/setup.sh
  • scripts/setup_test.sh
  • scripts/tests_and_coverage.sh
💤 Files with no reviewable changes (2)
  • biome.json
  • .markdownlint.yaml
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-12-25T12:02:58.781Z
Learnt from: bouwew
Repo: plugwise/python-plugwise PR: 835
File: plugwise/helper.py:837-841
Timestamp: 2025-12-25T12:02:58.781Z
Learning: In the Python Plugwise library, zones are not separate appliances in gw_entities. When a zone is added to self.gw_entities, the location_id is used as the entity_id. In code reviews, validate that zone checks rely on location_id being present in _existing_zones and that lookups use self.gw_entities[location_id]. Do not treat zones as independent appliances.

Applied to files:

  • plugwise/smile.py
  • plugwise/legacy/smile.py
📚 Learning: 2024-11-28T19:54:45.351Z
Learnt from: CoMPaTech
Repo: plugwise/python-plugwise PR: 656
File: .pre-commit-config.yaml:9-9
Timestamp: 2024-11-28T19:54:45.351Z
Learning: The project's dependencies and pre-commit hooks (e.g., ruff at v0.8.0, bandit at 1.8.0, pyupgrade at v3.19.0) are confirmed to be compatible with Python 3.13.

Applied to files:

  • requirements_commit.txt
🪛 LanguageTool
CHANGELOG.md

[grammar] ~9-~9: Ensure spelling is correct
Context: ...ased markdownlint with pythonesk library ## v1.11.2 - Add/update model-data for Jip...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (7)
plugwise/legacy/smile.py (1)

222-231: LGTM!

Typo correction in the docstring looks good. This aligns with the PR objective of fixing typos reported by codespell.

plugwise/smile.py (1)

401-410: LGTM!

Consistent typo correction matching the fix in plugwise/legacy/smile.py. Documentation improvement looks good.

scripts/manual_fixtures.py (1)

39-44: LGTM! Formatting improvement aligns with tooling migration.

The multi-line formatting improves readability and is consistent with the PR's migration to prek/prettier.

requirements_commit.txt (1)

8-8: LGTM!

The dependency change from pre-commit to prek aligns with the PR's migration objective and is consistent with the script and workflow updates throughout the repository.

scripts/tests_and_coverage.sh (1)

48-49: LGTM!

The migration from pre-commit to prek install --install-hooks is consistent with the other script changes in this PR. The placement alongside dependency installation is appropriate.

.github/workflows/verify.yml (1)

47-55: Migration to prek looks good, but verify PREK_HOME definition.

The step naming and input changes from precommit-home to prek-home are consistent with the migration. Ensure the PREK_HOME environment variable is defined (see earlier comment).

.pre-commit-config.yaml (1)

114-118: Configuration is correct; args are optional.

The pymarkdown pre-commit hook works without additional args—the scan command runs by default. The args configuration is optional and only needed if you require custom settings like a non-default config file path.

Likely an incorrect or invalid review comment.

@codecov
Copy link

codecov bot commented Jan 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6b26e2b) to head (371f99e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #845   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         3443      3443           
=========================================
  Hits          3443      3443           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/verify.yml:
- Around line 6-9: The workflow sets no PREK_HOME in the env block but passes
the input prek-home: ${{ env.PREK_HOME }} into multiple actions (e.g.,
prepare-python-and-code@v2 and restore-venv@v2), which causes an empty string to
override the actions' defaults; remove the prek-home: ${{ env.PREK_HOME }} input
from all action usages (all seven instances where prek-home is present) so the
actions use their built-in PREK_HOME behavior instead.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e0f33d0 and 0901f89.

📒 Files selected for processing (1)
  • .github/workflows/verify.yml
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-12T16:49:05.347Z
Learnt from: CoMPaTech
Repo: plugwise/python-plugwise PR: 845
File: .github/workflows/verify.yml:6-9
Timestamp: 2026-01-12T16:49:05.347Z
Learning: In repositories using plugwise/python-plugwise conventions, PREK_HOME is already set by default by actions such as prepare-python-and-codev2 and restore-venvv2. Do not redefine PREK_HOME in workflow files that use these actions. This guidance applies to workflow files under .github/workflows in the repository (and can be extended to similar workflows that rely on these actions).

Applied to files:

  • .github/workflows/verify.yml
🔇 Additional comments (4)
.github/workflows/verify.yml (4)

39-39: Cache key still references .pre-commit-config.yaml.

The cache key hash includes .pre-commit-config.yaml. If prek uses a different configuration file, this should be updated to ensure cache invalidation when the prek config changes.

If .pre-commit-config.yaml is retained for backwards compatibility (as mentioned in the PR description), this is fine. Otherwise, consider updating to reference the prek configuration file.


47-55: Migration to v2 action looks consistent.

The step name and action version upgrade from v1 to v2 align with the prek migration. The prek-home input rename is appropriate, pending resolution of the undefined PREK_HOME issue noted above.


115-119: prek command migration looks correct.

The replacement of pre-commit run with prek run and the migration from markdownlint to pymarkdown align with the PR objectives. The command flags remain consistent with the previous pre-commit invocation style.


68-75: Consistent action version upgrades across all jobs.

All restore-venv action references have been consistently upgraded from v1 to v2, and the input has been renamed from precommit-home to prek-home throughout. This maintains consistency across the workflow.

Also applies to: 104-111, 139-147, 172-179, 217-224, 299-306

Copy link
Contributor

@bouwew bouwew left a comment

Choose a reason for hiding this comment

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

LGTM!

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 migrates the project from pre-commit to prek while maintaining backwards compatibility, simplifies the tooling by removing biome in favor of the reintroduced prettier, and migrates from node-based markdown linting to Python-based pymarkdown. The PR also fixes two spelling errors in code comments.

Changes:

  • Migrated from pre-commit to prek across scripts, requirements, and GitHub workflows
  • Removed biome formatter and related configuration
  • Switched from markdownlint (node-based) to pymarkdown (Python-based)
  • Fixed spelling typos in docstrings ("succesful" → "successful")
  • Updated GitHub Actions to v2 and bumped cache version

Reviewed changes

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

Show a summary per file
File Description
scripts/tests_and_coverage.sh Removed biome formatting calls and updated to use prek install
scripts/setup_test.sh Removed biome setup logic and updated to use prek install
scripts/setup.sh Updated pre-commit install to prek install
scripts/manual_fixtures.py Reformatted long dictionary access lines for better readability
requirements_commit.txt Replaced pre-commit with prek dependency
plugwise/smile.py Fixed typo: "succesful" → "successful" in docstring
plugwise/legacy/smile.py Fixed typo: "succesful" → "successful" in docstring
biome.json Removed biome configuration file
CHANGELOG.md Added changelog entry for these changes
.pymarkdown Added pymarkdown configuration disabling line length rule
.pre-commit-config.yaml Removed biome hook and setup_test hook, replaced markdownlint with pymarkdown
.markdownlint.yaml Removed old markdownlint configuration
.github/workflows/verify.yml Updated to use GitHub Actions v2, prek instead of pre-commit, removed biome lint step, bumped cache version

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

@sonarqubecloud
Copy link

@coderabbitai coderabbitai bot requested a review from bouwew January 14, 2026 16:24
@coderabbitai coderabbitai bot added the github_actions Pull requests that update Github_actions code label Jan 14, 2026
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement New feature or request github_actions Pull requests that update Github_actions code pre-commit quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants