judgelint 0.2.1-x86_64-linux → 0.2.3-x86_64-linux

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 (5) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +72 -0
  3. data/README.md +52 -16
  4. data/libexec/judgelint +0 -0
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e27f7133b6d15b0d7d48e305f23669f3eda78659688b9cccf91d558fb3447f7
4
- data.tar.gz: 6d8d9b8722bf99bf2e7d1a750e5aa37fe4572195e943c9ae4e21a578509ad017
3
+ metadata.gz: 12da6e983fcf023f08443fbf156ec8af38a7508df7f3a536c7c737c13937f46c
4
+ data.tar.gz: a50ceba857187174c2b64bd337e8e17228a454b0f3f4fa201c82899a73c4bdcd
5
5
  SHA512:
6
- metadata.gz: 800c06d5623fb9338c6c44d66bfc1f3d766c2fe207372bd141622d8ac97881e405c4b3f63fb5159899b45f1042269a657da4ad61423998d5314994b6f98b54c4
7
- data.tar.gz: 9a70fc934f4af27bc381659531ee9d1fbf112d6f4c5c98b154dcbd2d64d6ee0399f5d84a53be52f587c4d928afdb29f218ae1a0e1ee6ac46bcf0526ee1040b1b
6
+ metadata.gz: 4964d444b3877bfbc6c4b863a32d361ca098020dc04a30e6dfb6d1098096067443f86fd98ad1c7ac4e8e78a923099f60126483bd8c5bf17f3947fda4d42e7e28
7
+ data.tar.gz: 22fb7f8e136bb6d0d17e5ee4ab83d16fe9de6bb329a47d28eb0ddd28541deea334159f9075540371ae70405a2ef17b946433bf1e8235d6b13656ec961352e6f0
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. Anywhere else, build it with Rust:
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 lockfiles. In a git repository,
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 ask about the lines that changed, with the rest of the file as
236
- context, so existing code doesn't block a new pull request: a finding the
237
- model places on a line the change didn't touch doesn't count. A new file is
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. `--pr` gets the base branch from GitHub
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, or one the model refused to answer about.
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`, the specs, and `.judgelint/cache.bin` from the
250
- base branch, not from the pull request, so a pull request can't change the
251
- rules it's checked against, where its code is sent, or the answers it's
252
- judged by. New or changed conventions apply once they're merged. Run
253
- judgelint with `--pr` on pull requests; a plain `judgelint` or `--base` run
254
- uses the checked-out files as they are.
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,
data/libexec/judgelint CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judgelint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - JP Camara