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 GitHub Actions v2, bumped cache version, and replaced pre-commit with prek across workflows and scripts.
    • Switched markdown linting to a Python-based linter (pymarkdown) and removed the previous node-based tool and biome formatter.
    • Adjusted setup and test scripts to use prek install-hooks.
  • Bug Fixes

    • Corrected 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

Walkthrough

Migrate CI/hooks from pre-commit to prek, replace node-based markdownlint with jackdewinter/pymarkdown, remove Biome formatter, update scripts and requirements, and bump GitHub Actions inputs/versions and cache version across workflows and related files.

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 and replace pre-commit invocations/usages with prek and prek-specific inputs
Linting & Hooks Config
.pre-commit-config.yaml, .pymarkdown, .markdownlint.yaml
Remove setup_test and biome hooks; switch markdown hook from igorshubovych/markdownlint-cli to jackdewinter/pymarkdown (rev v0.9.34); add .pymarkdown disabling md013; remove explicit defaults in .markdownlint.yaml
Scripts (setup & CI helpers)
scripts/setup.sh, scripts/setup_test.sh, scripts/tests_and_coverage.sh
Replace pre-commit install with prek install --install-hooks; remove biome_format() and biome CLI/install blocks; adjust comments and related calls
Dependencies
requirements_commit.txt
Replace pre-commit entry with prek
Formatter & Biome config
biome.json, scripts/manual_fixtures.py
Remove maxSize from biome.json; formatting-only rewrap in manual_fixtures.py (no logic change)
Changelog & Minor fixes
CHANGELOG.md, plugwise/smile.py, plugwise/legacy/smile.py
Add Changelog chores for prek migration, Biome removal, pymarkdown adoption; fix "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 reviewers

  • bouwew

Poem

🐰 I hopped through CI, swapped pre-commit to prek,
Biome waved goodbye, Python lint finds its way,
Actions bumped to v2, caches tucked in neat,
Hooks now installed with a lighter beat,
Rabbit claps for cleaner CI play! 🎉

🚥 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)' directly summarizes the primary objective of the pull request, which is migrating the pre-commit tooling to prek.

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

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

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.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 12, 2026

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@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 (0901f89).

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!

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 pre-commit quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants