Repository navigation
docs: ignore the Version line when checking generated llms files - #449
Merged
Merged
Conversation
The --check gate added in #445 compares the committed llms files against freshly generated ones. The stamped version comes from the newest git tag, so it changes the moment a release lands while the committed file still carries the previous release. A single release therefore turned main and every pull request red until the bot's docs pull request was merged by hand: reproduced by adding a local v0.25.1 tag, which flipped --check from 0 to 1. Comparison now drops the `Version:` line on both sides. Anything else — README, examples, module index — still fails, which is what the gate is for. Version lag keeps converging the way it already did, through the llms-txt job's pull request; this only stops it from being a build failure. Both the generator docstring and the workflow step say so, so the next reader does not mistake a passing check for a bug. Also correct three comment counts measured against this tree: - 864 is the "no convention" count, not the pep257 count. Measured: 864 with no convention, 804 under pep257, 665 under the committed google one. - The baseline is 507 in photoshop/, 158 in test/, 0 in scripts/. The lint scope was `photoshop` alone when it was written, so 507 was the whole CI scope then; it is `photoshop test scripts` now. - Per-tier numbers are upper bounds, not counts: overlapping tiers make the eight labels add to 883 against 665 actual findings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two things: fix a build-breaking interaction introduced by #445, and correct
three comment counts that were measured wrong.
The bug. #445 wired
scripts/generate_llms.py --checkinto thePython packageworkflow. TheVersion:line in the generated files is the newest gittag, so it changes as soon as a release lands while the committed file still
carries the previous release. Every release therefore turned
mainand allpull requests red until the bot's
docs/update-llms-txtpull request wasmerged by hand. Reproduced by adding a local
v0.25.1tag, which flipped thecheck from exit 0 to exit 1.
Comparison now drops the
Version:line on both sides. Everything else —README, examples, module index — still fails, which is the gate's actual job.
Version lag keeps converging the way it already did, through the
llms-txtjob's pull request; this only stops it from being a build failure.
Behaviour, verified
Version:differs (new tag)Version:lineThe first row was verified with a real local
v0.25.1tag (since removed), notby reasoning about the code. The last row was verified in CI: PR #448 added content drift
to
llms.txton a scratch branch, and run 38477580289shows
ruff check/ruff formatpassing ("All checks passed!") followed by##[error]llms.txt are out of date; run scripts/generate_llms.py→ exit 1 →build red. That scratch PR and its branch were closed and deleted.
The bot pull-request mechanism is unchanged: the generator still writes the new
version and the
llms-txtjob still opens a pull request for it. Only the gatestopped caring.
Documented in the module docstring and at the workflow step, so the next reader
does not mistake a passing check with a mismatched version for a bug.
Comment counts corrected
Measured against this tree, all three with ruff 0.16.9:
864is the "no convention" count, not pep257. Measured: 864 with noconvention set, 804 under
convention = "pep257", 665 under the committedconvention = "google". The comment said pep257.507 in
photoshop/, 158 intest/, 0 inscripts/. The lint scope wasphotoshopalone when the baseline was written, so 507 was the whole CIscope at the time; it is
photoshop test scriptsnow, which is all 665.eight labels add up to 883 against 665 actual findings. The
testtiersalone are labelled 118 + 45 = 163 against 158 measured. Stated explicitly,
because otherwise the numbers will not balance when clearing a tier.
Ruff 0.17 does not break the baseline
PR #440 (renovate,
ruff
^0.17.0) is open. Measured by installing ruff 0.17.0 and running itagainst this tree:
ruff check photoshop test scriptsunder the project config: passes,exit 0. The baseline holds.
ruff format --check photoshop test scripts: 81 files already formatted inboth.
One difference exists but does not fire here. 0.17 adds
UP042(
replace-str-enum), which reports 2 hits (FontSizeinphotoshop/api/enumerations.py:391,EventIDinphotoshop/api/event_id.py:5)— under
--target-version py311. This project setstarget-version = "py38",because the package still supports Python 3.8, and the suggested fix needs
enum.StrEnum(3.11+). Under py38,UP042reports nothing, which is why thecheck passes.
So no upper bound is needed to merge #440. If the project later raises
target-versionto py311+,UP042would start reporting and CI would go red —at which point the two classes should be converted or
UP042added to theignore list, as a deliberate decision rather than a surprise.
Note that three places pin ruff independently:
pyproject.toml(^0.16.9),.github/workflows/pythonpackage.yml(pip install ruff==0.16.9), and.pre-commit-config.yaml(rev: v0.16.9). #440 only bumps the first two. Thepre-commit pin will drift to whatever renovate bumps it to separately; all
three agree today, so this is a heads-up rather than a defect.
Validation
ruff check photoshop test scripts: passes.ruff format --check photoshop test scripts: 81 files already formatted.python scripts/generate_llms.py --check: up to date; exits 1 on contentdrift (verified in CI, above), exits 0 on version-only drift.
pytest test/test_collections.py test/test_imports.py: 18 passed.pyproject.tomlstill parses as valid TOML with all 8 baseline entries.Configuration, comments, and CI only. No packaging or lockfile changes, and the
generated
llms.txt/llms-full.txtare untouched — the version line stillconverges through the bot pull request.
Tests under
test/manual_test/drive a real Photoshop COM instance and cannotrun in this environment; they were not executed.