{{ message }}
Repository navigation
scdoc: require document preamble before guessing - #3409
Open
jnohclee-rgb wants to merge 1 commit into
Open
jnohclee-rgb wants to merge 1 commit into
jnohclee-rgb wants to merge 1 commit into
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.

Scdoc guessing currently gains confidence from any underscore or asterisk, even without its mandatory document header. Require the existing preamble match before applying those weak markup signals, preserving valid-header scores and tokenization.
Refs #2855. This removes false scdoc confidence for the reported Python snippet; it does not promise that short snippet will be recognized as Python.
Validation: 24 new regression cases cover missing/malformed headers, valid headers with optional fields and markup, and the reported underscore case. The new/guess suites passed (712 passed, 7 skipped); existing lexer API, regex lexer, and scdoc golden tests passed (2,455 passed, 8 skipped). Source checks and
git diff --checkpassed. Full tox was not run.AI assistance: Codex prepared this patch and tests, with a separate source review. No maintainer acceptance is implied.
Dharma — leave the code kinder than we found it.