@hivehub/rulebook 5.4.0 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/LICENSE +191 -191
  2. package/README.md +1 -0
  3. package/dist/core/generator.d.ts +1 -1
  4. package/dist/core/generator.d.ts.map +1 -1
  5. package/dist/core/generator.js +1 -0
  6. package/dist/core/generator.js.map +1 -1
  7. package/package.json +1 -1
  8. package/templates/cli/gemini-extension.json +77 -77
  9. package/templates/core/AGENTS_LEAN.md +9 -0
  10. package/templates/core/CLAUDE_MD_v2.md +9 -0
  11. package/templates/core/WORKSPACE.md +69 -69
  12. package/templates/skills/core/karpathy-guidelines/SKILL.md +93 -0
  13. package/templates/workflows/codespell.yml +31 -31
  14. package/templates/workflows/cpp-lint.yml +47 -47
  15. package/templates/workflows/cpp-publish.yml +119 -119
  16. package/templates/workflows/cpp-test.yml +77 -77
  17. package/templates/workflows/dotnet-lint.yml +29 -29
  18. package/templates/workflows/dotnet-publish.yml +40 -40
  19. package/templates/workflows/dotnet-test.yml +41 -41
  20. package/templates/workflows/elixir-lint.yml +45 -45
  21. package/templates/workflows/elixir-publish.yml +49 -49
  22. package/templates/workflows/elixir-test.yml +54 -54
  23. package/templates/workflows/erlang-lint.yml +47 -47
  24. package/templates/workflows/erlang-test.yml +62 -62
  25. package/templates/workflows/go-lint.yml +39 -39
  26. package/templates/workflows/go-publish.yml +95 -95
  27. package/templates/workflows/go-test.yml +59 -59
  28. package/templates/workflows/java-lint.yml +60 -60
  29. package/templates/workflows/java-publish.yml +120 -120
  30. package/templates/workflows/java-test.yml +85 -85
  31. package/templates/workflows/kotlin-lint.yml +34 -34
  32. package/templates/workflows/kotlin-publish.yml +56 -56
  33. package/templates/workflows/kotlin-test.yml +48 -48
  34. package/templates/workflows/php-lint.yml +39 -39
  35. package/templates/workflows/php-publish.yml +50 -50
  36. package/templates/workflows/php-test.yml +54 -54
  37. package/templates/workflows/python-lint.yml +47 -47
  38. package/templates/workflows/python-publish.yml +91 -91
  39. package/templates/workflows/python-test.yml +59 -59
  40. package/templates/workflows/rust-lint.yml +54 -54
  41. package/templates/workflows/rust-publish.yml +66 -66
  42. package/templates/workflows/rust-test.yml +75 -75
  43. package/templates/workflows/solidity-lint.yml +41 -41
  44. package/templates/workflows/solidity-test.yml +47 -47
  45. package/templates/workflows/swift-lint.yml +32 -32
  46. package/templates/workflows/swift-publish.yml +58 -58
  47. package/templates/workflows/swift-test.yml +44 -44
  48. package/templates/workflows/typescript-publish.yml +60 -60
  49. package/templates/workflows/typescript-test.yml +73 -73
  50. package/templates/workflows/zig-lint.yml +27 -27
  51. package/templates/workflows/zig-test.yml +40 -40
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hivehub/rulebook",
3
- "version": "5.4.0",
3
+ "version": "5.5.0",
4
4
  "description": "Tool-agnostic AI development framework. Standardize projects across Claude Code, Cursor, Gemini, Codex, Windsurf, Copilot with automated templates, quality gates, persistent memory, and framework detection for 28 languages, 17 frameworks, 13 MCP modules, and 20 services",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,77 +1,77 @@
