Repository navigation
Add lexical comment counts and shrink-only stats budgets - #122
Merged
Merged
Conversation
Merged
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.
statsmixed comments with blank lines, so consumers could not enforce comment budgets or distinguish##docs from other prose. Use the existing GDScript tokenizer to report comment-only lines, the doc-comment subset, inline comment lines and standalone docstring lines, alongside code/case counts. Token physical extents keep hashes and escaped quotes inside multiline strings out of comment counts.Add
stats --ratchet FILEagainst the verb's JSON output. Scope/role roots must match; comment/doc/inline/docstring counters and test-code/case counts must remain under their caps. An existing Git-base baseline may only lower its limits; widening scope, deleting a cap or raising it fails. Malformed baselines are usage errors; zero-file scans remain failures. No consumer-specific paths or duplicate lexer.Validation: extended existing hand-counted stats fixtures; string/comment distinction, inline/docstring evasion, test-code growth, cap increases and malformed baselines have positive/negative probes.
make precommitpasses: 301 tests, 167 subtests, one preexisting skip, shell and eight Godot static checks.Wiki verb reference
godot-devkit stats [dir ...] [--by dir] [--json] [--ratchet FILE]: reports physical/code/comment/doc/inline/docstring/test counts from git-known files. Capture the baseline withstats --json > tools/ci/stats-baseline.json; invoke the same scope/roots withstats --ratchet tools/ci/stats-baseline.json. Lower caps as debt is removed. Production code counts are context; test code/case counts are caps.docsis a subset of comments, not added twice. Existing baseline limits are compared to origin/main, or HEAD in a standalone repository.Release notes
Minor: add lexical comment/doc/inline/docstring counts and shrink-only stats ratchets.
Upgrade: table consumers must account for the new columns; JSON consumers can read the additive fields. Capture a new JSON baseline once before using --ratchet. Existing stats role configuration remains unchanged.
Closes #121