Repository navigation
ci: gate the line length of new das code - #4289
Merged
Merged
Conversation
aleksisch
force-pushed
the
aleksisch/line-length-gate
branch
from
October 12, 2026 10:55
a15e219 to
18046d1
Compare
check_line_length (run_extended_core) fails a branch that adds a .das line wider than 100 columns, or a comment wider than 70 columns measured from its marker. Only lines the branch adds are measured - the diff runs from the merge-base with origin/<base-ref> (--base-ref, default master). Files that announce themselves as generated are skipped. This script is temporary: it exists only until the whole codebase is moved to these limits, after which the limits belong in a whole-tree check and this changed-lines gate is removed.
aleksisch
force-pushed
the
aleksisch/line-length-gate
branch
from
October 12, 2026 23:04
18046d1 to
63b8400
Compare
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.
Adds
check_line_length, a CI gate on the width of new.dascode, wired intorun_extended_core(the per-PR extended-checks lane)..dasline over 100 columns fails.////*marker to the end of the line (indentation does not count; block-comment continuation lines are measured from their first non-blank column).Only lines the branch adds are measured: the diff runs from the merge-base with
origin/<base-ref>(--base-ref, defaultmaster) to the working tree, limited to*.das. The comment scanner understands string literals,{...}interpolation holding strings, character literals, and nested/* */comments. Files whose header says they are generated are skipped.Locally:
cmake --build build --target check_line_length.This gate is temporary: it exists only until the whole codebase is moved to these limits; then the limits belong in a whole-tree check and this changed-lines gate goes away.
Files
utils/internal/line-length/line_length.das- comment scanner, width measurement, diff parsingutils/internal/line-length/main.das- CLI (--base-ref, defaultmaster)utils/internal/line-length/test_line_length.das- 20 arms, registered inrun_utils_testsTesting
test_line_length.das: 20/20 pass; negative controls (interpolation, nested block comments, quote character literal, block-continuation handling) each turn an arm red.das-fmt --verifyclean on the new files; CMake configures andcheck_line_lengthsits underrun_extended_core.main.das:66: comment is 83 columns, limit 70when a long comment is appended.