1
- {
2
- "$schema": "https://ai.google.dev/schemas/gemini-extension.json",
3
- "name": "rulebook",
4
- "displayName": "Rulebook Project Standards",
5
- "version": "2.0.0",
6
- "description": "Standardize AI-generated projects with skills, templates, and quality gates",
7
- "author": "HiveLLM",
8
- "license": "Apache-2.0",
9
- "capabilities": {
10
- "codeGeneration": true,
11
- "taskManagement": true,
12
- "projectValidation": true,
13
- "skillsSystem": true
14
- },
15
- "commands": {
16
- "init": {
17
- "description": "Initialize rulebook for current project",
18
- "command": "rulebook init --yes"
19
- },
20
- "update": {
21
- "description": "Update project rules to latest version",
22
- "command": "rulebook update --yes"
23
- },
24
- "validate": {
25
- "description": "Validate project structure",
26
- "command": "rulebook validate"
27
- },
28
- "health": {
29
- "description": "Check project health score",
30
- "command": "rulebook health"
31
- },
32
- "fix": {
33
- "description": "Auto-fix common issues",
34
- "command": "rulebook fix"
35
- },
36
- "skill-list": {
37
- "description": "List available skills",
38
- "command": "rulebook skill list"
39
- },
40
- "skill-add": {
41
- "description": "Add a skill",
42
- "command": "rulebook skill add"
43
- },
44
- "task-create": {
45
- "description": "Create a new task",
46
- "command": "rulebook task create"
47
- },
48
- "task-list": {
49
- "description": "List all tasks",
50
- "command": "rulebook task list"
51
- }
52
- },
53
- "files": {
54
- "instructions": "GEMINI.md",
55
- "agents": "AGENTS.md",
56
- "config": ".rulebook",
57
- "rules": "rulebook/"
58
- },
59
- "integration": {
60
- "type": "cli",
61
- "install": "npm install -g @hivehub/rulebook",
62
- "mcp": {
63
- "enabled": true,
64
- "server": "rulebook-mcp"
65
- }
66
- },
67
- "skills": {
68
- "enabled": true,
69
- "categories": [
70
- "languages",
71
- "frameworks",
72
- "modules",
73
- "services",
74
- "core"
75
- ]
76
- }
77
- }
1
+ {
2
+ "$schema": "https://ai.google.dev/schemas/gemini-extension.json",
3
+ "name": "rulebook",
4
+ "displayName": "Rulebook Project Standards",
5
+ "version": "2.0.0",
6
+ "description": "Standardize AI-generated projects with skills, templates, and quality gates",
7
+ "author": "HiveLLM",
8
+ "license": "Apache-2.0",
9
+ "capabilities": {
10
+ "codeGeneration": true,
11
+ "taskManagement": true,
12
+ "projectValidation": true,
13
+ "skillsSystem": true
14
+ },
15
+ "commands": {
16
+ "init": {
17
+ "description": "Initialize rulebook for current project",
18
+ "command": "rulebook init --yes"
19
+ },
20
+ "update": {
21
+ "description": "Update project rules to latest version",
22
+ "command": "rulebook update --yes"
23
+ },
24
+ "validate": {
25
+ "description": "Validate project structure",
26
+ "command": "rulebook validate"
27
+ },
28
+ "health": {
29
+ "description": "Check project health score",
30
+ "command": "rulebook health"
31
+ },
32
+ "fix": {
33
+ "description": "Auto-fix common issues",
34
+ "command": "rulebook fix"
35
+ },
36
+ "skill-list": {
37
+ "description": "List available skills",
38
+ "command": "rulebook skill list"
39
+ },
40
+ "skill-add": {
41
+ "description": "Add a skill",
42
+ "command": "rulebook skill add"
43
+ },
44
+ "task-create": {
45
+ "description": "Create a new task",
46
+ "command": "rulebook task create"
47
+ },
48
+ "task-list": {
49
+ "description": "List all tasks",
50
+ "command": "rulebook task list"
51
+ }
52
+ },
53
+ "files": {
54
+ "instructions": "GEMINI.md",
55
+ "agents": "AGENTS.md",
56
+ "config": ".rulebook",
57
+ "rules": "rulebook/"
58
+ },
59
+ "integration": {
60
+ "type": "cli",
61
+ "install": "npm install -g @hivehub/rulebook",
62
+ "mcp": {
63
+ "enabled": true,
64
+ "server": "rulebook-mcp"
65
+ }
66
+ },
67
+ "skills": {
68
+ "enabled": true,
69
+ "categories": [
70
+ "languages",
71
+ "frameworks",
72
+ "modules",
73
+ "services",
74
+ "core"
75
+ ]
76
+ }
77
+ }
@@ -16,6 +16,15 @@ These override everything else. Violation = output rejected.
16
16
  7. **Follow task sequence.** Execute `tasks.md` items in the EXACT order listed. No reordering, no cherry-picking, no starting Phase N+1 before Phase N is 100% done. The list is an ORDER, not a MENU.
