@open-tomato/gates 0.1.0 → 0.1.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.md +15 -3
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -50,8 +50,18 @@ Refuses personal and private data in what a public repository tracks:
|
|
|
50
50
|
bunx ot-privacy-gate # tracked files and untracked ones git would track
|
|
51
51
|
bunx ot-privacy-gate --staged # the index, for a pre-commit hook
|
|
52
52
|
bunx ot-privacy-gate --history # every blob and commit identity, before a first push
|
|
53
|
+
bunx ot-privacy-gate --root ../other-repo # a repository other than the current one
|
|
53
54
|
```
|
|
54
55
|
|
|
56
|
+
Each mode reads what it judges from where a reviewer would see it:
|
|
57
|
+
|
|
58
|
+
- `--staged` reads the files and `.privacy-gate.json` from the index, so
|
|
59
|
+
an allowance edited locally but never staged cannot pass a commit.
|
|
60
|
+
- `--history` judges a blob under every path it was committed at,
|
|
61
|
+
because the sample rules and the allow list both depend on the path.
|
|
62
|
+
- An unknown flag, `--root` with no folder, or two modes at once stop the
|
|
63
|
+
gate with exit 2, so a typo never runs a different scan.
|
|
64
|
+
|
|
55
65
|
### The project's list
|
|
56
66
|
|
|
57
67
|
The package ships no banned terms. Each project keeps its own in
|
|
@@ -77,7 +87,9 @@ bun -e 'console.log(new Bun.CryptoHasher("sha256").update(process.argv[1].toLowe
|
|
|
77
87
|
An `allow` entry is a reviewed exception: the path glob, the rule, the
|
|
78
88
|
sha256 of the exact text the gate reported, and why it is meant. Without a
|
|
79
89
|
config file, the gate runs the shape rules alone and says so in its report.
|
|
80
|
-
A malformed config stops the gate with exit 2
|
|
90
|
+
A malformed config stops the gate with exit 2, and so does a key other than
|
|
91
|
+
`banned`, `allow` and `$comment`, or an `allow` rule the gate does not have:
|
|
92
|
+
a typo there would otherwise empty a list without a word.
|
|
81
93
|
|
|
82
94
|
## A pre-commit hook
|
|
83
95
|
|
|
@@ -99,5 +111,5 @@ The gates are importable too, for a project that wraps them:
|
|
|
99
111
|
| --- | --- |
|
|
100
112
|
| `./control-bytes` | `scanText`, `scanBuffer`, `scanFiles`, `listFiles` |
|
|
101
113
|
| `./privacy` | `judge`, `readSources`, `readConfig`, `parseArgs`, `run` |
|
|
102
|
-
| `./privacy/rules` | `scan`, `bannedIn`, `isSamplePath`, `sha256` |
|
|
103
|
-
| `./privacy/config` | `readPrivacyConfig`, `parsePrivacyConfig` |
|
|
114
|
+
| `./privacy/rules` | `scan`, `bannedIn`, `isSamplePath`, `sha256`, `RULE_NAMES` |
|
|
115
|
+
| `./privacy/config` | `readPrivacyConfig`, `parsePrivacyConfig`, `CONFIG_FILE`, `NO_CONFIG` |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tomato/gates",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Repository gates of the open-tomato projects: a control-byte gate and a privacy gate, run in CI and as pre-commit hooks.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Marcos Tomatti",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"test": "bun test"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@open-tomato/eslint-config": "^0.1.
|
|
57
|
-
"@open-tomato/eslint-plugin": "^0.1.
|
|
58
|
-
"@open-tomato/typescript-config": "^0.1.
|
|
56
|
+
"@open-tomato/eslint-config": "^0.1.1",
|
|
57
|
+
"@open-tomato/eslint-plugin": "^0.1.1",
|
|
58
|
+
"@open-tomato/typescript-config": "^0.1.1",
|
|
59
59
|
"@types/bun": "^1.3.0",
|
|
60
60
|
"eslint": "^9.39.5",
|
|
61
61
|
"typescript": "^5.9.3"
|