Repository navigation
Fix check for error groups that appear on a single line - #2386
Merged
srittau merged 1 commit intoNov 5, 2026
Merged
Conversation
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.
get_expected_errors()inconformance/src/main.pyis meant to reject a# E[tag]group that appears on only one line, asconformance/README.mddocuments ("must appear multiple times in a file with the same tag"). The check never runs, because each value ingroupsis a(linenos, multiplicity)tuple.len()of that tuple is always 2, solen(linenos) == 1is never true.As a result, a mistyped tag (for example
# E[final]on one line and# E[fianl]on the other) silently turns one "error on exactly one of these lines" group into two single-line groups. Each of them then requires an error on its own line, and a type checker that behaves correctly is scored as failing.This change unpacks the tuple so the check compares the number of lines. It also updates the docstring example, which still showed the old
boolvalue instead ofErrorMultiplicity.SINGLE.Testing
# E[typo]on one line and# E[good]on two lines,get_expected_errors()now raisesValueError: Error group typo only appears on a single line in .... Before the change it returned without an error.conformance/testsstill passes throughget_expected_errors()without errors (156 files), so no existing test needs changes and no results change.