17
17
  8. **Execute the full task in one turn.** Never stop mid-task to ask "should I proceed?" or "want me to also...?". Make autonomous decisions within scope. Only ask for genuine ambiguity, destructive ops, or impossible tasks.
18
18
 
19
+ ## Editing Discipline (Karpathy-inspired)
20
+
21
+ Behavioral guidelines that reduce common LLM coding mistakes. Adapted from [forrestchang/andrej-karpathy-skills](https://github.com/forrestchang/andrej-karpathy-skills), grounded in [Andrej Karpathy's observations](https://x.com/karpathy/status/2015883857489522876).
22
+
23
+ 1. **Think before coding.** State assumptions explicitly. If multiple interpretations exist, present them — don't pick silently. If a simpler approach exists, say so. If something is unclear, stop and ask. Don't hide confusion.
24
+ 2. **Simplicity first.** Minimum code that solves the problem. No features beyond what was asked, no abstractions for single-use code, no "flexibility" that wasn't requested, no error handling for impossible scenarios. If you write 200 lines and 50 would do, rewrite.
25
+ 3. **Surgical changes.** Touch only what you must. Don't "improve" adjacent code, comments, or formatting. Don't refactor things that aren't broken. Match existing style. If you notice unrelated dead code, mention it — don't delete it. Every changed line must trace directly to the user's request.
26
+ 4. **Goal-driven execution.** Define verifiable success criteria upfront. "Add validation" → "write tests for invalid inputs, then make them pass." For multi-step tasks, state a brief plan: `[step] → verify: [check]`. Strong criteria let you loop independently; weak criteria require constant clarification.
27
+
19
28
  ## Critical Rules
20
29
 
21
30
  - **ALWAYS read `/.rulebook/specs/RULEBOOK.md`** before creating tasks.
@@ -31,6 +31,15 @@ automatically at session start (see [Anthropic memory docs](https://code.claude.
31
31
  7. **Capture learnings**: at the end of significant work, save patterns and anti-patterns to `.rulebook/knowledge/` and insights to `.rulebook/learnings/`.
32
32
  8. **Never archive a task** without docs updated, tests written, and tests passing — the task tail enforces this structurally.
33
33
 
34
+ ## Editing discipline (Karpathy-inspired)
35
+
36
+ Behavioral guidelines that reduce common LLM coding mistakes. Adapted from [forrestchang/andrej-karpathy-skills](https://github.com/forrestchang/andrej-karpathy-skills), grounded in [Andrej Karpathy's observations](https://x.com/karpathy/status/2015883857489522876).
37
+
38
+ 1. **Think before coding.** State assumptions explicitly. If multiple interpretations exist, present them — don't pick silently. If a simpler approach exists, say so. If something is unclear, stop and ask. Don't hide confusion.
39
+ 2. **Simplicity first.** Minimum code that solves the problem. No features beyond what was asked, no abstractions for single-use code, no "flexibility" that wasn't requested, no error handling for impossible scenarios. If you write 200 lines and 50 would do, rewrite.
40
+ 3. **Surgical changes.** Touch only what you must. Don't "improve" adjacent code, comments, or formatting. Don't refactor things that aren't broken. Match existing style. If you notice unrelated dead code, mention it — don't delete it. Every changed line must trace directly to the user's request.
41
+ 4. **Goal-driven execution.** Define verifiable success criteria upfront. "Add validation" → "write tests for invalid inputs, then make them pass." For multi-step tasks, state a brief plan: `[step] → verify: [check]`. Strong criteria let you loop independently; weak criteria require constant clarification.
42
+
34
43
  ## Persistent memory
35
44
 
36
45
  This project uses the Rulebook MCP server for persistent memory across sessions.
@@ -1,69 +1,69 @@
1
- <!-- RULEBOOK:START -->
2
- # Workspace Mode
3
-
4
- **This project is part of a multi-project workspace managed by Rulebook.**
5
-
6
- ## CRITICAL: Project Routing
7
-
8
- When calling ANY Rulebook MCP tool, you MUST pass the `projectId` parameter to target the correct project.
9
-
10
- ### How to determine the current project
11
-
12
- 1. **Check which files you are editing** — the file path tells you which project you are in
13
- 2. **Use `rulebook_workspace_list`** to see all available projects and their paths
14
- 3. **Match the file path to a project path** to determine the `projectId`
15
-
16
- ### Examples
17
-
18
- ```
19
- # You are editing files in /path/to/frontend/src/App.tsx
20
- # → projectId = "frontend"
21
-
22
- rulebook_task_create({ taskId: "add-auth", projectId: "frontend" })
23
- rulebook_task_list({ projectId: "frontend" })
24
- rulebook_memory_save({ ..., projectId: "frontend" })
25
- rulebook_memory_search({ query: "auth", projectId: "frontend" })
26
- ```
27
-
28
- ### Cross-project operations
29
-
30
- Use these dedicated workspace tools for operations across ALL projects:
31
-
32
- - `rulebook_workspace_list` — List all projects in the workspace
33
- - `rulebook_workspace_status` — Status of each project (active workers, task count)
34
- - `rulebook_workspace_search` — Search memory across ALL projects at once
35
- - `rulebook_workspace_tasks` — List tasks from ALL projects at once
36
-
37
- ### Default project
38
-
39
- If you omit `projectId`, the **default project** is used: `{{DEFAULT_PROJECT}}`.
40
- Only omit `projectId` when you are certain the operation targets the default project.
41
-
42
- ## Workspace Projects
43
-
44
- {{WORKSPACE_PROJECTS}}
45
-
46
- ## Rules
47
-
48
- 1. **NEVER save memory to the wrong project** — always verify `projectId` before calling `rulebook_memory_save`
49
- 2. **NEVER create tasks in the wrong project** — check which project the feature belongs to
50
- 3. **When working across projects** (e.g., shared types), save memory to BOTH relevant projects
51
- 4. **Use `rulebook_workspace_search`** to find related context across all projects before starting work
52
- 5. **Each project has its own `.rulebook/`** directory — configs, tasks, and memory are fully isolated
53
-
54
- ## CLI Commands
55
-
56
- ```bash
57
- # List tasks from a specific project
58
- rulebook task list --project frontend
59
-
60
- # List tasks from ALL projects
61
- rulebook task list --all-projects
62
-
63
- # Create task in specific project
64
- rulebook task create my-task --project backend
65
-
66
- # Update all projects at once
67
- rulebook update
68
- ```
69
- <!-- RULEBOOK:END -->
1
+ <!-- RULEBOOK:START -->
2
+ # Workspace Mode
3
+
4
+ **This project is part of a multi-project workspace managed by Rulebook.**
5
+
6
+ ## CRITICAL: Project Routing
7
+
8
+ When calling ANY Rulebook MCP tool, you MUST pass the `projectId` parameter to target the correct project.
9
+
10
+ ### How to determine the current project
11
+
12
+ 1. **Check which files you are editing** — the file path tells you which project you are in
13
+ 2. **Use `rulebook_workspace_list`** to see all available projects and their paths
14
+ 3. **Match the file path to a project path** to determine the `projectId`
15
+
16
+ ### Examples
17
+
18
+ ```
19
+ # You are editing files in /path/to/frontend/src/App.tsx
20
+ # → projectId = "frontend"
21
+
22
+ rulebook_task_create({ taskId: "add-auth", projectId: "frontend" })
23
+ rulebook_task_list({ projectId: "frontend" })
24
+ rulebook_memory_save({ ..., projectId: "frontend" })
25
+ rulebook_memory_search({ query: "auth", projectId: "frontend" })
26
+ ```
27
+
28
+ ### Cross-project operations
29
+
30
+ Use these dedicated workspace tools for operations across ALL projects:
31
+
32
+ - `rulebook_workspace_list` — List all projects in the workspace
33
+ - `rulebook_workspace_status` — Status of each project (active workers, task count)
34
+ - `rulebook_workspace_search` — Search memory across ALL projects at once
35
+ - `rulebook_workspace_tasks` — List tasks from ALL projects at once
36
+
37
+ ### Default project
38
+
39
+ If you omit `projectId`, the **default project** is used: `{{DEFAULT_PROJECT}}`.
40
+ Only omit `projectId` when you are certain the operation targets the default project.
41
+
42
+ ## Workspace Projects
43
+
44
+ {{WORKSPACE_PROJECTS}}
45
+
46
+ ## Rules
47
+
48
+ 1. **NEVER save memory to the wrong project** — always verify `projectId` before calling `rulebook_memory_save`
49
+ 2. **NEVER create tasks in the wrong project** — check which project the feature belongs to
50
+ 3. **When working across projects** (e.g., shared types), save memory to BOTH relevant projects
51
+ 4. **Use `rulebook_workspace_search`** to find related context across all projects before starting work
52
+ 5. **Each project has its own `.rulebook/`** directory — configs, tasks, and memory are fully isolated
53
+
54
+ ## CLI Commands
55
+
56
+ ```bash
57
+ # List tasks from a specific project
58
+ rulebook task list --project frontend
59
+
60
+ # List tasks from ALL projects
61
+ rulebook task list --all-projects
62
+
63
+ # Create task in specific project
64
+ rulebook task create my-task --project backend
65
+
66
+ # Update all projects at once
67
+ rulebook update
68
+ ```
69
+ <!-- RULEBOOK:END -->
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: "Karpathy Guidelines"
3
+ description: "Behavioral guidelines to reduce common LLM coding mistakes — overcomplication, sloppy refactors, hidden assumptions, weak goals. Use when writing, reviewing, or refactoring code. Auto-applies; invoke explicitly via /karpathy-guidelines or 'follow karpathy discipline'."
4
+ version: "1.0.0"
5
+ category: "core"
6
+ author: "Andrej Karpathy (originator) / forrestchang (skill packaging) / Rulebook (Rulebook adaptation)"
7
+ tags: ["core", "discipline", "quality"]
8
+ dependencies: []
9
+ conflicts: []
10
+ license: "MIT"
11
+ upstream: "https://github.com/forrestchang/andrej-karpathy-skills"
12
+ source: "https://x.com/karpathy/status/2015883857489522876"
13
+ ---
14
+ <!-- KARPATHY_GUIDELINES:START -->
15
+ # Karpathy Guidelines
16
+
17
+ Behavioral guidelines to reduce common LLM coding mistakes, derived from [Andrej Karpathy's observations](https://x.com/karpathy/status/2015883857489522876) on LLM coding pitfalls.
18
+
19
+ **Tradeoff:** these guidelines bias toward caution over speed. For trivial tasks, use judgment.
20
+
21
+ ## 1. Think Before Coding
22
+
23
+ **Don't assume. Don't hide confusion. Surface tradeoffs.**
24
+
25
+ Before implementing:
26
+
27
+ - State your assumptions explicitly. If uncertain, ask.
28
+ - If multiple interpretations exist, present them — don't pick silently.
29
+ - If a simpler approach exists, say so. Push back when warranted.
30
+ - If something is unclear, stop. Name what's confusing. Ask.
31
+
32
+ ## 2. Simplicity First
33
+
34
+ **Minimum code that solves the problem. Nothing speculative.**
35
+
36
+ - No features beyond what was asked.
37
+ - No abstractions for single-use code.
38
+ - No "flexibility" or "configurability" that wasn't requested.
39
+ - No error handling for impossible scenarios.
40
+ - If you write 200 lines and it could be 50, rewrite it.
41
+
42
+ Ask yourself: "would a senior engineer say this is overcomplicated?" If yes, simplify.
43
+
44
+ ## 3. Surgical Changes
45
+
46
+ **Touch only what you must. Clean up only your own mess.**
47
+
48
+ When editing existing code:
49
+
50
+ - Don't "improve" adjacent code, comments, or formatting.
51
+ - Don't refactor things that aren't broken.
52
+ - Match existing style, even if you'd do it differently.
53
+ - If you notice unrelated dead code, mention it — don't delete it.
54
+
55
+ When your changes create orphans:
56
+
57
+ - Remove imports/variables/functions that YOUR changes made unused.
58
+ - Don't remove pre-existing dead code unless asked.
59
+
60
+ The test: every changed line should trace directly to the user's request.
61
+
62
+ ## 4. Goal-Driven Execution
63
+
64
+ **Define success criteria. Loop until verified.**
65
+
66
+ Transform tasks into verifiable goals:
67
+
68
+ - "Add validation" → "write tests for invalid inputs, then make them pass."
69
+ - "Fix the bug" → "write a test that reproduces it, then make it pass."
70
+ - "Refactor X" → "ensure tests pass before and after."
71
+
72
+ For multi-step tasks, state a brief plan:
73
+
74
+ ```
75
+ 1. [Step] → verify: [check]
76
+ 2. [Step] → verify: [check]
77
+ 3. [Step] → verify: [check]
78
+ ```
79
+
80
+ Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
81
+
82
+ ## Interaction with Rulebook
83
+
84
+ This skill complements existing Rulebook rules:
85
+
86
+ - `no-shortcuts.md` forbids stubs/TODOs; **Simplicity First** forbids the opposite — bloat.
87
+ - `research-first.md` requires investigating unknowns; **Think Before Coding** adds *surfacing* what was investigated.
88
+ - `incremental-implementation.md` tests each step; **Goal-Driven Execution** adds defining the test up front.
89
+ - **Surgical Changes** has no Rulebook counterpart and fills a real gap: no rule today forbids opportunistic refactor of adjacent code.
90
+
91
+ Skill body is deliberately small (≤80 lines) so it adds < 1KB to the context budget per session.
92
+
93
+ <!-- KARPATHY_GUIDELINES:END -->
@@ -1,31 +1,31 @@
1
- name: Codespell
2
-
3
- on:
4
- push:
5
- branches: [ master, main, develop ]
6
- pull_request:
7
- branches: [ master, main, develop ]
8
-
9
- permissions:
10
- contents: read
11
-
12
- jobs:
13
- codespell:
14
- name: Check for spelling errors
15
- runs-on: ubuntu-latest
16
-
17
- steps:
18
- - name: Checkout
19
- uses: actions/checkout@v5
20
-
21
- - name: Install Codespell
22
- run: python -m pip install --upgrade 'codespell[toml]'
23
-
24
- - name: Run Codespell
25
- run: |
26
- codespell \
27
- --skip="*.lock,*.json,*.map,*.yaml,*.yml,*.csv,*.bib,target,node_modules,.git,dist,venv,build,benchmarks,coverage" \
28
- --ignore-words-list="crate,ser,deser,upToDate,optIn,shouldBe,Bloc"
29
- # MONOREPO NOTE: Add multilingual stopwords to ignore-words-list if needed
30
- # Example: --ignore-words-list="crate,ser,deser,meu,oder,ist,alle" (Portuguese,German,etc)
31
-
1
+ name: Codespell
2
+
3
+ on:
4
+ push:
5
+ branches: [ master, main, develop ]
6
+ pull_request:
7
+ branches: [ master, main, develop ]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ codespell:
14
+ name: Check for spelling errors
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - name: Checkout
19
+ uses: actions/checkout@v5
20
+
21
+ - name: Install Codespell
22
+ run: python -m pip install --upgrade 'codespell[toml]'
23
+
24
+ - name: Run Codespell
25
+ run: |
26
+ codespell \
27
+ --skip="*.lock,*.json,*.map,*.yaml,*.yml,*.csv,*.bib,target,node_modules,.git,dist,venv,build,benchmarks,coverage" \
28
+ --ignore-words-list="crate,ser,deser,upToDate,optIn,shouldBe,Bloc"
29
+ # MONOREPO NOTE: Add multilingual stopwords to ignore-words-list if needed
30
+ # Example: --ignore-words-list="crate,ser,deser,meu,oder,ist,alle" (Portuguese,German,etc)
31
+
@@ -1,47 +1,47 @@
1
- name: C++ Lint
2
-
3
- on:
4
- push:
5
- branches: [ master, main, develop ]
6
- pull_request:
7
- branches: [ '**' ]
8
-
9
- jobs:
10
- lint:
11
- runs-on: ubuntu-latest
12
-
13
- steps:
14
- - uses: actions/checkout@v5
15
-
16
- - name: Install dependencies
17
- run: |
18
- sudo apt-get update
19
- sudo apt-get install -y clang-format-15 clang-tidy-15 cppcheck cmake ninja-build
20
-
21
- - name: Check formatting
22
- run: |
23
- find src include tests -name '*.cpp' -o -name '*.hpp' -o -name '*.h' | \
24
- xargs clang-format-15 --dry-run --Werror
25
-
26
- - name: Configure CMake (for compile commands)
27
- run: cmake -B build -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
28
-
29
- - name: Run clang-tidy
30
- run: |
31
- find src -name '*.cpp' | \
32
- xargs clang-tidy-15 -p build --warnings-as-errors='*'
33
-
34
- - name: Run cppcheck
35
- run: |
36
- cppcheck --enable=all --error-exitcode=1 \
37
- --suppress=missingIncludeSystem \
38
- --suppress=unmatchedSuppression \
39
- --inline-suppr \
40
- -I include \
41
- src/ tests/
42
-
43
- - name: Build with warnings as errors
44
- run: |
45
- cmake -B build -G Ninja -DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror"
46
- cmake --build build
47
-
1
+ name: C++ Lint
2
+
3
+ on:
4
+ push:
5
+ branches: [ master, main, develop ]
6
+ pull_request:
7
+ branches: [ '**' ]
8
+
9
+ jobs:
10
+ lint:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v5
15
+
16
+ - name: Install dependencies
17
+ run: |
18
+ sudo apt-get update
19
+ sudo apt-get install -y clang-format-15 clang-tidy-15 cppcheck cmake ninja-build
20
+
21
+ - name: Check formatting
22
+ run: |
23
+ find src include tests -name '*.cpp' -o -name '*.hpp' -o -name '*.h' | \
24
+ xargs clang-format-15 --dry-run --Werror
25
+
26
+ - name: Configure CMake (for compile commands)
27
+ run: cmake -B build -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
28
+
29
+ - name: Run clang-tidy
30
+ run: |
31
+ find src -name '*.cpp' | \
32
+ xargs clang-tidy-15 -p build --warnings-as-errors='*'
33
+
34
+ - name: Run cppcheck
35
+ run: |
36
+ cppcheck --enable=all --error-exitcode=1 \
37
+ --suppress=missingIncludeSystem \
38
+ --suppress=unmatchedSuppression \
39
+ --inline-suppr \
40
+ -I include \
41
+ src/ tests/
42
+
43
+ - name: Build with warnings as errors
44
+ run: |
45
+ cmake -B build -G Ninja -DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror"
46
+ cmake --build build
47
+