judgelint 0.2.1 → 0.2.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +72 -0
- data/README.md +52 -16
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 53413e17389650b8503df09def0283a213d0b9b170eda6749fdad56a04f0bb2e
|
|
4
|
+
data.tar.gz: 3b461bfa1d1ebeaa9ce292a5977476911d809872784a0334b9e47c2f8a4022f6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4516db2a356e6b814f0422394068d4ffeab67e1d9dd0dd3202c4498acd76a58301bfc4464a689af33f2cd2a9ea75f9c30c78d69b8ab5979493ed1e40177e0783
|
|
7
|
+
data.tar.gz: 88ebb9db1e214cea09275712142b41c57bb1c84fd30cf6c6983daf3549350d11adfdf0abeefefccaa44e46e19922781f58c55b1aac7bb2dcf754ae2442072834
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,77 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.3 (2026-10-30)
|
|
4
|
+
|
|
5
|
+
`--pr` uses the pull request's own specs and cache again, and hardening
|
|
6
|
+
from a fourth review.
|
|
7
|
+
|
|
8
|
+
- `--pr` reads only `.judgelint.yml` from the base branch, so a pull
|
|
9
|
+
request still can't change where its code is sent or which key goes with
|
|
10
|
+
it. Its own specs and cache are used, as in 0.2.0: a new convention
|
|
11
|
+
applies to the pull request that adds it, and CI can keep the cache
|
|
12
|
+
between pushes. 0.2.1 read both from the base branch, so new rules waited
|
|
13
|
+
for a merge and every push asked again.
|
|
14
|
+
- A `##` in a file name or an endpoint's error is escaped in text output,
|
|
15
|
+
so it can't run an Azure Pipelines (`##vso[`) or TeamCity command. JSON
|
|
16
|
+
and SARIF write it as `#\u0023`, which reads back the same.
|
|
17
|
+
- Under `--base` or `--pr`, adding or changing a link to a directory asks
|
|
18
|
+
that directory's directory rules.
|
|
19
|
+
- A directory with `[`, `*`, `?` or `{` in its name sends its own files to
|
|
20
|
+
directory rules. Its name was read as a pattern, which could match
|
|
21
|
+
nothing.
|
|
22
|
+
- A changed file whose name isn't UTF-8 fails the run. It was read as
|
|
23
|
+
whatever file its name decoded to.
|
|
24
|
+
- `judgelint init` won't write through a `CONVENTIONS.md` link.
|
|
25
|
+
- The README says that patterns skip names that start with a dot unless
|
|
26
|
+
they name the dot.
|
|
27
|
+
|
|
28
|
+
## 0.2.2 (2026-10-30)
|
|
29
|
+
|
|
30
|
+
Fixes from a third review of 0.2.1, which found ways around its fixes.
|
|
31
|
+
|
|
32
|
+
- `--pr` judges what the pull request committed. Untracked files, like ones
|
|
33
|
+
an earlier CI step wrote, aren't part of it and are never sent, whatever
|
|
34
|
+
the pull request's `.gitignore` says, and a tracked file a step changed is
|
|
35
|
+
read as committed.
|
|
36
|
+
- `--pr` reads the base branch's cache into memory and leaves the
|
|
37
|
+
checkout's `.judgelint/cache.bin` alone.
|
|
38
|
+
- `--base` and `--pr` work with `check` only. `judgelint test --pr` used to
|
|
39
|
+
run, ignore `--pr`, and use the pull request's config.
|
|
40
|
+
- Under `--base` or `--pr`, these now fail the run instead of passing:
|
|
41
|
+
- a changed file with a NUL byte near its start, which counted as binary
|
|
42
|
+
and was left out (images, fonts, archives and other formats that are
|
|
43
|
+
never code are still left out);
|
|
44
|
+
- a rule the model refused to answer for one window when another passed;
|
|
45
|
+
- a changed file that leads outside the project, or to nothing.
|
|
46
|
+
- Deleting or moving a file asks about its directory's directory rules.
|
|
47
|
+
- An empty file is asked about by rules about whole files and directories.
|
|
48
|
+
- If git fails to list the project's files, that's an error. Before, the
|
|
49
|
+
gitignore check was skipped and ignored files could be sent.
|
|
50
|
+
- The project's `.judgelint.yml` must be a regular file inside the project,
|
|
51
|
+
1 MB at most. A config named with `--config` can be anywhere.
|
|
52
|
+
- Files are opened with no links allowed in the path, so a directory
|
|
53
|
+
swapped for a link while judgelint runs can't lead it outside.
|
|
54
|
+
- Runs that share a cache no longer drop each other's answers.
|
|
55
|
+
- A custom endpoint's answers are cached under the address and headers its
|
|
56
|
+
`${VAR}`s resolve to. Custom endpoints, and presets with headers,
|
|
57
|
+
ask again once.
|
|
58
|
+
- A failed request stops the run: no more requests go out, from that file
|
|
59
|
+
or any other.
|
|
60
|
+
Requests go out 32 at a time across files. Responses are capped at 4 MB.
|
|
61
|
+
- A file too large for every model is skipped before its questions are
|
|
62
|
+
made, and a directory's files are capped at 4 MB together.
|
|
63
|
+
- Control characters in file names and endpoint errors are escaped in
|
|
64
|
+
output, and so are GitHub workflow commands (a leading `::`, or `##[`), so
|
|
65
|
+
they can't forge a CI annotation.
|
|
66
|
+
- A header whose `${VAR}` isn't set is an error; it was sent as written.
|
|
67
|
+
The key's header is marked sensitive. `price_per_million` can't be
|
|
68
|
+
negative. Cached choices must add up to one. YAML is parsed with
|
|
69
|
+
explicit limits.
|
|
70
|
+
- CI runs cargo-deny and zizmor, builds with the oldest supported Rust,
|
|
71
|
+
and builds the binaries with cargo-auditable. Dependabot updates the
|
|
72
|
+
actions and crates. install.sh checks the build attestation, for the
|
|
73
|
+
release's tag and workflow, when the GitHub CLI is signed in.
|
|
74
|
+
|
|
3
75
|
## 0.2.1 (2026-10-29)
|
|
4
76
|
|
|
5
77
|
Security fixes, after two reviews of 0.2.0. A pull request could change the
|
data/README.md
CHANGED
|
@@ -18,8 +18,9 @@ The script installs to `~/.local/bin`, or to `$JUDGELINT_INSTALL_DIR`. The
|
|
|
18
18
|
binaries are on the [releases page](https://github.com/jpcamara/judgelint/releases)
|
|
19
19
|
for macOS and Linux, on arm64 and x86_64. Linux needs glibc 2.34 or newer
|
|
20
20
|
(Ubuntu 22.04, Debian 12, RHEL 9). `gem install judgelint` installs the same
|
|
21
|
-
binary.
|
|
22
|
-
`cargo install --git https://github.com/jpcamara/judgelint`.
|
|
21
|
+
binary. On another Unix, or an older glibc, build it with Rust:
|
|
22
|
+
`cargo install --git https://github.com/jpcamara/judgelint`. It doesn't build
|
|
23
|
+
on Windows.
|
|
23
24
|
|
|
24
25
|
Each release's archives and gems carry a build attestation from the GitHub
|
|
25
26
|
Actions run that built them, from the tagged source. To check one:
|
|
@@ -54,7 +55,9 @@ judgelint: 1 request, 940 input tokens, $0.0000, typesafe:jev-latest
|
|
|
54
55
|
```
|
|
55
56
|
|
|
56
57
|
That's all the setup there is. A `CONVENTIONS.md` covers the files in its
|
|
57
|
-
directory and below, except Markdown and
|
|
58
|
+
directory and below, except Markdown, lockfiles, and names that start with a
|
|
59
|
+
dot. A pattern in `paths:` matches a dotted name only when it names the dot,
|
|
60
|
+
like `.github/*.yml`. In a git repository,
|
|
58
61
|
judgelint skips what git ignores. It also skips binary files.
|
|
59
62
|
|
|
60
63
|
judgelint asks Jev on TypeSafe. To use another provider, set `models` in
|
|
@@ -232,26 +235,57 @@ judgelint --pr # changes in the current pull request
|
|
|
232
235
|
judgelint --pr --format github # GitHub annotations on the changed lines (json and sarif work too)
|
|
233
236
|
```
|
|
234
237
|
|
|
235
|
-
These only
|
|
236
|
-
context, so existing code doesn't block a new pull request
|
|
237
|
-
|
|
238
|
+
These ask only about the lines that changed, with the rest of the file as
|
|
239
|
+
context, so existing code doesn't block a new pull request. When the model
|
|
240
|
+
says the clearest violation is on a line the change didn't touch, it
|
|
241
|
+
doesn't count, even if a changed line breaks the same rule less clearly.
|
|
242
|
+
A new file is
|
|
238
243
|
all changed lines. Rules about a whole file (`scope: file`) still read the
|
|
239
|
-
whole file when any of it changed
|
|
244
|
+
whole file when any of it changed, and a directory rule asks about a
|
|
245
|
+
directory when a file in it was changed, added or deleted. Only `check`
|
|
246
|
+
takes `--base` and `--pr`. `--pr` gets the base branch from GitHub
|
|
240
247
|
Actions, GitLab, Buildkite, Bitbucket, Azure Pipelines,
|
|
241
248
|
`JUDGELINT_BASE_BRANCH`, or `gh`. Fetch enough history for git to find the
|
|
242
249
|
merge base.
|
|
243
250
|
|
|
244
251
|
Under `--base` or `--pr`, a changed file judgelint can't judge fails the
|
|
245
|
-
run: one too large for the model,
|
|
252
|
+
run: one too large for the model, one the model refused to answer about,
|
|
253
|
+
even in part, one that leads outside the project, or a binary one. Images,
|
|
254
|
+
fonts, archives and other formats that are never code are left out instead.
|
|
255
|
+
|
|
256
|
+
To keep answers between pushes, keep the cache in your CI's cache. On
|
|
257
|
+
GitHub Actions:
|
|
258
|
+
|
|
259
|
+
```yaml
|
|
260
|
+
- uses: actions/cache@v4
|
|
261
|
+
with:
|
|
262
|
+
path: .judgelint/cache.bin
|
|
263
|
+
key: judgelint-${{ github.run_id }}
|
|
264
|
+
restore-keys: judgelint-
|
|
265
|
+
- run: judgelint --pr --format github
|
|
266
|
+
```
|
|
246
267
|
|
|
247
268
|
### Pull requests from people you don't trust
|
|
248
269
|
|
|
249
|
-
`--pr` reads `.judgelint.yml
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
270
|
+
`--pr` reads `.judgelint.yml` from the base branch, not from the pull
|
|
271
|
+
request, so a pull request can't change where its code is sent or which
|
|
272
|
+
API key goes with it.
|
|
273
|
+
|
|
274
|
+
The pull request's own specs and cache are used, so a new or changed
|
|
275
|
+
convention applies to it right away. That also means a pull request can
|
|
276
|
+
change its rules or the answers in its cache. Review those like any other
|
|
277
|
+
change, and have GitHub hold workflow runs on pull requests from forks
|
|
278
|
+
until you approve them (Settings → Actions).
|
|
279
|
+
|
|
280
|
+
`--pr` judges what the pull request committed. Anything else in the
|
|
281
|
+
checkout, like a file an earlier CI step wrote, is never sent, whatever the
|
|
282
|
+
pull request's `.gitignore` says.
|
|
283
|
+
|
|
284
|
+
Run judgelint with `--pr` on pull requests; a plain `judgelint` or `--base`
|
|
285
|
+
run uses the checked-out files as they are.
|
|
286
|
+
|
|
287
|
+
`--pr` trusts the branch a pull request targets, so only check pull requests
|
|
288
|
+
against branches that only trusted people push to.
|
|
255
289
|
|
|
256
290
|
Even so, give the job only the model's API key. The pull request's code is
|
|
257
291
|
still what's being read, and the model can be argued with: a comment in the
|
|
@@ -267,8 +301,9 @@ your machine is read or sent:
|
|
|
267
301
|
- Only files inside the directory judgelint runs in, and none reached
|
|
268
302
|
through a link that leads out of it.
|
|
269
303
|
- In a git repository, only files git tracks or would add, never ignored
|
|
270
|
-
ones.
|
|
271
|
-
- No binary files, and nothing over 4 MB
|
|
304
|
+
ones. Under `--pr`, only files git tracks.
|
|
305
|
+
- No binary files, and nothing over 4 MB, or 4 MB for a directory's files
|
|
306
|
+
together.
|
|
272
307
|
|
|
273
308
|
Requests go to the model's API over https, or plain http to a server on
|
|
274
309
|
your own machine. The API key goes only to its own provider's address: a
|
|
@@ -291,6 +326,7 @@ A model judgelint has no price for, like any model on OpenRouter, needs a
|
|
|
291
326
|
|
|
292
327
|
Every run prints what it cost. Answers are cached in `.judgelint/cache.bin`,
|
|
293
328
|
so a file that hasn't changed costs nothing. Commit the cache to share it.
|
|
329
|
+
Runs at the same time can share it too.
|
|
294
330
|
`judgelint --help` lists the flags.
|
|
295
331
|
|
|
296
332
|
List two models to average their answers, like `models: [typesafe,
|