Skip to content

Commit 93d8f1c

Browse files
committed
chore: set up husky hooks and fix broken link
- Add husky, commitlint, and markdownlint configuration - Create pre-commit hook for Python (ruff) and markdown linting - Create commit-msg hook for commit message validation - Add ruff configuration to pyproject.toml - Fix broken link in hero button (use-case-tree.md -> use-case-tree/) - Only lint staged files to avoid blocking on existing violations
1 parent 6053918 commit 93d8f1c

File tree

9 files changed

+1608
-1
lines changed

9 files changed

+1608
-1
lines changed

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm exec commitlint --edit $1

.husky/pre-commit

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Run Python linting if Python files exist and ruff is available
2+
if find . -name "*.py" -not -path "./.venv/*" -not -path "./site/*" | grep -q .; then
3+
if command -v uv >/dev/null 2>&1 && uv run ruff --version >/dev/null 2>&1; then
4+
uv run ruff check . || exit 1
5+
uv run ruff format --check . || exit 1
6+
fi
7+
fi
8+
9+
# Run markdown linting
10+
pnpm lint:md || exit 1

commitlint.config.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/** @type {import('@commitlint/types').UserConfig} */
2+
const config = {
3+
extends: ["@commitlint/config-angular"],
4+
rules: {
5+
// Angular style: stricter rules
6+
"subject-case": [
7+
2,
8+
"never",
9+
["start-case", "pascal-case", "upper-case"],
10+
],
11+
"subject-empty": [2, "never"],
12+
"subject-full-stop": [2, "never", "."],
13+
"type-case": [2, "always", "lower-case"],
14+
"type-empty": [2, "never"],
15+
"scope-case": [2, "always", "lower-case"],
16+
},
17+
};
18+
19+
module.exports = config;

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Deliver strategic business value and agility through connected
2525
enterprise knowledge — one use case at a time.
2626

2727
<div class="hero-buttons">
28-
<a href="concept/use-case-tree.md" class="md-button md-button--primary">Explore the Use Case Tree</a>
28+
<a href="concept/use-case-tree/" class="md-button md-button--primary">Explore the Use Case Tree</a>
2929
<a href="https://catalog.ekgf.org/" class="md-button">Browse example use cases</a>
3030
</div>
3131

ekg-method.code-workspace

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@
55
},
66
{
77
"path": "../ekg-catalog"
8+
},
9+
{
10+
"path": "../ekg-maturity"
11+
},
12+
{
13+
"path": "../ekg-principles"
14+
},
15+
{
16+
"path": "../ekgf-website"
17+
},
18+
{
19+
"path": "../business-composer"
20+
},
21+
{
22+
"path": "../agnos-website"
823
}
924
],
1025
"settings": {

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
{
2+
"scripts": {
3+
"prepare": "husky",
4+
"lint": "uv run ruff check . && uv run ruff format --check .",
5+
"lint:md": "markdownlint '**/*.md' --ignore node_modules --ignore .husky --ignore site"
6+
},
27
"devDependencies": {
8+
"@commitlint/cli": "^20.3.0",
9+
"@commitlint/config-angular": "^20.3.0",
10+
"@commitlint/config-conventional": "^20.3.0",
11+
"husky": "^9.1.7",
12+
"markdownlint-cli": "^0.47.0",
313
"prettier": "^3.7.4"
414
}
515
}

0 commit comments

Comments
 (0)