architecture-linter 0.1.2 → 0.1.4
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.
- package/README.md +92 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -318,7 +318,98 @@ Fails safely if the workflow file already exists.
|
|
|
318
318
|
|
|
319
319
|
---
|
|
320
320
|
|
|
321
|
-
##
|
|
321
|
+
## GitHub Action
|
|
322
|
+
|
|
323
|
+
The easiest way to enforce architecture rules on every pull request — no Node.js
|
|
324
|
+
setup needed, violations appear as inline code annotations.
|
|
325
|
+
|
|
326
|
+
```yaml
|
|
327
|
+
# .github/workflows/arch-lint.yml
|
|
328
|
+
name: Architecture Lint
|
|
329
|
+
|
|
330
|
+
on:
|
|
331
|
+
push:
|
|
332
|
+
branches: ["**"]
|
|
333
|
+
pull_request:
|
|
334
|
+
branches: ["**"]
|
|
335
|
+
|
|
336
|
+
jobs:
|
|
337
|
+
arch-lint:
|
|
338
|
+
runs-on: ubuntu-latest
|
|
339
|
+
steps:
|
|
340
|
+
- uses: actions/checkout@v4
|
|
341
|
+
|
|
342
|
+
- uses: cvalingam/architecture-linter@v0.1.2
|
|
343
|
+
with:
|
|
344
|
+
config: .context.yml # path to your config (default: .context.yml)
|
|
345
|
+
fail-on-violations: 'true' # fail the job on violations (default: true)
|
|
346
|
+
token: ${{ secrets.GITHUB_TOKEN }} # enables PR comment summary (optional)
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### Action inputs
|
|
350
|
+
|
|
351
|
+
| Input | Default | Description |
|
|
352
|
+
|---|---|---|
|
|
353
|
+
| `config` | `.context.yml` | Path to the config file |
|
|
354
|
+
| `working-directory` | `.` | Root directory to scan |
|
|
355
|
+
| `fail-on-violations` | `true` | Fail the step when violations are found |
|
|
356
|
+
| `token` | `''` | GitHub token — enables PR comment with violation table |
|
|
357
|
+
|
|
358
|
+
### Action outputs
|
|
359
|
+
|
|
360
|
+
| Output | Description |
|
|
361
|
+
|---|---|
|
|
362
|
+
| `violations` | Number of violations found (usable in subsequent steps) |
|
|
363
|
+
|
|
364
|
+
When violations are found, each one appears as a **red annotation** directly on
|
|
365
|
+
the diff line in the PR, and a summary comment is posted to the PR thread.
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## GitHub Action
|
|
370
|
+
|
|
371
|
+
The easiest way to enforce architecture rules on every pull request — no manual
|
|
372
|
+
setup required. Violations are posted as inline PR annotations and an optional
|
|
373
|
+
PR comment summary:
|
|
374
|
+
|
|
375
|
+
```yaml
|
|
376
|
+
# .github/workflows/arch-lint.yml
|
|
377
|
+
name: Architecture Lint
|
|
378
|
+
|
|
379
|
+
on:
|
|
380
|
+
pull_request:
|
|
381
|
+
branches: ["**"]
|
|
382
|
+
|
|
383
|
+
jobs:
|
|
384
|
+
arch-lint:
|
|
385
|
+
runs-on: ubuntu-latest
|
|
386
|
+
steps:
|
|
387
|
+
- uses: actions/checkout@v4
|
|
388
|
+
|
|
389
|
+
- name: Enforce architecture rules
|
|
390
|
+
uses: cvalingam/architecture-linter@v0.1.2
|
|
391
|
+
with:
|
|
392
|
+
token: ${{ secrets.GITHUB_TOKEN }} # for PR comment (optional)
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
**Inputs**
|
|
396
|
+
|
|
397
|
+
| Input | Default | Description |
|
|
398
|
+
|---|---|---|
|
|
399
|
+
| `config` | `.context.yml` | Path to your config file |
|
|
400
|
+
| `working-directory` | `.` | Root of the project to scan |
|
|
401
|
+
| `fail-on-violations` | `true` | Fail the step when violations are found |
|
|
402
|
+
| `token` | `''` | `GITHUB_TOKEN` — enables PR comment summary |
|
|
403
|
+
|
|
404
|
+
**Outputs**
|
|
405
|
+
|
|
406
|
+
| Output | Description |
|
|
407
|
+
|---|---|
|
|
408
|
+
| `violations` | Number of violations found |
|
|
409
|
+
|
|
410
|
+
---
|
|
411
|
+
|
|
412
|
+
## CI integration (manual setup)
|
|
322
413
|
|
|
323
414
|
Run the linter on every push and pull request. The `ci` command generates this
|
|
324
415
|
for you (`architecture-linter ci`), or add the step manually:
|