@guardsmith/cli 0.6.0 → 0.6.1
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.ja.md +22 -14
- package/README.md +23 -14
- package/package.json +2 -2
package/README.ja.md
CHANGED
|
@@ -43,8 +43,11 @@ npx @guardsmith/cli init
|
|
|
43
43
|
npx @guardsmith/cli lint
|
|
44
44
|
|
|
45
45
|
# 標準更新で何が変わるかを表示し、取り込む
|
|
46
|
-
npx @guardsmith/cli
|
|
47
|
-
npx @guardsmith/cli bump v0.7.
|
|
46
|
+
npx @guardsmith/cli bump v0.7.1 --dry-run # 新タグでの dry-run(衝突があれば exit 1)
|
|
47
|
+
npx @guardsmith/cli bump v0.7.1 # 適用 + extends タグと vars ファイルの更新
|
|
48
|
+
|
|
49
|
+
# 現在固定しているタグでの未適用分の確認(bump の予見にはならない)
|
|
50
|
+
npx @guardsmith/cli sync
|
|
48
51
|
|
|
49
52
|
# guardsmith.vars.yaml がまだ無い既存 PJ は先に生成する
|
|
50
53
|
npx @guardsmith/cli sync --init-vars
|
|
@@ -54,15 +57,15 @@ npx @guardsmith/cli explain claude-md/thin-diff
|
|
|
54
57
|
npx @guardsmith/cli version
|
|
55
58
|
```
|
|
56
59
|
|
|
57
|
-
| コマンド | 主なフラグ
|
|
58
|
-
| ------------------------- |
|
|
59
|
-
| `guard new <dir>` | —
|
|
60
|
-
| `guard init` | —
|
|
61
|
-
| `guard lint` | `--root`、`--policy`、`--format console\|sarif\|json`、`--out`、`--no-cache`、`--no-gitignore`
|
|
62
|
-
| `guard sync` | `--root`、`--policy`、`--write`、`--no-cache`、`--no-gitignore`、`--conflict-markers`、`--init-vars`
|
|
63
|
-
| `guard bump <tag>` | `--root`、`--policy`、`--repo <owner>/<repo>`、`--no-cache`、`--no-gitignore`、`--conflict-markers`
|
|
64
|
-
| `guard explain <rule-id>` | —
|
|
65
|
-
| `guard version` | —
|
|
60
|
+
| コマンド | 主なフラグ |
|
|
61
|
+
| ------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
62
|
+
| `guard new <dir>` | — |
|
|
63
|
+
| `guard init` | — |
|
|
64
|
+
| `guard lint` | `--root`、`--policy`、`--format console\|sarif\|json`、`--out`、`--no-cache`、`--no-gitignore` |
|
|
65
|
+
| `guard sync` | `--root`、`--policy`、`--write`、`--no-cache`、`--no-gitignore`、`--conflict-markers`、`--init-vars` |
|
|
66
|
+
| `guard bump <tag>` | `--root`、`--policy`、`--repo <owner>/<repo>`、`--dry-run`、`--no-cache`、`--no-gitignore`、`--conflict-markers` |
|
|
67
|
+
| `guard explain <rule-id>` | — |
|
|
68
|
+
| `guard version` | — |
|
|
66
69
|
|
|
67
70
|
`guard sync` / `guard bump` は標準リリースを **3-way マージ**で取り込みます。PJ が乗っている
|
|
68
71
|
タグのマスターが base、新タグのマスターが theirs、PJ リポジトリが ours なので、PJ 固有の記述は
|
|
@@ -71,6 +74,11 @@ npx @guardsmith/cli version
|
|
|
71
74
|
入りで書き出します)。どちらも終了コードは、衝突なしで `0`、1 ファイルでも衝突すれば `1`
|
|
72
75
|
(このとき `guard bump` は policy を含め何も書きません)、実行エラーは `2` です。
|
|
73
76
|
|
|
77
|
+
`guard bump <tag> --dry-run` は同じ計画・衝突予測・policy の書き換え予定行を表示し、
|
|
78
|
+
1 バイトも書かずに本番と同じ終了コードを返します。**新しい**タグでの差分を事前に見られるのは
|
|
79
|
+
この dry-run だけです(`--write` なしの `guard sync` は policy が **現在** 固定しているタグを
|
|
80
|
+
基準にした dry-run です)。`--dry-run` と `--conflict-markers` は併用できません。
|
|
81
|
+
|
|
74
82
|
マージが読む PJ のプレースホルダ置換値は `guardsmith.vars.yaml`(PJ ルート・コミット対象・
|
|
75
83
|
秘密情報は書かない)にあります。`guard new` が雛形を生成し、既存 PJ は
|
|
76
84
|
`guard sync --init-vars` で生成します。`drift3` ルールを持たないポリシーでは、従来どおり
|
|
@@ -103,9 +111,9 @@ npx @guardsmith/cli version
|
|
|
103
111
|
version: 1
|
|
104
112
|
target: claude-code
|
|
105
113
|
extends:
|
|
106
|
-
- github:novexar/guardsmith//presets/baseline.yaml@v0.7.
|
|
114
|
+
- github:novexar/guardsmith//presets/baseline.yaml@v0.7.1 # タグ固定は必須
|
|
107
115
|
# フロントエンドを持つプロジェクトはさらに:
|
|
108
|
-
# - github:novexar/guardsmith//presets/frontend.yaml@v0.7.
|
|
116
|
+
# - github:novexar/guardsmith//presets/frontend.yaml@v0.7.1
|
|
109
117
|
ignore: [] # 全走査から除外する glob(extends 間で連結される)
|
|
110
118
|
rules: [] # 追加・上書き(同じ id の再定義=上書き)
|
|
111
119
|
exemptions: [] # 期限付き例外(reason + approved_by + expires 必須)
|
|
@@ -122,7 +130,7 @@ GitHub の外に出ることはありません。期限切れの例外(exemption
|
|
|
122
130
|
workflow に 1 行追加:
|
|
123
131
|
|
|
124
132
|
```yaml
|
|
125
|
-
- uses: novexar/Guardsmith@v0.7.
|
|
133
|
+
- uses: novexar/Guardsmith@v0.7.1
|
|
126
134
|
```
|
|
127
135
|
|
|
128
136
|
違反した PR はサマリコメントと SARIF レポート付きで失敗します。閉域網などの環境では
|
package/README.md
CHANGED
|
@@ -43,8 +43,11 @@ npx @guardsmith/cli init
|
|
|
43
43
|
npx @guardsmith/cli lint
|
|
44
44
|
|
|
45
45
|
# Show what a standards update would change, then take it in
|
|
46
|
-
npx @guardsmith/cli
|
|
47
|
-
npx @guardsmith/cli bump v0.7.
|
|
46
|
+
npx @guardsmith/cli bump v0.7.1 --dry-run # dry-run for the new tag (exit 1 = something conflicts)
|
|
47
|
+
npx @guardsmith/cli bump v0.7.1 # apply + move the extends tags and the vars file
|
|
48
|
+
|
|
49
|
+
# Dry-run at the tag the policy currently pins (does not predict a bump)
|
|
50
|
+
npx @guardsmith/cli sync
|
|
48
51
|
|
|
49
52
|
# Existing project with no guardsmith.vars.yaml yet — generate it first
|
|
50
53
|
npx @guardsmith/cli sync --init-vars
|
|
@@ -54,15 +57,15 @@ npx @guardsmith/cli explain claude-md/thin-diff
|
|
|
54
57
|
npx @guardsmith/cli version
|
|
55
58
|
```
|
|
56
59
|
|
|
57
|
-
| Command | Key flags
|
|
58
|
-
| ------------------------- |
|
|
59
|
-
| `guard new <dir>` | —
|
|
60
|
-
| `guard init` | —
|
|
61
|
-
| `guard lint` | `--root`, `--policy`, `--format console\|sarif\|json`, `--out`, `--no-cache`, `--no-gitignore`
|
|
62
|
-
| `guard sync` | `--root`, `--policy`, `--write`, `--no-cache`, `--no-gitignore`, `--conflict-markers`, `--init-vars`
|
|
63
|
-
| `guard bump <tag>` | `--root`, `--policy`, `--repo <owner>/<repo>`, `--no-cache`, `--no-gitignore`, `--conflict-markers`
|
|
64
|
-
| `guard explain <rule-id>` | —
|
|
65
|
-
| `guard version` | —
|
|
60
|
+
| Command | Key flags |
|
|
61
|
+
| ------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
62
|
+
| `guard new <dir>` | — |
|
|
63
|
+
| `guard init` | — |
|
|
64
|
+
| `guard lint` | `--root`, `--policy`, `--format console\|sarif\|json`, `--out`, `--no-cache`, `--no-gitignore` |
|
|
65
|
+
| `guard sync` | `--root`, `--policy`, `--write`, `--no-cache`, `--no-gitignore`, `--conflict-markers`, `--init-vars` |
|
|
66
|
+
| `guard bump <tag>` | `--root`, `--policy`, `--repo <owner>/<repo>`, `--dry-run`, `--no-cache`, `--no-gitignore`, `--conflict-markers` |
|
|
67
|
+
| `guard explain <rule-id>` | — |
|
|
68
|
+
| `guard version` | — |
|
|
66
69
|
|
|
67
70
|
`guard sync` and `guard bump` take a standards release in as a **three-way merge**: the
|
|
68
71
|
master at the tag the project sits on is the base, the master at the new tag is theirs, and
|
|
@@ -72,6 +75,12 @@ the standards change overlap is reported as a **conflict** and left untouched
|
|
|
72
75
|
markers instead). Both exit `0` with no conflicts, `1` when anything conflicts — `guard bump`
|
|
73
76
|
then writes nothing at all, not even the policy — and `2` on a run-time error.
|
|
74
77
|
|
|
78
|
+
`guard bump <tag> --dry-run` prints the same plan, the predicted conflicts and the policy
|
|
79
|
+
lines it would rewrite, writes nothing, and returns the exit code the real run would. It is
|
|
80
|
+
the only way to see a **new** tag's diff up front: `guard sync` without `--write` is a
|
|
81
|
+
dry-run against the tag the policy **currently** pins. `--dry-run` cannot be combined with
|
|
82
|
+
`--conflict-markers`.
|
|
83
|
+
|
|
75
84
|
The merge reads the project's placeholder substitutions from `guardsmith.vars.yaml`
|
|
76
85
|
(project root, committed, no secrets). `guard new` writes the skeleton; an existing project
|
|
77
86
|
generates one with `guard sync --init-vars`. A policy with no `drift3` rule keeps the old
|
|
@@ -105,9 +114,9 @@ is genuinely complete.
|
|
|
105
114
|
version: 1
|
|
106
115
|
target: claude-code
|
|
107
116
|
extends:
|
|
108
|
-
- github:novexar/guardsmith//presets/baseline.yaml@v0.7.
|
|
117
|
+
- github:novexar/guardsmith//presets/baseline.yaml@v0.7.1 # tag pinning is mandatory
|
|
109
118
|
# Projects with a frontend also add:
|
|
110
|
-
# - github:novexar/guardsmith//presets/frontend.yaml@v0.7.
|
|
119
|
+
# - github:novexar/guardsmith//presets/frontend.yaml@v0.7.1
|
|
111
120
|
ignore: [] # globs excluded from every scan (concatenated across extends layers)
|
|
112
121
|
rules: [] # add or override (redefining an id overrides it)
|
|
113
122
|
exemptions: [] # time-boxed waivers: reason + approved_by + expires required
|
|
@@ -124,7 +133,7 @@ Add one line to your workflow using the
|
|
|
124
133
|
[GuardSmith Lint Action](https://github.com/marketplace/actions/guardsmith-lint):
|
|
125
134
|
|
|
126
135
|
```yaml
|
|
127
|
-
- uses: novexar/Guardsmith@v0.7.
|
|
136
|
+
- uses: novexar/Guardsmith@v0.7.1
|
|
128
137
|
```
|
|
129
138
|
|
|
130
139
|
Violating PRs fail with a summary comment and a SARIF report. Air-gapped environments can
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guardsmith/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "GuardSmith CLI — the guard binary (init / lint / sync / new / explain)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
"bin"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@guardsmith/core": "^0.6.
|
|
22
|
+
"@guardsmith/core": "^0.6.1"
|
|
23
23
|
}
|
|
24
24
|
}
|