Skip to content

Commit 4d88249

Browse files
authored
Merge pull request #7 from utensils/develop
Test coverage improvements
2 parents 377a8f1 + 30ac9b6 commit 4d88249

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2888
-68
lines changed

.cursorrules

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ MCP-NixOS provides MCP resources and tools for NixOS packages, system options, H
1414

1515
Official repository: [https://github.com/utensils/mcp-nixos](https://github.com/utensils/mcp-nixos)
1616

17+
## Branch Management
18+
19+
- Default development branch is `develop`
20+
- Main release branch is `main`
21+
- Branch protection rules are enforced:
22+
- `main`: Requires PR review (1 approval), admin enforcement, no deletion, no force push
23+
- `develop`: Protected from deletion but allows force push
24+
- PRs follow the pattern: commit to `develop` → open PR to `main` → merge once approved
25+
- Branch deletion on merge is disabled to preserve branch history
26+
1727
## Architecture
1828

1929
### Core Components
@@ -122,6 +132,30 @@ Official repository: [https://github.com/utensils/mcp-nixos](https://github.com/
122132
- All tests must check for both default OS cache paths and test-specific paths
123133
- The gitignore file excludes `mcp_nixos_test_cache/` and `*test_cache*/` patterns
124134

135+
### Code Complexity Analysis
136+
- Uses wily to track and report on code complexity metrics
137+
- Available locally via `nix develop -c complexity` command:
138+
- Build cache: `complexity build`
139+
- View report: `complexity report <file> <metric>`
140+
- Generate graph: `complexity graph <file> <metric>`
141+
- Rank files: `complexity rank [path] [metric]`
142+
- Compare changes: `complexity diff [git_ref]`
143+
- Pre-commit hook to check complexity on every commit
144+
- Continuous Integration:
145+
- Separate GitHub workflow for complexity analysis
146+
- Runs on all PRs targeting main branch
147+
- Posts complexity report as PR comment
148+
- Archives detailed reports as artifacts
149+
- Key metrics tracked:
150+
- Cyclomatic complexity
151+
- Maintainability index
152+
- Lines of code
153+
- Comments and documentation
154+
- Code complexity thresholds:
155+
- Functions should maintain cyclomatic complexity < 10
156+
- Files should maintain maintainability index > 65
157+
- Keep module sizes reasonable (< 500 lines preferred)
158+
125159
### Logging Tests
126160
- Prefer direct behavior verification over implementation details
127161
- When testing log level filtering:

0 commit comments

Comments
 (0)