Fix pre-commit #18

Merged
k.marinus merged 4 commits from build/fix-pre-commit into dev 2025-11-02 19:56:31 +00:00
k.marinus commented 2025-11-02 17:52:38 +00:00 (Migrated from git.science.uu.nl)

Moved the git hooks into shell scripts and placed them into the pre-commit configuration. Also extended robustness of the hooks.

The shell scripts were written with the help of AI.

To install the hooks, run the following commands:

uv run pre-commit install
uv run pre-commit install --hook-type commit-msg

You might get an error along the lines of Can't install pre-commit with core.hooksPath set. To fix this, simply unset the hooksPath by running:

git config --local --unset core.hooksPath

To verify correctness of the changes, make sure the following are true:

  • Able to install hooks
  • When attempting to commit with incorrect branch name, the commit aborts
    • Incorrect type
    • No slash after type
    • Incorrect description
      • Not separated by dashes
      • Longer than six words
  • When attempting to commit with incorrect commit message, the commit aborts
    • Incorrect title
      • Incorrect type
      • No colon after type
    • Incorrect footer (no ref/close)
  • When attempting to commit with correct branch name and commit message, the commit succeeds

ref: N25B-241

Moved the git hooks into shell scripts and placed them into the pre-commit configuration. Also extended robustness of the hooks. The shell scripts were written with the help of AI. To install the hooks, run the following commands: ```sh uv run pre-commit install uv run pre-commit install --hook-type commit-msg ``` You might get an error along the lines of `Can't install pre-commit with core.hooksPath set`. To fix this, simply unset the `hooksPath` by running: ```sh git config --local --unset core.hooksPath ``` To verify correctness of the changes, make sure the following are true: * [x] Able to install hooks * [x] When attempting to commit with incorrect branch name, the commit aborts * [x] Incorrect type * [x] No slash after type * [x] Incorrect description * [x] Not separated by dashes * [x] Longer than six words * [x] When attempting to commit with incorrect commit message, the commit aborts * [x] Incorrect title * [x] Incorrect type * [x] No colon after type * [x] Incorrect footer (no ref/close) * [x] When attempting to commit with correct branch name and commit message, the commit succeeds ref: N25B-241
k.marinus commented 2025-11-02 17:52:55 +00:00 (Migrated from git.science.uu.nl)

changed title from build: fix pre-commit to Fix pre-commit

<p>changed title from <code class="idiff"><span class="idiff left right deletion">build: f</span>ix pre-commit</code> to <code class="idiff"><span class="idiff left right addition">F</span>ix pre-commit</code></p>
k.marinus commented 2025-11-02 18:00:35 +00:00 (Migrated from git.science.uu.nl)

changed the description

changed the description
0950726 commented 2025-11-02 19:25:40 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Able to install hooks as completed

marked the checklist item **Able to install hooks** as completed
0950726 commented 2025-11-02 19:26:05 +00:00 (Migrated from git.science.uu.nl)

added 3 commits

  • e5782b42...53d36dec - 2 commits from branch dev
  • 460dc5dc - Merge remote-tracking branch 'origin/dev' into build/fix-pre-commit

Compare with previous version

added 3 commits <ul><li>e5782b42...53d36dec - 2 commits from branch <code>dev</code></li><li>460dc5dc - Merge remote-tracking branch &#39;origin/dev&#39; into build/fix-pre-commit</li></ul> [Compare with previous version](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/18/diffs?diff_id=133214&start_sha=e5782b421f9f3be32074cb9ca09528cc8dfa49f8)
0950726 commented 2025-11-02 19:33:18 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Incorrect type as completed

marked the checklist item **Incorrect type** as completed
0950726 commented 2025-11-02 19:33:22 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Incorrect type as incomplete

marked the checklist item **Incorrect type** as incomplete
0950726 commented 2025-11-02 19:33:33 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Incorrect type as completed

marked the checklist item **Incorrect type** as completed
0950726 commented 2025-11-02 19:38:33 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Incorrect type as completed

marked the checklist item **Incorrect type** as completed
0950726 commented 2025-11-02 19:39:11 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item No colon after type as completed

marked the checklist item **No colon after type** as completed
0950726 commented 2025-11-02 19:39:12 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Incorrect title as completed

marked the checklist item **Incorrect title** as completed
0950726 commented 2025-11-02 19:39:14 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Incorrect footer (no ref/close) as completed

marked the checklist item **Incorrect footer (no ref/close)** as completed
0950726 commented 2025-11-02 19:39:19 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item When attempting to commit with incorrect commit message, the commit aborts as completed

marked the checklist item **When attempting to commit with incorrect commit message, the commit aborts** as completed
0950726 commented 2025-11-02 19:40:37 +00:00 (Migrated from git.science.uu.nl)

added 1 commit

  • e5bf6fd1 - docs: update README instructions for git hooks

Compare with previous version

added 1 commit <ul><li>e5bf6fd1 - docs: update README instructions for git hooks</li></ul> [Compare with previous version](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/18/diffs?diff_id=133216&start_sha=460dc5dce85646c93e822271738fe139b35e65e4)
0950726 commented 2025-11-02 19:43:10 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item No slash after type as completed

marked the checklist item **No slash after type** as completed
0950726 commented 2025-11-02 19:43:14 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Longer than six words as completed

marked the checklist item **Longer than six words** as completed
0950726 commented 2025-11-02 19:49:11 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Not separated by dashes as completed

marked the checklist item **Not separated by dashes** as completed
0950726 commented 2025-11-02 19:49:11 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item Incorrect description as completed

marked the checklist item **Incorrect description** as completed
0950726 commented 2025-11-02 19:49:12 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item When attempting to commit with incorrect branch name, the commit aborts as completed

marked the checklist item **When attempting to commit with incorrect branch name, the commit aborts** as completed
0950726 commented 2025-11-02 19:49:14 +00:00 (Migrated from git.science.uu.nl)

marked the checklist item When attempting to commit with correct branch name and commit message, the commit succeeds as completed

marked the checklist item **When attempting to commit with correct branch name and commit message, the commit succeeds** as completed
0950726 commented 2025-11-02 19:54:43 +00:00 (Migrated from git.science.uu.nl)

added 1 commit

  • e025b146 - docs: add suggested fix for potential issue

Compare with previous version

added 1 commit <ul><li>e025b146 - docs: add suggested fix for potential issue</li></ul> [Compare with previous version](/ics/sp/2025/n25b/pepperplus-cb/-/merge_requests/18/diffs?diff_id=133218&start_sha=e5bf6fd1ccb95d8ad97820b2199193c0bec0e344)
0950726 commented 2025-11-02 19:56:31 +00:00 (Migrated from git.science.uu.nl)

mentioned in commit c6edad0bb4

mentioned in commit c6edad0bb4c6cc125f838374bd91a8b66d45d3c4
0950726 (Migrated from git.science.uu.nl) merged commit c6edad0bb4 into dev 2025-11-02 19:56:31 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: pepperplus/pepperplus-cb#18