Repository navigation
Lint text checks - #87
Merged
Merged
Conversation
YAML reads a backslash in double quotes as an escape, so LaTeX typed there decodes to control characters: \theta opens with a tab, \nu with a line break, \frac with a form feed. Update copies the value into the H1 and the parent's row, and lint said nothing. Lint now reports a double-quoted name, title, desc or category that holds a C0 control, DEL, U+0085, U+2028 or U+2029. The issue names the field, its line and each character, and gives the remedy. The generated copies are not scanned, so the finding stands once, on the file that holds the field. An escape that decodes to text is not reported. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A form feed in a page body is what is left of \frac once a tool decoded \f on the way in, and lint did not look at body text for it. Lint now notes a C0 control other than a tab or a line break, or DEL, in a page's body and in an index's text below the delimiter: one note per file, with the first line, its character and the count. Code is scanned too. The H1 and the link rows are generated from frontmatter fields, so they are not scanned and the damage is reported on the file that holds the field. A no-lint region is skipped, and lint.strict does not make the note an issue. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
An indented Key: value line under a bare desc: nests a mapping, and title: [Draft] is a list. The block is valid YAML, so lint was silent: update wrote the field's source lines into the H1 and the parent's row while every strict reader handed other tools a collection. Lint now reports a name, title, desc or category whose value is a mapping or a list. The issue names the field and its line, and says to quote the value or write it as a >- block. tags and sources are lists by design and are not judged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A double-quoted value with a backslash YAML cannot decode, such as "Uses \(p\) here" or "Uses $\xi$.", is a parse error, and lint advised "quote or rewrite the value" for a value that was quoted already. The strict reader's findings gain an escape cause: an unknown escape character, a bad \x or \u number, or a code that names no character. Lint says for it that a backslash starts an escape inside double quotes, and to write LaTeX in single quotes or a block scalar, or to double each backslash. Every other parse error keeps its advice. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
libyaml words a bad \x or \u number in a double-quoted value as "did not find expected hexdecimal number", and lint printed the reason as it came. The word is rewritten where the reason is worded, so the issue reads "hexadecimal" under either loader. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The merge is clean. The CHANGELOG's Unreleased section keeps both sides' lines. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The description section of the pages guide said lint does not report an indented Key: value line under a bare desc: key. Lint reports it as a nonscalar_field issue, as the frontmatter section of the same page says. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Lint checks a text field for a mapping or a list in a folder index as it does in a page, and the test wrote the field only into a page. It now runs for both, so the index-side check is pinned. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A double-quoted "\U00110000" names no character. The C loader rejects it as an invalid escape, and lint gives the quoting remedy on the escape's line. The pure-Python loader raises a bare ValueError from chr() instead, with no position, so the same value drew "quote or rewrite the value" on line 1 with the reason "ValueError". The reader now scans the body again when the pure loader raises that error, takes the line its scanner stopped on, and words the finding as the C loader does. A ValueError raised anywhere else keeps its report. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Lint judges the decoded value of a double-quoted text field, so a tab typed raw between the quotes, or the line break a blank line inside a multi-line value folds to, is reported with the backslash advice. The generation guide now says so, and the test holds the case. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
What changed
wiki lintreports a double-quotedname,title,descorcategorywhose value holds a control character: a C0 control (a tab and a line break included), DEL, U+0085, U+2028 or U+2029. YAML reads a backslash inside double quotes as an escape, so"$\frac{1}{2}$"holds a form feed, andwiki updatecopies it into the H1 and the parent index's row. The issue names the field, its line and each character once (U+000C (\f)), and says to write LaTeX in single quotes or a block scalar, or to double each backslash. Its kind in--jsoniscontrol_character. The decoded value is what is judged, so a control character typed raw between the quotes is the same finding. An escape that decodes to text (é,\") is not reported.wiki lintnotes a control character in authored content: a page's body, or an index's text below***. It covers the C0 controls other than a tab and a line break, and DEL. There is one note per file, with the first line and the count. Generated text (the H1, the link rows) is not scanned, and ano-lintregion is skipped. It stays a note underlint.strict. Its kind in--jsoniscontent_control_character. When several files hold one, the CLI prints one count line for the kind.wiki lintreports aname,title,descorcategorywhose YAML value is a mapping or a list, such as an indentedKey: valueline under a baredesc:. The issue names the field and its line, and says to quote the value or write it as a>-block. Its kind in--jsonisnonscalar_field.tagsandsourcesare lists by design and are not judged.\xor\unumber, a code that names no character), theinvalid_yamlissue now gives the same quoting remedy. Every other parse error keeps "quote or rewrite the value". The reason for a bad number spellshexadecimal. The C loader and the pure-Python loader give the same line, reason and remedy, for an escape past U+10FFFF too.format.read_frontmatter_fieldis not changed, and no written file changes.The CHANGELOG lines are under Unreleased (Added and Fixed).
docs/guide/generation.rst,docs/guide/pages.rst,docs/cli/index.rst,docs/recipes.rst,docs/guide/getting-started.rstand the skill describe the new findings.Tests
desc: "Bound on $\nu$ and $\theta$ and $\frac12$."is one issue, on its own page, and lint exits 1. The same text in single quotes, in a>-block or with doubled backslashes is clean, and so are"café"and"say \"x\"".tags) is not.lint --json. Two such pages print one count line. The same byte inside ano-lintregion draws nothing, and a parent index whose generated row holds the damage draws no second finding.desc:, a block list, a flow list and an empty flow mapping are each one issue, in a page and in an index.title: "Uses \(p\) here",desc: "Uses $\xi$.", a lone surrogate escape and"\U00110000"get the quoting remedy on the escape's line.pytest(3408 passed),pre-commit run --all-filesandpyright parity tests/test_parityare clean. The docs build withsphinx-build -W.