@makinzm/mille 0.0.13 → 0.0.14

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 (3) hide show
  1. package/README.md +43 -20
  2. package/mille.wasm +0 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -2,28 +2,20 @@
2
2
 
3
3
  > Like a mille crêpe — your architecture, one clean layer at a time.
4
4
 
5
- ```
6
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ presentation
7
- · · · · · · · · · · · · · · · · · · (deps only flow inward)
8
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ infrastructure
9
- · · · · · · · · · · · · · · · · · ·
10
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ usecase
11
- · · · · · · · · · · · · · · · · · ·
12
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ domain
13
- ```
14
-
15
5
  `mille` is a static analysis CLI that enforces **dependency rules for layered architectures** — Clean Architecture, Onion Architecture, Hexagonal Architecture, and more.
16
6
 
17
7
  One TOML config. Rust-powered. CI-ready. Supports multiple languages from a single config file.
18
8
 
19
9
  ## What it checks
20
10
 
21
- | Check | Rust | Go | TypeScript | JavaScript | Python | Java | Kotlin | PHP |
22
- |---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
23
- | Layer dependency rules (`dependency_mode`) | | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
24
- | External library rules (`external_mode`) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
25
- | DI method call rules (`allow_call_patterns`) | | | | | | | ✅ | ✅ |
26
- | Naming convention rules (`name_deny`) | | | | | | | ✅ |
11
+ **Languages:** Rust, Go, TypeScript, JavaScript, Python, Java, Kotlin, PHP, C
12
+
13
+ | Check | Description |
14
+ |---|---|
15
+ | `dependency_mode` | Layer dependency rules control which layers can import from which |
16
+ | `external_mode` | External library rules restrict third-party package usage per layer |
17
+ | `allow_call_patterns` | DI method call rules — limit which methods may be called on injected types |
18
+ | `name_deny` | Naming convention rules — forbid infrastructure keywords in domain/usecase |
27
19
 
28
20
  ## Install
29
21
 
@@ -419,7 +411,7 @@ Exit codes:
419
411
  |---|---|
420
412
  | `name` | Project name |
421
413
  | `root` | Root directory for analysis |
422
- | `languages` | Languages to check: `"rust"`, `"go"`, `"typescript"`, `"javascript"`, `"python"`, `"java"`, `"kotlin"`, `"php"` |
414
+ | `languages` | Languages to check: `"rust"`, `"go"`, `"typescript"`, `"javascript"`, `"python"`, `"java"`, `"kotlin"`, `"php"`, `"c"` |
423
415
 
424
416
  ### `[[layers]]`
425
417
 
@@ -435,7 +427,7 @@ Exit codes:
435
427
  | `external_deny` | Forbidden external packages (when `external_mode = "opt-out"`) |
436
428
  | `name_deny` | Forbidden keywords for naming convention check (case-insensitive partial match) |
437
429
  | `name_allow` | Substrings to strip before `name_deny` check (e.g. `"category"` prevents `"go"` match inside it) |
438
- | `name_targets` | Targets to check: `"file"`, `"symbol"`, `"variable"`, `"comment"` (default: all) |
430
+ | `name_targets` | Targets to check: `"file"`, `"symbol"`, `"variable"`, `"comment"`, `"string_literal"`, `"identifier"` (default: all) |
439
431
  | `name_deny_ignore` | Glob patterns for files to exclude from naming checks (e.g. `"**/test_*.rs"`) |
440
432
 
441
433
  #### Naming Convention Check (`name_deny`)
@@ -454,7 +446,7 @@ external_deny = []
454
446
  # Usecase layer must not reference specific infrastructure technologies
455
447
  name_deny = ["gcp", "aws", "azure", "mysql", "postgres"]
456
448
  name_allow = ["category"] # "category" contains "go" but should not be flagged
457
- name_targets = ["file", "symbol", "variable", "comment"] # default: all targets
449
+ name_targets = ["file", "symbol", "variable", "comment", "string_literal", "identifier"] # default: all targets
458
450
  name_deny_ignore = ["**/test_*.rs", "tests/**"] # exclude test files from naming checks
459
451
  ```
460
452
 
@@ -468,7 +460,9 @@ name_deny_ignore = ["**/test_*.rs", "tests/**"] # exclude test files from namin
468
460
  - `"symbol"`: function, class, struct, enum, trait, interface, type alias names
469
461
  - `"variable"`: variable, const, let, static declaration names
470
462
  - `"comment"`: inline comment content
471
- - Supported languages: Rust, TypeScript, JavaScript, Python, Go, Java, Kotlin, PHP
463
+ - `"string_literal"`: string literal content
464
+ - `"identifier"`: attribute/field access identifiers (e.g. `gcp` in `cfg.gcp.bucket`)
465
+ - Supported languages: Rust, TypeScript, JavaScript, Python, Go, Java, Kotlin, PHP, C
472
466
  - Severity is controlled by `severity.naming_violation` (default: `"error"`)
473
467
 
474
468
  ### `[[layers.allow_call_patterns]]`
@@ -626,6 +620,35 @@ allow = ["domain", "application"]
626
620
  composer_json = "composer.json" # auto-detects "App\\" from autoload.psr-4
627
621
  ```
628
622
 
623
+ ### C
624
+
625
+ > `#include "..."` is classified as Internal (project header). `#include <...>` is classified as Stdlib (standard/POSIX headers) or External (third-party libraries).
626
+
627
+ **Example `mille.toml` for a C project:**
628
+
629
+ ```toml
630
+ [project]
631
+ name = "my-c-app"
632
+ root = "."
633
+ languages = ["c"]
634
+
635
+ [[layers]]
636
+ name = "domain"
637
+ paths = ["src/domain/**"]
638
+
639
+ [[layers]]
640
+ name = "usecase"
641
+ paths = ["src/usecase/**"]
642
+ dependency_mode = "opt-in"
643
+ allow = ["domain"]
644
+
645
+ [[layers]]
646
+ name = "infrastructure"
647
+ paths = ["src/infrastructure/**"]
648
+ dependency_mode = "opt-in"
649
+ allow = ["domain"]
650
+ ```
651
+
629
652
  ## How it Works
630
653
 
631
654
  mille uses [tree-sitter](https://tree-sitter.github.io/) for AST-based import extraction — no regex heuristics.
package/mille.wasm CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makinzm/mille",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "Architecture Checker — Rust-based multi-language architecture linter",
5
5
  "main": "index.js",
6
6
  "bin": {