chaffjs 0.17.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -56
- package/bin/chaff.js +17 -2
- package/dist/acronym-expansions.d.ts +26 -0
- package/dist/acronym-expansions.d.ts.map +1 -0
- package/dist/acronym-expansions.js +88 -0
- package/dist/acronym-expansions.js.map +1 -0
- package/dist/announced-count.d.ts +26 -0
- package/dist/announced-count.d.ts.map +1 -0
- package/dist/announced-count.js +138 -0
- package/dist/announced-count.js.map +1 -0
- package/dist/announced-list.d.ts +30 -0
- package/dist/announced-list.d.ts.map +1 -0
- package/dist/announced-list.js +95 -0
- package/dist/announced-list.js.map +1 -0
- package/dist/api.d.ts +168 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +10 -0
- package/dist/api.js.map +1 -0
- package/dist/bare-url.d.ts +14 -0
- package/dist/bare-url.d.ts.map +1 -0
- package/dist/bare-url.js +28 -0
- package/dist/bare-url.js.map +1 -0
- package/dist/baseline.d.ts +5 -0
- package/dist/baseline.d.ts.map +1 -1
- package/dist/baseline.js +16 -1
- package/dist/baseline.js.map +1 -1
- package/dist/body-section.d.ts +7 -0
- package/dist/body-section.d.ts.map +1 -0
- package/dist/body-section.js +6 -0
- package/dist/body-section.js.map +1 -0
- package/dist/calendar-number.d.ts +2 -0
- package/dist/calendar-number.d.ts.map +1 -1
- package/dist/calendar-number.js +9 -2
- package/dist/calendar-number.js.map +1 -1
- package/dist/cli-args.d.ts +4 -0
- package/dist/cli-args.d.ts.map +1 -1
- package/dist/cli-args.js +5 -0
- package/dist/cli-args.js.map +1 -1
- package/dist/cli-text.d.ts +0 -1
- package/dist/cli-text.d.ts.map +1 -1
- package/dist/cli-text.js +14 -18
- package/dist/cli-text.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +83 -84
- package/dist/cli.js.map +1 -1
- package/dist/closing-paragraph.d.ts +7 -0
- package/dist/closing-paragraph.d.ts.map +1 -0
- package/dist/closing-paragraph.js +22 -0
- package/dist/closing-paragraph.js.map +1 -0
- package/dist/commands/compare.d.ts +15 -0
- package/dist/commands/compare.d.ts.map +1 -0
- package/dist/commands/compare.js +64 -0
- package/dist/commands/compare.js.map +1 -0
- package/dist/commands/document-commands.d.ts +9 -0
- package/dist/commands/document-commands.d.ts.map +1 -0
- package/dist/commands/document-commands.js +17 -0
- package/dist/commands/document-commands.js.map +1 -0
- package/dist/commands/eval.d.ts.map +1 -1
- package/dist/commands/eval.js +19 -10
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/facts.d.ts +8 -0
- package/dist/commands/facts.d.ts.map +1 -0
- package/dist/commands/facts.js +30 -0
- package/dist/commands/facts.js.map +1 -0
- package/dist/commands/feedback.d.ts +15 -2
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js +36 -6
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/fix-plan.d.ts +13 -0
- package/dist/commands/fix-plan.d.ts.map +1 -0
- package/dist/commands/fix-plan.js +44 -0
- package/dist/commands/fix-plan.js.map +1 -0
- package/dist/commands/outline.d.ts +8 -0
- package/dist/commands/outline.d.ts.map +1 -0
- package/dist/commands/outline.js +43 -0
- package/dist/commands/outline.js.map +1 -0
- package/dist/commands/read-document.d.ts +14 -0
- package/dist/commands/read-document.d.ts.map +1 -0
- package/dist/commands/read-document.js +21 -0
- package/dist/commands/read-document.js.map +1 -0
- package/dist/commands/suppressions.d.ts +7 -0
- package/dist/commands/suppressions.d.ts.map +1 -0
- package/dist/commands/suppressions.js +9 -0
- package/dist/commands/suppressions.js.map +1 -0
- package/dist/commands/test.d.ts.map +1 -1
- package/dist/commands/test.js +3 -5
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/tree.d.ts +13 -0
- package/dist/commands/tree.d.ts.map +1 -1
- package/dist/commands/tree.js +35 -5
- package/dist/commands/tree.js.map +1 -1
- package/dist/compare/atom.d.ts +31 -0
- package/dist/compare/atom.d.ts.map +1 -0
- package/dist/compare/atom.js +4 -0
- package/dist/compare/atom.js.map +1 -0
- package/dist/compare/clock-time.d.ts +8 -0
- package/dist/compare/clock-time.d.ts.map +1 -0
- package/dist/compare/clock-time.js +68 -0
- package/dist/compare/clock-time.js.map +1 -0
- package/dist/compare/distinct.d.ts +9 -0
- package/dist/compare/distinct.d.ts.map +1 -0
- package/dist/compare/distinct.js +12 -0
- package/dist/compare/distinct.js.map +1 -0
- package/dist/compare/extract.d.ts +15 -0
- package/dist/compare/extract.d.ts.map +1 -0
- package/dist/compare/extract.js +60 -0
- package/dist/compare/extract.js.map +1 -0
- package/dist/compare/fact-key.d.ts +17 -0
- package/dist/compare/fact-key.d.ts.map +1 -0
- package/dist/compare/fact-key.js +25 -0
- package/dist/compare/fact-key.js.map +1 -0
- package/dist/compare/fact-text.d.ts +28 -0
- package/dist/compare/fact-text.d.ts.map +1 -0
- package/dist/compare/fact-text.js +61 -0
- package/dist/compare/fact-text.js.map +1 -0
- package/dist/compare/facts-render.d.ts +17 -0
- package/dist/compare/facts-render.d.ts.map +1 -0
- package/dist/compare/facts-render.js +43 -0
- package/dist/compare/facts-render.js.map +1 -0
- package/dist/compare/facts-text.d.ts +15 -0
- package/dist/compare/facts-text.d.ts.map +1 -0
- package/dist/compare/facts-text.js +27 -0
- package/dist/compare/facts-text.js.map +1 -0
- package/dist/compare/markup-atoms.d.ts +11 -0
- package/dist/compare/markup-atoms.d.ts.map +1 -0
- package/dist/compare/markup-atoms.js +23 -0
- package/dist/compare/markup-atoms.js.map +1 -0
- package/dist/compare/match.d.ts +20 -0
- package/dist/compare/match.d.ts.map +1 -0
- package/dist/compare/match.js +84 -0
- package/dist/compare/match.js.map +1 -0
- package/dist/compare/outcome.d.ts +36 -0
- package/dist/compare/outcome.d.ts.map +1 -0
- package/dist/compare/outcome.js +46 -0
- package/dist/compare/outcome.js.map +1 -0
- package/dist/compare/proper-nouns.d.ts +19 -0
- package/dist/compare/proper-nouns.d.ts.map +1 -0
- package/dist/compare/proper-nouns.js +43 -0
- package/dist/compare/proper-nouns.js.map +1 -0
- package/dist/compare/render.d.ts +13 -0
- package/dist/compare/render.d.ts.map +1 -0
- package/dist/compare/render.js +64 -0
- package/dist/compare/render.js.map +1 -0
- package/dist/compare/spans.d.ts +9 -0
- package/dist/compare/spans.d.ts.map +1 -0
- package/dist/compare/spans.js +11 -0
- package/dist/compare/spans.js.map +1 -0
- package/dist/compare/text-atoms.d.ts +27 -0
- package/dist/compare/text-atoms.d.ts.map +1 -0
- package/dist/compare/text-atoms.js +69 -0
- package/dist/compare/text-atoms.js.map +1 -0
- package/dist/compare/text.d.ts +24 -0
- package/dist/compare/text.d.ts.map +1 -0
- package/dist/compare/text.js +90 -0
- package/dist/compare/text.js.map +1 -0
- package/dist/compare/tree-atoms.d.ts +20 -0
- package/dist/compare/tree-atoms.d.ts.map +1 -0
- package/dist/compare/tree-atoms.js +58 -0
- package/dist/compare/tree-atoms.js.map +1 -0
- package/dist/compare/written-names.d.ts +8 -0
- package/dist/compare/written-names.d.ts.map +1 -0
- package/dist/compare/written-names.js +24 -0
- package/dist/compare/written-names.js.map +1 -0
- package/dist/config/load.d.ts +23 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +6 -0
- package/dist/config/load.js.map +1 -1
- package/dist/config/option-problems.d.ts +17 -0
- package/dist/config/option-problems.d.ts.map +1 -0
- package/dist/config/option-problems.js +59 -0
- package/dist/config/option-problems.js.map +1 -0
- package/dist/config/read.d.ts +4 -0
- package/dist/config/read.d.ts.map +1 -0
- package/dist/config/read.js +8 -0
- package/dist/config/read.js.map +1 -0
- package/dist/config/rule-problems.d.ts +2 -4
- package/dist/config/rule-problems.d.ts.map +1 -1
- package/dist/config/rule-problems.js +7 -1
- package/dist/config/rule-problems.js.map +1 -1
- package/dist/config/style.d.ts +21 -0
- package/dist/config/style.d.ts.map +1 -0
- package/dist/config/style.js +48 -0
- package/dist/config/style.js.map +1 -0
- package/dist/config/warnings.d.ts +6 -0
- package/dist/config/warnings.d.ts.map +1 -0
- package/dist/config/warnings.js +10 -0
- package/dist/config/warnings.js.map +1 -0
- package/dist/config/write.d.ts.map +1 -1
- package/dist/config/write.js +17 -4
- package/dist/config/write.js.map +1 -1
- package/dist/custom/bounded-match.d.ts +15 -0
- package/dist/custom/bounded-match.d.ts.map +1 -0
- package/dist/custom/bounded-match.js +43 -0
- package/dist/custom/bounded-match.js.map +1 -0
- package/dist/custom/load.d.ts +11 -0
- package/dist/custom/load.d.ts.map +1 -0
- package/dist/custom/load.js +19 -0
- package/dist/custom/load.js.map +1 -0
- package/dist/custom/module-path.d.ts +11 -0
- package/dist/custom/module-path.d.ts.map +1 -0
- package/dist/custom/module-path.js +15 -0
- package/dist/custom/module-path.js.map +1 -0
- package/dist/custom/parse.d.ts +84 -0
- package/dist/custom/parse.d.ts.map +1 -0
- package/dist/custom/parse.js +258 -0
- package/dist/custom/parse.js.map +1 -0
- package/dist/custom/problems.d.ts +8 -0
- package/dist/custom/problems.d.ts.map +1 -0
- package/dist/custom/problems.js +95 -0
- package/dist/custom/problems.js.map +1 -0
- package/dist/custom/regex-safety.d.ts +11 -0
- package/dist/custom/regex-safety.d.ts.map +1 -0
- package/dist/custom/regex-safety.js +110 -0
- package/dist/custom/regex-safety.js.map +1 -0
- package/dist/custom/token-pattern.d.ts +8 -0
- package/dist/custom/token-pattern.d.ts.map +1 -0
- package/dist/custom/token-pattern.js +75 -0
- package/dist/custom/token-pattern.js.map +1 -0
- package/dist/detect-language.js +1 -1
- package/dist/detect.d.ts.map +1 -1
- package/dist/detect.js +30 -2
- package/dist/detect.js.map +1 -1
- package/dist/detectors/acronym-context.d.ts +2 -0
- package/dist/detectors/acronym-context.d.ts.map +1 -1
- package/dist/detectors/acronym-context.js +12 -4
- package/dist/detectors/acronym-context.js.map +1 -1
- package/dist/detectors/ai-phrasing.d.ts +23 -0
- package/dist/detectors/ai-phrasing.d.ts.map +1 -0
- package/dist/detectors/ai-phrasing.js +116 -0
- package/dist/detectors/ai-phrasing.js.map +1 -0
- package/dist/detectors/announced-count.d.ts +4 -0
- package/dist/detectors/announced-count.d.ts.map +1 -0
- package/dist/detectors/announced-count.js +20 -0
- package/dist/detectors/announced-count.js.map +1 -0
- package/dist/detectors/bold-label.d.ts +10 -0
- package/dist/detectors/bold-label.d.ts.map +1 -0
- package/dist/detectors/bold-label.js +44 -0
- package/dist/detectors/bold-label.js.map +1 -0
- package/dist/detectors/broken-link.d.ts +17 -0
- package/dist/detectors/broken-link.d.ts.map +1 -0
- package/dist/detectors/broken-link.js +66 -0
- package/dist/detectors/broken-link.js.map +1 -0
- package/dist/detectors/cited-name.d.ts.map +1 -1
- package/dist/detectors/cited-name.js +4 -4
- package/dist/detectors/cited-name.js.map +1 -1
- package/dist/detectors/cited-title.d.ts +11 -0
- package/dist/detectors/cited-title.d.ts.map +1 -0
- package/dist/detectors/cited-title.js +75 -0
- package/dist/detectors/cited-title.js.map +1 -0
- package/dist/detectors/concrete-evidence.d.ts +1 -1
- package/dist/detectors/concrete-evidence.d.ts.map +1 -1
- package/dist/detectors/concrete-evidence.js +2 -1
- package/dist/detectors/concrete-evidence.js.map +1 -1
- package/dist/detectors/contrast-frame.d.ts +17 -0
- package/dist/detectors/contrast-frame.d.ts.map +1 -0
- package/dist/detectors/contrast-frame.js +32 -0
- package/dist/detectors/contrast-frame.js.map +1 -0
- package/dist/detectors/custom.d.ts +8 -0
- package/dist/detectors/custom.d.ts.map +1 -0
- package/dist/detectors/custom.js +71 -0
- package/dist/detectors/custom.js.map +1 -0
- package/dist/detectors/dangling-figure.d.ts +7 -0
- package/dist/detectors/dangling-figure.d.ts.map +1 -0
- package/dist/detectors/dangling-figure.js +20 -0
- package/dist/detectors/dangling-figure.js.map +1 -0
- package/dist/detectors/definition-use.d.ts +8 -0
- package/dist/detectors/definition-use.d.ts.map +1 -0
- package/dist/detectors/definition-use.js +32 -0
- package/dist/detectors/definition-use.js.map +1 -0
- package/dist/detectors/doubled-punctuation.d.ts +9 -0
- package/dist/detectors/doubled-punctuation.d.ts.map +1 -0
- package/dist/detectors/doubled-punctuation.js +35 -0
- package/dist/detectors/doubled-punctuation.js.map +1 -0
- package/dist/detectors/doubled-word.d.ts +5 -0
- package/dist/detectors/doubled-word.d.ts.map +1 -1
- package/dist/detectors/doubled-word.js +24 -11
- package/dist/detectors/doubled-word.js.map +1 -1
- package/dist/detectors/duplicate-heading.d.ts +14 -0
- package/dist/detectors/duplicate-heading.d.ts.map +1 -0
- package/dist/detectors/duplicate-heading.js +39 -0
- package/dist/detectors/duplicate-heading.js.map +1 -0
- package/dist/detectors/empty-section.d.ts +8 -0
- package/dist/detectors/empty-section.d.ts.map +1 -0
- package/dist/detectors/empty-section.js +16 -0
- package/dist/detectors/empty-section.js.map +1 -0
- package/dist/detectors/enumerated-runs.d.ts +1 -1
- package/dist/detectors/enumerated-runs.d.ts.map +1 -1
- package/dist/detectors/enumerated-runs.js +15 -4
- package/dist/detectors/enumerated-runs.js.map +1 -1
- package/dist/detectors/fullwidth-alnum.d.ts +24 -0
- package/dist/detectors/fullwidth-alnum.d.ts.map +1 -0
- package/dist/detectors/fullwidth-alnum.js +88 -0
- package/dist/detectors/fullwidth-alnum.js.map +1 -0
- package/dist/detectors/gram-furniture.d.ts +6 -0
- package/dist/detectors/gram-furniture.d.ts.map +1 -0
- package/dist/detectors/gram-furniture.js +21 -0
- package/dist/detectors/gram-furniture.js.map +1 -0
- package/dist/detectors/gram-place.d.ts +2 -0
- package/dist/detectors/gram-place.d.ts.map +1 -1
- package/dist/detectors/gram-place.js +9 -7
- package/dist/detectors/gram-place.js.map +1 -1
- package/dist/detectors/gram-windows.d.ts +9 -0
- package/dist/detectors/gram-windows.d.ts.map +1 -0
- package/dist/detectors/gram-windows.js +27 -0
- package/dist/detectors/gram-windows.js.map +1 -0
- package/dist/detectors/hankaku-kana.d.ts +9 -0
- package/dist/detectors/hankaku-kana.d.ts.map +1 -0
- package/dist/detectors/hankaku-kana.js +27 -0
- package/dist/detectors/hankaku-kana.js.map +1 -0
- package/dist/detectors/heading-case.d.ts +2 -0
- package/dist/detectors/heading-case.d.ts.map +1 -1
- package/dist/detectors/heading-case.js +29 -2
- package/dist/detectors/heading-case.js.map +1 -1
- package/dist/detectors/heading-code-words.d.ts +6 -0
- package/dist/detectors/heading-code-words.d.ts.map +1 -0
- package/dist/detectors/heading-code-words.js +29 -0
- package/dist/detectors/heading-code-words.js.map +1 -0
- package/dist/detectors/heading-echo.d.ts.map +1 -1
- package/dist/detectors/heading-echo.js +7 -4
- package/dist/detectors/heading-echo.js.map +1 -1
- package/dist/detectors/heading-level-skip.d.ts +12 -0
- package/dist/detectors/heading-level-skip.d.ts.map +1 -0
- package/dist/detectors/heading-level-skip.js +11 -0
- package/dist/detectors/heading-level-skip.js.map +1 -0
- package/dist/detectors/image-alt-text.d.ts +3 -0
- package/dist/detectors/image-alt-text.d.ts.map +1 -0
- package/dist/detectors/image-alt-text.js +9 -0
- package/dist/detectors/image-alt-text.js.map +1 -0
- package/dist/detectors/index.d.ts.map +1 -1
- package/dist/detectors/index.js +70 -1
- package/dist/detectors/index.js.map +1 -1
- package/dist/detectors/invisible-character.d.ts +20 -0
- package/dist/detectors/invisible-character.d.ts.map +1 -0
- package/dist/detectors/invisible-character.js +143 -0
- package/dist/detectors/invisible-character.js.map +1 -0
- package/dist/detectors/kutoten-consistency.d.ts +24 -0
- package/dist/detectors/kutoten-consistency.d.ts.map +1 -0
- package/dist/detectors/kutoten-consistency.js +77 -0
- package/dist/detectors/kutoten-consistency.js.map +1 -0
- package/dist/detectors/lead-in.d.ts +1 -0
- package/dist/detectors/lead-in.d.ts.map +1 -1
- package/dist/detectors/lead-in.js +2 -1
- package/dist/detectors/lead-in.js.map +1 -1
- package/dist/detectors/lexicon-match.d.ts +14 -1
- package/dist/detectors/lexicon-match.d.ts.map +1 -1
- package/dist/detectors/lexicon-match.js +32 -2
- package/dist/detectors/lexicon-match.js.map +1 -1
- package/dist/detectors/lexicon.d.ts +6 -1
- package/dist/detectors/lexicon.d.ts.map +1 -1
- package/dist/detectors/lexicon.js +31 -13
- package/dist/detectors/lexicon.js.map +1 -1
- package/dist/detectors/list-item.d.ts +45 -0
- package/dist/detectors/list-item.d.ts.map +1 -0
- package/dist/detectors/list-item.js +88 -0
- package/dist/detectors/list-item.js.map +1 -0
- package/dist/detectors/list-items.d.ts +31 -0
- package/dist/detectors/list-items.d.ts.map +1 -0
- package/dist/detectors/list-items.js +113 -0
- package/dist/detectors/list-items.js.map +1 -0
- package/dist/detectors/list-lead-in.d.ts +7 -0
- package/dist/detectors/list-lead-in.d.ts.map +1 -0
- package/dist/detectors/list-lead-in.js +28 -0
- package/dist/detectors/list-lead-in.js.map +1 -0
- package/dist/detectors/list-sentence.d.ts +67 -0
- package/dist/detectors/list-sentence.d.ts.map +1 -0
- package/dist/detectors/list-sentence.js +130 -0
- package/dist/detectors/list-sentence.js.map +1 -0
- package/dist/detectors/list-view.d.ts +34 -0
- package/dist/detectors/list-view.d.ts.map +1 -0
- package/dist/detectors/list-view.js +137 -0
- package/dist/detectors/list-view.js.map +1 -0
- package/dist/detectors/long-vowel.d.ts +7 -0
- package/dist/detectors/long-vowel.d.ts.map +1 -0
- package/dist/detectors/long-vowel.js +71 -0
- package/dist/detectors/long-vowel.js.map +1 -0
- package/dist/detectors/markup-finding.d.ts +8 -0
- package/dist/detectors/markup-finding.d.ts.map +1 -0
- package/dist/detectors/markup-finding.js +29 -0
- package/dist/detectors/markup-finding.js.map +1 -0
- package/dist/detectors/modal-conflict.d.ts +4 -0
- package/dist/detectors/modal-conflict.d.ts.map +1 -0
- package/dist/detectors/modal-conflict.js +22 -0
- package/dist/detectors/modal-conflict.js.map +1 -0
- package/dist/detectors/name-numeral.d.ts +1 -1
- package/dist/detectors/name-numeral.d.ts.map +1 -1
- package/dist/detectors/name-numeral.js +2 -7
- package/dist/detectors/name-numeral.js.map +1 -1
- package/dist/detectors/name-variant.d.ts +4 -0
- package/dist/detectors/name-variant.d.ts.map +1 -0
- package/dist/detectors/name-variant.js +13 -0
- package/dist/detectors/name-variant.js.map +1 -0
- package/dist/detectors/nominalization.d.ts +11 -0
- package/dist/detectors/nominalization.d.ts.map +1 -0
- package/dist/detectors/nominalization.js +56 -0
- package/dist/detectors/nominalization.js.map +1 -0
- package/dist/detectors/orthography.d.ts.map +1 -1
- package/dist/detectors/orthography.js +72 -37
- package/dist/detectors/orthography.js.map +1 -1
- package/dist/detectors/outside-announced-list.d.ts +4 -0
- package/dist/detectors/outside-announced-list.d.ts.map +1 -0
- package/dist/detectors/outside-announced-list.js +24 -0
- package/dist/detectors/outside-announced-list.js.map +1 -0
- package/dist/detectors/oxford-comma.d.ts +7 -1
- package/dist/detectors/oxford-comma.d.ts.map +1 -1
- package/dist/detectors/oxford-comma.js +136 -229
- package/dist/detectors/oxford-comma.js.map +1 -1
- package/dist/detectors/phrase-match.d.ts +4 -1
- package/dist/detectors/phrase-match.d.ts.map +1 -1
- package/dist/detectors/phrase-match.js +26 -7
- package/dist/detectors/phrase-match.js.map +1 -1
- package/dist/detectors/place-run.d.ts.map +1 -1
- package/dist/detectors/place-run.js +10 -6
- package/dist/detectors/place-run.js.map +1 -1
- package/dist/detectors/placeholder-text.d.ts +9 -0
- package/dist/detectors/placeholder-text.d.ts.map +1 -0
- package/dist/detectors/placeholder-text.js +18 -0
- package/dist/detectors/placeholder-text.js.map +1 -0
- package/dist/detectors/quote-around.d.ts +3 -0
- package/dist/detectors/quote-around.d.ts.map +1 -0
- package/dist/detectors/quote-around.js +8 -0
- package/dist/detectors/quote-around.js.map +1 -0
- package/dist/detectors/ra-nuki.d.ts +9 -0
- package/dist/detectors/ra-nuki.d.ts.map +1 -0
- package/dist/detectors/ra-nuki.js +30 -0
- package/dist/detectors/ra-nuki.js.map +1 -0
- package/dist/detectors/register.d.ts +11 -3
- package/dist/detectors/register.d.ts.map +1 -1
- package/dist/detectors/register.js +28 -9
- package/dist/detectors/register.js.map +1 -1
- package/dist/detectors/requirement-modal.d.ts +5 -0
- package/dist/detectors/requirement-modal.d.ts.map +1 -0
- package/dist/detectors/requirement-modal.js +54 -0
- package/dist/detectors/requirement-modal.js.map +1 -0
- package/dist/detectors/requirement-smell.d.ts +4 -0
- package/dist/detectors/requirement-smell.d.ts.map +1 -0
- package/dist/detectors/requirement-smell.js +41 -0
- package/dist/detectors/requirement-smell.js.map +1 -0
- package/dist/detectors/roman-numeral.d.ts +2 -0
- package/dist/detectors/roman-numeral.d.ts.map +1 -1
- package/dist/detectors/roman-numeral.js +2 -0
- package/dist/detectors/roman-numeral.js.map +1 -1
- package/dist/detectors/sentence-ending.d.ts +17 -1
- package/dist/detectors/sentence-ending.d.ts.map +1 -1
- package/dist/detectors/sentence-ending.js +13 -7
- package/dist/detectors/sentence-ending.js.map +1 -1
- package/dist/detectors/sentence-length.d.ts.map +1 -1
- package/dist/detectors/sentence-length.js +13 -4
- package/dist/detectors/sentence-length.js.map +1 -1
- package/dist/detectors/signals.d.ts +8 -0
- package/dist/detectors/signals.d.ts.map +1 -1
- package/dist/detectors/signals.js +67 -46
- package/dist/detectors/signals.js.map +1 -1
- package/dist/detectors/space-before-punctuation.d.ts +8 -0
- package/dist/detectors/space-before-punctuation.d.ts.map +1 -0
- package/dist/detectors/space-before-punctuation.js +24 -0
- package/dist/detectors/space-before-punctuation.js.map +1 -0
- package/dist/detectors/spelling-variety.d.ts +23 -0
- package/dist/detectors/spelling-variety.d.ts.map +1 -0
- package/dist/detectors/spelling-variety.js +59 -0
- package/dist/detectors/spelling-variety.js.map +1 -0
- package/dist/detectors/structure-tree.d.ts +6 -0
- package/dist/detectors/structure-tree.d.ts.map +1 -1
- package/dist/detectors/structure-tree.js +39 -1
- package/dist/detectors/structure-tree.js.map +1 -1
- package/dist/detectors/structure.d.ts +1 -3
- package/dist/detectors/structure.d.ts.map +1 -1
- package/dist/detectors/structure.js +19 -6
- package/dist/detectors/structure.js.map +1 -1
- package/dist/detectors/superlative-comparison.d.ts +20 -0
- package/dist/detectors/superlative-comparison.d.ts.map +1 -0
- package/dist/detectors/superlative-comparison.js +32 -0
- package/dist/detectors/superlative-comparison.js.map +1 -0
- package/dist/detectors/superlative-name.d.ts.map +1 -1
- package/dist/detectors/superlative-name.js +8 -5
- package/dist/detectors/superlative-name.js.map +1 -1
- package/dist/detectors/superlative-scope.d.ts.map +1 -1
- package/dist/detectors/superlative-scope.js +9 -4
- package/dist/detectors/superlative-scope.js.map +1 -1
- package/dist/detectors/token-column.d.ts +46 -0
- package/dist/detectors/token-column.d.ts.map +1 -0
- package/dist/detectors/token-column.js +95 -0
- package/dist/detectors/token-column.js.map +1 -0
- package/dist/detectors/unbalanced-bracket.d.ts +22 -0
- package/dist/detectors/unbalanced-bracket.d.ts.map +1 -0
- package/dist/detectors/unbalanced-bracket.js +119 -0
- package/dist/detectors/unbalanced-bracket.js.map +1 -0
- package/dist/detectors/url-run-on.d.ts +9 -0
- package/dist/detectors/url-run-on.d.ts.map +1 -0
- package/dist/detectors/url-run-on.js +24 -0
- package/dist/detectors/url-run-on.js.map +1 -0
- package/dist/detectors/vague-figure-pointer.d.ts +10 -0
- package/dist/detectors/vague-figure-pointer.d.ts.map +1 -0
- package/dist/detectors/vague-figure-pointer.js +46 -0
- package/dist/detectors/vague-figure-pointer.js.map +1 -0
- package/dist/detectors/word-list.d.ts +2 -0
- package/dist/detectors/word-list.d.ts.map +1 -1
- package/dist/detectors/word-list.js +4 -1
- package/dist/detectors/word-list.js.map +1 -1
- package/dist/document-sections.d.ts +13 -0
- package/dist/document-sections.d.ts.map +1 -0
- package/dist/document-sections.js +32 -0
- package/dist/document-sections.js.map +1 -0
- package/dist/document.d.ts +20 -7
- package/dist/document.d.ts.map +1 -1
- package/dist/document.js +140 -125
- package/dist/document.js.map +1 -1
- package/dist/email-parts.d.ts +28 -0
- package/dist/email-parts.d.ts.map +1 -0
- package/dist/email-parts.js +230 -0
- package/dist/email-parts.js.map +1 -0
- package/dist/eval.d.ts +2 -1
- package/dist/eval.d.ts.map +1 -1
- package/dist/eval.js +16 -4
- package/dist/eval.js.map +1 -1
- package/dist/extension/document-view.d.ts +7 -0
- package/dist/extension/document-view.d.ts.map +1 -0
- package/dist/extension/document-view.js +91 -0
- package/dist/extension/document-view.js.map +1 -0
- package/dist/extension/failure-text.d.ts +5 -0
- package/dist/extension/failure-text.d.ts.map +1 -0
- package/dist/extension/failure-text.js +33 -0
- package/dist/extension/failure-text.js.map +1 -0
- package/dist/extension/import-default.d.ts +7 -0
- package/dist/extension/import-default.d.ts.map +1 -0
- package/dist/extension/import-default.js +21 -0
- package/dist/extension/import-default.js.map +1 -0
- package/dist/extension/load.d.ts +28 -0
- package/dist/extension/load.d.ts.map +1 -0
- package/dist/extension/load.js +51 -0
- package/dist/extension/load.js.map +1 -0
- package/dist/extension/module-detector.d.ts +21 -0
- package/dist/extension/module-detector.d.ts.map +1 -0
- package/dist/extension/module-detector.js +49 -0
- package/dist/extension/module-detector.js.map +1 -0
- package/dist/extension/plugin-load.d.ts +9 -0
- package/dist/extension/plugin-load.d.ts.map +1 -0
- package/dist/extension/plugin-load.js +68 -0
- package/dist/extension/plugin-load.js.map +1 -0
- package/dist/extension/plugin-name.d.ts +8 -0
- package/dist/extension/plugin-name.d.ts.map +1 -0
- package/dist/extension/plugin-name.js +22 -0
- package/dist/extension/plugin-name.js.map +1 -0
- package/dist/extension/plugin-parse.d.ts +41 -0
- package/dist/extension/plugin-parse.d.ts.map +1 -0
- package/dist/extension/plugin-parse.js +156 -0
- package/dist/extension/plugin-parse.js.map +1 -0
- package/dist/extension/problem-text.d.ts +5 -0
- package/dist/extension/problem-text.d.ts.map +1 -0
- package/dist/extension/problem-text.js +74 -0
- package/dist/extension/problem-text.js.map +1 -0
- package/dist/extension/real-path.d.ts +3 -0
- package/dist/extension/real-path.d.ts.map +1 -0
- package/dist/extension/real-path.js +8 -0
- package/dist/extension/real-path.js.map +1 -0
- package/dist/extension/returned-findings.d.ts +17 -0
- package/dist/extension/returned-findings.d.ts.map +1 -0
- package/dist/extension/returned-findings.js +48 -0
- package/dist/extension/returned-findings.js.map +1 -0
- package/dist/extension/rule-export.d.ts +13 -0
- package/dist/extension/rule-export.d.ts.map +1 -0
- package/dist/extension/rule-export.js +16 -0
- package/dist/extension/rule-export.js.map +1 -0
- package/dist/feedback/draft.d.ts +2 -0
- package/dist/feedback/draft.d.ts.map +1 -1
- package/dist/feedback/draft.js +3 -0
- package/dist/feedback/draft.js.map +1 -1
- package/dist/figure-references.d.ts +39 -0
- package/dist/figure-references.d.ts.map +1 -0
- package/dist/figure-references.js +113 -0
- package/dist/figure-references.js.map +1 -0
- package/dist/files.d.ts +2 -0
- package/dist/files.d.ts.map +1 -1
- package/dist/files.js +4 -0
- package/dist/files.js.map +1 -1
- package/dist/finding-order.d.ts +9 -0
- package/dist/finding-order.d.ts.map +1 -0
- package/dist/finding-order.js +3 -0
- package/dist/finding-order.js.map +1 -0
- package/dist/fix-plan/mode.d.ts +21 -0
- package/dist/fix-plan/mode.d.ts.map +1 -0
- package/dist/fix-plan/mode.js +16 -0
- package/dist/fix-plan/mode.js.map +1 -0
- package/dist/fix-plan/plan.d.ts +77 -0
- package/dist/fix-plan/plan.d.ts.map +1 -0
- package/dist/fix-plan/plan.js +100 -0
- package/dist/fix-plan/plan.js.map +1 -0
- package/dist/fix-plan/render.d.ts +6 -0
- package/dist/fix-plan/render.d.ts.map +1 -0
- package/dist/fix-plan/render.js +101 -0
- package/dist/fix-plan/render.js.map +1 -0
- package/dist/fix-plan/text.d.ts +35 -0
- package/dist/fix-plan/text.d.ts.map +1 -0
- package/dist/fix-plan/text.js +95 -0
- package/dist/fix-plan/text.js.map +1 -0
- package/dist/heading-label.d.ts +22 -0
- package/dist/heading-label.d.ts.map +1 -0
- package/dist/heading-label.js +50 -0
- package/dist/heading-label.js.map +1 -0
- package/dist/in-page-nav.d.ts +4 -1
- package/dist/in-page-nav.d.ts.map +1 -1
- package/dist/in-page-nav.js +53 -18
- package/dist/in-page-nav.js.map +1 -1
- package/dist/joined-view.d.ts.map +1 -1
- package/dist/joined-view.js +1 -0
- package/dist/joined-view.js.map +1 -1
- package/dist/language-sample.d.ts +2 -0
- package/dist/language-sample.d.ts.map +1 -0
- package/dist/language-sample.js +41 -0
- package/dist/language-sample.js.map +1 -0
- package/dist/levels.d.ts +5 -1
- package/dist/levels.d.ts.map +1 -1
- package/dist/levels.js +9 -0
- package/dist/levels.js.map +1 -1
- package/dist/line-paragraphs.d.ts +8 -0
- package/dist/line-paragraphs.d.ts.map +1 -1
- package/dist/line-paragraphs.js +33 -10
- package/dist/line-paragraphs.js.map +1 -1
- package/dist/link-line.d.ts +8 -0
- package/dist/link-line.d.ts.map +1 -0
- package/dist/link-line.js +12 -0
- package/dist/link-line.js.map +1 -0
- package/dist/long-vowel.d.ts +38 -0
- package/dist/long-vowel.d.ts.map +1 -0
- package/dist/long-vowel.js +78 -0
- package/dist/long-vowel.js.map +1 -0
- package/dist/markdown-node.d.ts +19 -0
- package/dist/markdown-node.d.ts.map +1 -0
- package/dist/markdown-node.js +6 -0
- package/dist/markdown-node.js.map +1 -0
- package/dist/markdown-read.d.ts +17 -0
- package/dist/markdown-read.d.ts.map +1 -0
- package/dist/markdown-read.js +37 -0
- package/dist/markdown-read.js.map +1 -0
- package/dist/markup.d.ts +22 -0
- package/dist/markup.d.ts.map +1 -0
- package/dist/markup.js +182 -0
- package/dist/markup.js.map +1 -0
- package/dist/mask.js +8 -5
- package/dist/mask.js.map +1 -1
- package/dist/name-variants.d.ts +25 -0
- package/dist/name-variants.d.ts.map +1 -0
- package/dist/name-variants.js +181 -0
- package/dist/name-variants.js.map +1 -0
- package/dist/node-version.d.ts +7 -0
- package/dist/node-version.d.ts.map +1 -0
- package/dist/node-version.js +19 -0
- package/dist/node-version.js.map +1 -0
- package/dist/not-run.d.ts +14 -0
- package/dist/not-run.d.ts.map +1 -0
- package/dist/not-run.js +12 -0
- package/dist/not-run.js.map +1 -0
- package/dist/number-name.d.ts +21 -5
- package/dist/number-name.d.ts.map +1 -1
- package/dist/number-name.js +119 -17
- package/dist/number-name.js.map +1 -1
- package/dist/orthography.d.ts +10 -1
- package/dist/orthography.d.ts.map +1 -1
- package/dist/orthography.js +42 -16
- package/dist/orthography.js.map +1 -1
- package/dist/outline/render.d.ts +18 -0
- package/dist/outline/render.d.ts.map +1 -0
- package/dist/outline/render.js +60 -0
- package/dist/outline/render.js.map +1 -0
- package/dist/outline/shape.d.ts +26 -0
- package/dist/outline/shape.d.ts.map +1 -0
- package/dist/outline/shape.js +37 -0
- package/dist/outline/shape.js.map +1 -0
- package/dist/outline/text.d.ts +21 -0
- package/dist/outline/text.d.ts.map +1 -0
- package/dist/outline/text.js +30 -0
- package/dist/outline/text.js.map +1 -0
- package/dist/page-furniture.d.ts +5 -2
- package/dist/page-furniture.d.ts.map +1 -1
- package/dist/page-furniture.js +8 -2
- package/dist/page-furniture.js.map +1 -1
- package/dist/plain-source.d.ts +1 -0
- package/dist/plain-source.d.ts.map +1 -1
- package/dist/plain-source.js +2 -1
- package/dist/plain-source.js.map +1 -1
- package/dist/plugin.d.ts +138 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/profile/for-file.d.ts.map +1 -1
- package/dist/profile/for-file.js +3 -1
- package/dist/profile/for-file.js.map +1 -1
- package/dist/quoted-span.d.ts.map +1 -1
- package/dist/quoted-span.js +8 -3
- package/dist/quoted-span.js.map +1 -1
- package/dist/reasons.d.ts +4 -0
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +8 -0
- package/dist/reasons.js.map +1 -1
- package/dist/reference-lists.d.ts +3 -0
- package/dist/reference-lists.d.ts.map +1 -0
- package/dist/reference-lists.js +75 -0
- package/dist/reference-lists.js.map +1 -0
- package/dist/render/compact.d.ts +3 -1
- package/dist/render/compact.d.ts.map +1 -1
- package/dist/render/compact.js +8 -2
- package/dist/render/compact.js.map +1 -1
- package/dist/render/explain.d.ts +9 -1
- package/dist/render/explain.d.ts.map +1 -1
- package/dist/render/explain.js +54 -13
- package/dist/render/explain.js.map +1 -1
- package/dist/render/friendly.d.ts.map +1 -1
- package/dist/render/friendly.js +19 -9
- package/dist/render/friendly.js.map +1 -1
- package/dist/render/options.d.ts +7 -0
- package/dist/render/options.d.ts.map +1 -0
- package/dist/render/options.js +50 -0
- package/dist/render/options.js.map +1 -0
- package/dist/render/rules-json.d.ts +4 -1
- package/dist/render/rules-json.d.ts.map +1 -1
- package/dist/render/rules-json.js +110 -16
- package/dist/render/rules-json.js.map +1 -1
- package/dist/render/rules-table.d.ts +4 -0
- package/dist/render/rules-table.d.ts.map +1 -0
- package/dist/render/rules-table.js +70 -0
- package/dist/render/rules-table.js.map +1 -0
- package/dist/render/sarif.js +4 -4
- package/dist/render/sarif.js.map +1 -1
- package/dist/render/semantic.js +3 -3
- package/dist/render/semantic.js.map +1 -1
- package/dist/render/severity-name.d.ts +6 -0
- package/dist/render/severity-name.d.ts.map +1 -0
- package/dist/render/severity-name.js +7 -0
- package/dist/render/severity-name.js.map +1 -0
- package/dist/render/suppressions.d.ts +3 -0
- package/dist/render/suppressions.d.ts.map +1 -1
- package/dist/render/suppressions.js +20 -1
- package/dist/render/suppressions.js.map +1 -1
- package/dist/render/text.d.ts +7 -2
- package/dist/render/text.d.ts.map +1 -1
- package/dist/render/text.js +15 -4
- package/dist/render/text.js.map +1 -1
- package/dist/resolve-genre.d.ts +1 -1
- package/dist/resolve-genre.d.ts.map +1 -1
- package/dist/resolve-genre.js +4 -1
- package/dist/resolve-genre.js.map +1 -1
- package/dist/rule-genres.d.ts +24 -0
- package/dist/rule-genres.d.ts.map +1 -0
- package/dist/rule-genres.js +11 -0
- package/dist/rule-genres.js.map +1 -0
- package/dist/rule-guide.d.ts +73 -0
- package/dist/rule-guide.d.ts.map +1 -0
- package/dist/rule-guide.js +95 -0
- package/dist/rule-guide.js.map +1 -0
- package/dist/rule-load.d.ts.map +1 -1
- package/dist/rule-load.js +87 -33
- package/dist/rule-load.js.map +1 -1
- package/dist/rule-options.d.ts +50 -0
- package/dist/rule-options.d.ts.map +1 -0
- package/dist/rule-options.js +106 -0
- package/dist/rule-options.js.map +1 -0
- package/dist/run-semantic.d.ts.map +1 -1
- package/dist/run-semantic.js +2 -1
- package/dist/run-semantic.js.map +1 -1
- package/dist/run.d.ts +18 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +80 -19
- package/dist/run.js.map +1 -1
- package/dist/sentence-shape.d.ts.map +1 -1
- package/dist/sentence-shape.js +4 -4
- package/dist/sentence-shape.js.map +1 -1
- package/dist/setting-problems.d.ts +2 -1
- package/dist/setting-problems.d.ts.map +1 -1
- package/dist/setting-problems.js +8 -1
- package/dist/setting-problems.js.map +1 -1
- package/dist/spacing-minority.d.ts +16 -0
- package/dist/spacing-minority.d.ts.map +1 -0
- package/dist/spacing-minority.js +23 -0
- package/dist/spacing-minority.js.map +1 -0
- package/dist/span-cut.d.ts +6 -0
- package/dist/span-cut.d.ts.map +1 -0
- package/dist/span-cut.js +22 -0
- package/dist/span-cut.js.map +1 -0
- package/dist/stet-block.d.ts +5 -0
- package/dist/stet-block.d.ts.map +1 -0
- package/dist/stet-block.js +59 -0
- package/dist/stet-block.js.map +1 -0
- package/dist/stet.d.ts +4 -0
- package/dist/stet.d.ts.map +1 -1
- package/dist/stet.js +31 -11
- package/dist/stet.js.map +1 -1
- package/dist/structure/aside-depth.d.ts +21 -0
- package/dist/structure/aside-depth.d.ts.map +1 -0
- package/dist/structure/aside-depth.js +65 -0
- package/dist/structure/aside-depth.js.map +1 -0
- package/dist/structure/build.d.ts +5 -1
- package/dist/structure/build.d.ts.map +1 -1
- package/dist/structure/build.js +29 -17
- package/dist/structure/build.js.map +1 -1
- package/dist/structure/closed-pairs.d.ts +8 -0
- package/dist/structure/closed-pairs.d.ts.map +1 -0
- package/dist/structure/closed-pairs.js +22 -0
- package/dist/structure/closed-pairs.js.map +1 -0
- package/dist/structure/date-range.d.ts +31 -0
- package/dist/structure/date-range.d.ts.map +1 -0
- package/dist/structure/date-range.js +77 -0
- package/dist/structure/date-range.js.map +1 -0
- package/dist/structure/definition-use.d.ts +32 -0
- package/dist/structure/definition-use.d.ts.map +1 -0
- package/dist/structure/definition-use.js +102 -0
- package/dist/structure/definition-use.js.map +1 -0
- package/dist/structure/known-mentions.d.ts +18 -0
- package/dist/structure/known-mentions.d.ts.map +1 -0
- package/dist/structure/known-mentions.js +78 -0
- package/dist/structure/known-mentions.js.map +1 -0
- package/dist/structure/lazy-tree.d.ts +8 -0
- package/dist/structure/lazy-tree.d.ts.map +1 -0
- package/dist/structure/lazy-tree.js +14 -0
- package/dist/structure/lazy-tree.js.map +1 -0
- package/dist/structure/modal-conflict.d.ts +28 -0
- package/dist/structure/modal-conflict.d.ts.map +1 -0
- package/dist/structure/modal-conflict.js +74 -0
- package/dist/structure/modal-conflict.js.map +1 -0
- package/dist/structure/numbered-clauses.d.ts +4 -0
- package/dist/structure/numbered-clauses.d.ts.map +1 -0
- package/dist/structure/numbered-clauses.js +9 -0
- package/dist/structure/numbered-clauses.js.map +1 -0
- package/dist/structure/numbering.d.ts +1 -0
- package/dist/structure/numbering.d.ts.map +1 -1
- package/dist/structure/numbering.js +11 -6
- package/dist/structure/numbering.js.map +1 -1
- package/dist/structure/of.d.ts +3 -1
- package/dist/structure/of.d.ts.map +1 -1
- package/dist/structure/of.js +5 -1
- package/dist/structure/of.js.map +1 -1
- package/dist/structure/percent-sum.d.ts +16 -0
- package/dist/structure/percent-sum.d.ts.map +1 -0
- package/dist/structure/percent-sum.js +104 -0
- package/dist/structure/percent-sum.js.map +1 -0
- package/dist/structure/quoted-number.d.ts +8 -0
- package/dist/structure/quoted-number.d.ts.map +1 -0
- package/dist/structure/quoted-number.js +34 -0
- package/dist/structure/quoted-number.js.map +1 -0
- package/dist/structure/relative-find.d.ts.map +1 -1
- package/dist/structure/relative-find.js +34 -46
- package/dist/structure/relative-find.js.map +1 -1
- package/dist/structure/relative-resolve.d.ts.map +1 -1
- package/dist/structure/relative-resolve.js +76 -30
- package/dist/structure/relative-resolve.js.map +1 -1
- package/dist/structure/runs.d.ts +2 -0
- package/dist/structure/runs.d.ts.map +1 -1
- package/dist/structure/runs.js +2 -2
- package/dist/structure/runs.js.map +1 -1
- package/dist/structure/sexp.d.ts +1 -1
- package/dist/structure/sexp.d.ts.map +1 -1
- package/dist/structure/sexp.js +18 -6
- package/dist/structure/sexp.js.map +1 -1
- package/dist/structure/total.d.ts +3 -0
- package/dist/structure/total.d.ts.map +1 -1
- package/dist/structure/total.js +2 -2
- package/dist/structure/total.js.map +1 -1
- package/dist/structure/universal.d.ts +14 -2
- package/dist/structure/universal.d.ts.map +1 -1
- package/dist/structure/universal.js +24 -3
- package/dist/structure/universal.js.map +1 -1
- package/dist/structure/wrapped-tail.d.ts +14 -7
- package/dist/structure/wrapped-tail.d.ts.map +1 -1
- package/dist/structure/wrapped-tail.js +33 -8
- package/dist/structure/wrapped-tail.js.map +1 -1
- package/dist/style-load.d.ts +4 -0
- package/dist/style-load.d.ts.map +1 -0
- package/dist/style-load.js +28 -0
- package/dist/style-load.js.map +1 -0
- package/dist/style-parse.d.ts +25 -0
- package/dist/style-parse.d.ts.map +1 -0
- package/dist/style-parse.js +88 -0
- package/dist/style-parse.js.map +1 -0
- package/dist/subheading-line.d.ts +23 -0
- package/dist/subheading-line.d.ts.map +1 -0
- package/dist/subheading-line.js +85 -0
- package/dist/subheading-line.js.map +1 -0
- package/dist/tag-coverage.d.ts +8 -0
- package/dist/tag-coverage.d.ts.map +1 -0
- package/dist/tag-coverage.js +7 -0
- package/dist/tag-coverage.js.map +1 -0
- package/dist/template-syntax.d.ts +17 -0
- package/dist/template-syntax.d.ts.map +1 -0
- package/dist/template-syntax.js +140 -0
- package/dist/template-syntax.js.map +1 -0
- package/dist/text-above.d.ts +19 -0
- package/dist/text-above.d.ts.map +1 -0
- package/dist/text-above.js +43 -0
- package/dist/text-above.js.map +1 -0
- package/dist/text-figures.d.ts +10 -0
- package/dist/text-figures.d.ts.map +1 -0
- package/dist/text-figures.js +131 -0
- package/dist/text-figures.js.map +1 -0
- package/dist/trailing-aside.d.ts +2 -0
- package/dist/trailing-aside.d.ts.map +1 -0
- package/dist/trailing-aside.js +53 -0
- package/dist/trailing-aside.js.map +1 -0
- package/dist/tree-walk.d.ts +18 -0
- package/dist/tree-walk.d.ts.map +1 -0
- package/dist/tree-walk.js +45 -0
- package/dist/tree-walk.js.map +1 -0
- package/genres.yaml +68 -0
- package/package.json +9 -3
- package/reference-headings.yaml +17 -0
- package/rules/acronym-expansion-conflict.yaml +82 -0
- package/rules/adverb-overuse.yaml +19 -0
- package/rules/agentless-passive.yaml +47 -0
- package/rules/agreement-slip.yaml +14 -1
- package/rules/ai-generated-composite.yaml +102 -0
- package/rules/ai-tell.yaml +57 -0
- package/rules/announced-count-mismatch.yaml +57 -0
- package/rules/announcing-opener.yaml +82 -0
- package/rules/assistant-residue.yaml +82 -0
- package/rules/bold-density.yaml +59 -0
- package/rules/bold-label-list.yaml +81 -0
- package/rules/broken-link.yaml +65 -0
- package/rules/closing-cliche.yaml +58 -0
- package/rules/colon-lead-in.yaml +83 -0
- package/rules/concrete-evidence-density.yaml +41 -0
- package/rules/contraction-consistency.yaml +18 -0
- package/rules/contrast-framing.yaml +88 -0
- package/rules/cushion-phrase-density.yaml +53 -1
- package/rules/dangling-figure-reference.yaml +61 -0
- package/rules/dangling-reference.yaml +54 -1
- package/rules/date-order.yaml +34 -1
- package/rules/date-range-reversed.yaml +46 -0
- package/rules/date-weekday-mismatch.yaml +17 -1
- package/rules/double-keigo.yaml +16 -0
- package/rules/double-negative.yaml +51 -0
- package/rules/doubled-punctuation.yaml +45 -0
- package/rules/doubled-word.yaml +18 -2
- package/rules/duplicate-definition.yaml +59 -1
- package/rules/duplicate-heading.yaml +78 -0
- package/rules/emoji-density.yaml +28 -2
- package/rules/empty-conclusion.yaml +28 -0
- package/rules/empty-intensifier.yaml +44 -0
- package/rules/empty-section.yaml +74 -0
- package/rules/excessive-hedging.yaml +49 -2
- package/rules/expletive-construction.yaml +19 -0
- package/rules/fullwidth-alnum-consistency.yaml +53 -0
- package/rules/hankaku-kana.yaml +41 -0
- package/rules/heading-echo.yaml +31 -0
- package/rules/heading-level-skip.yaml +78 -0
- package/rules/hiragana-fukushi.yaml +16 -0
- package/rules/image-alt-text.yaml +54 -0
- package/rules/internal-jargon.yaml +21 -0
- package/rules/invisible-character.yaml +63 -0
- package/rules/katakana-long-vowel.yaml +99 -0
- package/rules/kutoten-consistency.yaml +53 -0
- package/rules/latin-spacing.yaml +30 -4
- package/rules/max-kanji-continuous.yaml +17 -0
- package/rules/max-paragraph-length.yaml +34 -0
- package/rules/max-sentence-length.yaml +58 -0
- package/rules/modal-conflict.yaml +106 -0
- package/rules/name-variant.yaml +88 -0
- package/rules/ngram-repetition.yaml +29 -2
- package/rules/no-doubled-joshi.yaml +17 -0
- package/rules/no-em-dash.yaml +49 -0
- package/rules/no-mixed-desumasu.yaml +28 -2
- package/rules/no-nakaguro-parallel.yaml +20 -0
- package/rules/nominalization.yaml +89 -0
- package/rules/numbering-gap.yaml +53 -1
- package/rules/outside-announced-list.yaml +80 -0
- package/rules/oxford-comma-consistency.yaml +18 -0
- package/rules/padded-intro.yaml +44 -0
- package/rules/paragraph-length-variance.yaml +73 -0
- package/rules/percent-sum-mismatch.yaml +58 -0
- package/rules/preamble-length.yaml +56 -0
- package/rules/preferred-term.yaml +28 -0
- package/rules/proper-noun-density.yaml +37 -2
- package/rules/ra-nuki.yaml +43 -0
- package/rules/repeated-conjunction.yaml +47 -0
- package/rules/repeated-sentence-head.yaml +23 -0
- package/rules/required-sections.yaml +49 -0
- package/rules/requirement-modal.yaml +94 -0
- package/rules/requirement-smell.yaml +70 -0
- package/rules/risk-disclosure.yaml +22 -0
- package/rules/rule-of-three.yaml +143 -0
- package/rules/sasete-itadaku.yaml +18 -0
- package/rules/section-length-uniformity.yaml +113 -0
- package/rules/sentence-initial-conjunction-run.yaml +18 -0
- package/rules/sentence-rhythm.yaml +51 -0
- package/rules/space-before-punctuation.yaml +41 -0
- package/rules/spelling-consistency.yaml +47 -0
- package/rules/stock-transition.yaml +86 -0
- package/rules/stray-space.yaml +18 -0
- package/rules/taigen-dome-in-prose.yaml +33 -0
- package/rules/title-case-consistency.yaml +42 -0
- package/rules/total-mismatch.yaml +38 -1
- package/rules/unbalanced-bracket.yaml +56 -0
- package/rules/undefined-acronym.yaml +23 -0
- package/rules/unfilled-placeholder.yaml +50 -0
- package/rules/unqualified-superlative.yaml +20 -0
- package/rules/unsourced-number.yaml +16 -0
- package/rules/unused-definition.yaml +75 -0
- package/rules/url-run-on.yaml +45 -0
- package/rules/use-before-definition.yaml +77 -0
- package/rules/vague-figure-reference.yaml +66 -0
- package/skills/chaff/SKILL.md +171 -1
- package/src/acronym-expansions.ts +106 -0
- package/src/announced-count.ts +190 -0
- package/src/announced-list.ts +120 -0
- package/src/api.ts +154 -0
- package/src/bare-url.ts +35 -0
- package/src/baseline.ts +17 -1
- package/src/body-section.ts +7 -0
- package/src/calendar-number.ts +18 -4
- package/src/cli-args.ts +6 -0
- package/src/cli-text.ts +14 -15
- package/src/cli.ts +93 -92
- package/src/closing-paragraph.ts +24 -0
- package/src/commands/compare.ts +73 -0
- package/src/commands/document-commands.ts +19 -0
- package/src/commands/eval.ts +22 -10
- package/src/commands/facts.ts +33 -0
- package/src/commands/feedback.ts +45 -7
- package/src/commands/fix-plan.ts +53 -0
- package/src/commands/outline.ts +49 -0
- package/src/commands/read-document.ts +24 -0
- package/src/commands/suppressions.ts +19 -0
- package/src/commands/test.ts +3 -5
- package/src/commands/tree.ts +41 -5
- package/src/compare/atom.ts +33 -0
- package/src/compare/clock-time.ts +89 -0
- package/src/compare/distinct.ts +13 -0
- package/src/compare/extract.ts +80 -0
- package/src/compare/fact-key.ts +31 -0
- package/src/compare/fact-text.ts +87 -0
- package/src/compare/facts-render.ts +63 -0
- package/src/compare/facts-text.ts +41 -0
- package/src/compare/markup-atoms.ts +29 -0
- package/src/compare/match.ts +105 -0
- package/src/compare/outcome.ts +80 -0
- package/src/compare/proper-nouns.ts +65 -0
- package/src/compare/render.ts +102 -0
- package/src/compare/spans.ts +17 -0
- package/src/compare/text-atoms.ts +96 -0
- package/src/compare/text.ts +121 -0
- package/src/compare/tree-atoms.ts +80 -0
- package/src/compare/written-names.ts +26 -0
- package/src/config/load.ts +30 -0
- package/src/config/option-problems.ts +72 -0
- package/src/config/read.ts +8 -0
- package/src/config/rule-problems.ts +12 -2
- package/src/config/style.ts +55 -0
- package/src/config/warnings.ts +13 -0
- package/src/config/write.ts +18 -4
- package/src/custom/bounded-match.ts +58 -0
- package/src/custom/load.ts +23 -0
- package/src/custom/module-path.ts +23 -0
- package/src/custom/parse.ts +323 -0
- package/src/custom/problems.ts +111 -0
- package/src/custom/regex-safety.ts +118 -0
- package/src/custom/token-pattern.ts +84 -0
- package/src/detect-language.ts +1 -1
- package/src/detect.ts +35 -2
- package/src/detectors/acronym-context.ts +16 -4
- package/src/detectors/ai-phrasing.ts +141 -0
- package/src/detectors/announced-count.ts +25 -0
- package/src/detectors/bold-label.ts +55 -0
- package/src/detectors/broken-link.ts +90 -0
- package/src/detectors/cited-name.ts +6 -5
- package/src/detectors/cited-title.ts +96 -0
- package/src/detectors/concrete-evidence.ts +3 -2
- package/src/detectors/contrast-frame.ts +54 -0
- package/src/detectors/custom.ts +89 -0
- package/src/detectors/dangling-figure.ts +26 -0
- package/src/detectors/definition-use.ts +41 -0
- package/src/detectors/doubled-punctuation.ts +52 -0
- package/src/detectors/doubled-word.ts +19 -4
- package/src/detectors/duplicate-heading.ts +47 -0
- package/src/detectors/empty-section.ts +21 -0
- package/src/detectors/enumerated-runs.ts +13 -4
- package/src/detectors/fullwidth-alnum.ts +118 -0
- package/src/detectors/gram-furniture.ts +30 -0
- package/src/detectors/gram-place.ts +9 -5
- package/src/detectors/gram-windows.ts +31 -0
- package/src/detectors/hankaku-kana.ts +38 -0
- package/src/detectors/heading-case.ts +30 -2
- package/src/detectors/heading-code-words.ts +35 -0
- package/src/detectors/heading-echo.ts +8 -4
- package/src/detectors/heading-level-skip.ts +19 -0
- package/src/detectors/image-alt-text.ts +11 -0
- package/src/detectors/index.ts +79 -1
- package/src/detectors/invisible-character.ts +190 -0
- package/src/detectors/kutoten-consistency.ts +96 -0
- package/src/detectors/lead-in.ts +3 -1
- package/src/detectors/lexicon-match.ts +41 -2
- package/src/detectors/lexicon.ts +40 -13
- package/src/detectors/list-item.ts +122 -0
- package/src/detectors/list-items.ts +163 -0
- package/src/detectors/list-lead-in.ts +33 -0
- package/src/detectors/list-sentence.ts +198 -0
- package/src/detectors/list-view.ts +157 -0
- package/src/detectors/long-vowel.ts +82 -0
- package/src/detectors/markup-finding.ts +39 -0
- package/src/detectors/modal-conflict.ts +26 -0
- package/src/detectors/name-numeral.ts +4 -2
- package/src/detectors/name-variant.ts +15 -0
- package/src/detectors/nominalization.ts +73 -0
- package/src/detectors/orthography.ts +97 -41
- package/src/detectors/outside-announced-list.ts +25 -0
- package/src/detectors/oxford-comma.ts +179 -283
- package/src/detectors/phrase-match.ts +27 -7
- package/src/detectors/place-run.ts +7 -4
- package/src/detectors/placeholder-text.ts +27 -0
- package/src/detectors/quote-around.ts +9 -0
- package/src/detectors/ra-nuki.ts +38 -0
- package/src/detectors/register.ts +37 -10
- package/src/detectors/requirement-modal.ts +67 -0
- package/src/detectors/requirement-smell.ts +52 -0
- package/src/detectors/roman-numeral.ts +3 -0
- package/src/detectors/sentence-ending.ts +14 -7
- package/src/detectors/sentence-length.ts +16 -5
- package/src/detectors/signals.ts +80 -46
- package/src/detectors/space-before-punctuation.ts +32 -0
- package/src/detectors/spelling-variety.ts +81 -0
- package/src/detectors/structure-tree.ts +47 -1
- package/src/detectors/structure.ts +20 -7
- package/src/detectors/superlative-comparison.ts +47 -0
- package/src/detectors/superlative-name.ts +7 -4
- package/src/detectors/superlative-scope.ts +8 -3
- package/src/detectors/token-column.ts +149 -0
- package/src/detectors/unbalanced-bracket.ts +153 -0
- package/src/detectors/url-run-on.ts +33 -0
- package/src/detectors/vague-figure-pointer.ts +58 -0
- package/src/detectors/word-list.ts +6 -1
- package/src/document-sections.ts +46 -0
- package/src/document.ts +188 -173
- package/src/email-parts.ts +269 -0
- package/src/eval.ts +14 -4
- package/src/extension/document-view.ts +109 -0
- package/src/extension/failure-text.ts +46 -0
- package/src/extension/import-default.ts +13 -0
- package/src/extension/load.ts +97 -0
- package/src/extension/module-detector.ts +61 -0
- package/src/extension/plugin-load.ts +82 -0
- package/src/extension/plugin-name.ts +26 -0
- package/src/extension/plugin-parse.ts +229 -0
- package/src/extension/problem-text.ts +103 -0
- package/src/extension/real-path.ts +10 -0
- package/src/extension/returned-findings.ts +62 -0
- package/src/extension/rule-export.ts +23 -0
- package/src/feedback/draft.ts +6 -0
- package/src/figure-references.ts +173 -0
- package/src/files.ts +5 -0
- package/src/finding-order.ts +3 -0
- package/src/fix-plan/mode.ts +34 -0
- package/src/fix-plan/plan.ts +181 -0
- package/src/fix-plan/render.ts +128 -0
- package/src/fix-plan/text.ts +133 -0
- package/src/heading-label.ts +55 -0
- package/src/in-page-nav.ts +48 -19
- package/src/joined-view.ts +1 -0
- package/src/language-sample.ts +48 -0
- package/src/levels.ts +14 -1
- package/src/line-paragraphs.ts +52 -9
- package/src/link-line.ts +13 -0
- package/src/long-vowel.ts +109 -0
- package/src/markdown-node.ts +19 -0
- package/src/markdown-read.ts +44 -0
- package/src/markup.ts +212 -0
- package/src/mask.ts +8 -8
- package/src/name-variants.ts +217 -0
- package/src/node-version.ts +22 -0
- package/src/not-run.ts +16 -0
- package/src/number-name.ts +151 -24
- package/src/orthography.ts +50 -14
- package/src/outline/render.ts +85 -0
- package/src/outline/shape.ts +72 -0
- package/src/outline/text.ts +50 -0
- package/src/page-furniture.ts +11 -2
- package/src/plain-source.ts +2 -1
- package/src/plugin.ts +120 -3
- package/src/profile/for-file.ts +3 -1
- package/src/quoted-span.ts +9 -3
- package/src/reasons.ts +12 -0
- package/src/reference-lists.ts +91 -0
- package/src/render/compact.ts +13 -3
- package/src/render/explain.ts +75 -14
- package/src/render/friendly.ts +20 -9
- package/src/render/options.ts +58 -0
- package/src/render/rules-json.ts +140 -18
- package/src/render/rules-table.ts +91 -0
- package/src/render/sarif.ts +4 -4
- package/src/render/semantic.ts +3 -3
- package/src/render/severity-name.ts +10 -0
- package/src/render/suppressions.ts +30 -2
- package/src/render/text.ts +21 -7
- package/src/resolve-genre.ts +4 -1
- package/src/rule-genres.ts +25 -0
- package/src/rule-guide.ts +173 -0
- package/src/rule-load.ts +91 -34
- package/src/rule-options.ts +131 -0
- package/src/run-semantic.ts +2 -1
- package/src/run.ts +105 -22
- package/src/sentence-shape.ts +4 -5
- package/src/setting-problems.ts +9 -1
- package/src/spacing-minority.ts +27 -0
- package/src/span-cut.ts +28 -0
- package/src/stet-block.ts +60 -0
- package/src/stet.ts +41 -15
- package/src/structure/aside-depth.ts +67 -0
- package/src/structure/build.ts +38 -19
- package/src/structure/closed-pairs.ts +20 -0
- package/src/structure/date-range.ts +117 -0
- package/src/structure/definition-use.ts +130 -0
- package/src/structure/known-mentions.ts +96 -0
- package/src/structure/lazy-tree.ts +15 -0
- package/src/structure/modal-conflict.ts +86 -0
- package/src/structure/numbered-clauses.ts +11 -0
- package/src/structure/numbering.ts +9 -5
- package/src/structure/of.ts +11 -3
- package/src/structure/percent-sum.ts +135 -0
- package/src/structure/quoted-number.ts +36 -0
- package/src/structure/relative-find.ts +34 -47
- package/src/structure/relative-resolve.ts +77 -30
- package/src/structure/runs.ts +2 -2
- package/src/structure/sexp.ts +17 -5
- package/src/structure/total.ts +2 -2
- package/src/structure/universal.ts +33 -5
- package/src/structure/wrapped-tail.ts +38 -13
- package/src/style-load.ts +28 -0
- package/src/style-parse.ts +112 -0
- package/src/subheading-line.ts +106 -0
- package/src/tag-coverage.ts +13 -0
- package/src/template-syntax.ts +164 -0
- package/src/text-above.ts +49 -0
- package/src/text-figures.ts +147 -0
- package/src/trailing-aside.ts +50 -0
- package/src/tree-walk.ts +48 -0
- package/styles/bunkacho.yaml +25 -0
- package/styles/ieice.yaml +30 -0
- package/styles/jis-z8301-2011.yaml +28 -0
- package/styles/jis-z8301-2019.yaml +31 -0
- package/styles/koyobun.yaml +35 -0
- package/dist/legal-address.d.ts +0 -2
- package/dist/legal-address.d.ts.map +0 -1
- package/dist/legal-address.js +0 -16
- package/dist/legal-address.js.map +0 -1
package/src/cli.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
1
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
3
2
|
import { dirname, join } from "node:path";
|
|
4
3
|
import { loadAdapter, packageFor } from "./adapter-load.ts";
|
|
5
|
-
import { CONFIG_FILE,
|
|
4
|
+
import { CONFIG_FILE, type Config } from "./config/load.ts";
|
|
6
5
|
import { applyByPath } from "./config/by-path.ts";
|
|
6
|
+
import { limitsFor } from "./config/style.ts";
|
|
7
7
|
import { applyLevel } from "./config/write.ts";
|
|
8
8
|
import { buildDocument, teamRules } from "./document.ts";
|
|
9
9
|
import { guessLanguage } from "./detect.ts";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { BASELINE_FILE, fingerprint, readBaseline, splitByBaseline, writeBaseline } from "./baseline.ts";
|
|
10
|
+
import { collectTargets, readDocumentFile } from "./files.ts";
|
|
11
|
+
import { BASELINE_FILE, fingerprints, readBaseline, splitByBaseline, writeBaseline } from "./baseline.ts";
|
|
13
12
|
import { applySuppressions } from "./stet.ts";
|
|
14
|
-
import {
|
|
13
|
+
import type { PerFile } from "./render/suppressions.ts";
|
|
14
|
+
import { runSuppressions } from "./commands/suppressions.ts";
|
|
15
15
|
import { clock, describeChange, snapshotOf, watchPaths, type Snapshot } from "./watch.ts";
|
|
16
16
|
import { runEval } from "./commands/eval.ts";
|
|
17
17
|
import { runTest } from "./commands/test.ts";
|
|
@@ -19,8 +19,8 @@ import { GENRES } from "./genre.ts";
|
|
|
19
19
|
import { resolveGenre } from "./resolve-genre.ts";
|
|
20
20
|
import { runInit } from "./init.ts";
|
|
21
21
|
import { initGenre } from "./commands/init-ask.ts";
|
|
22
|
-
import { targetsOf } from "./cli-args.ts";
|
|
23
|
-
import {
|
|
22
|
+
import { targetsOf, withExperimental } from "./cli-args.ts";
|
|
23
|
+
import { rulesOf } from "./custom/load.ts";
|
|
24
24
|
import { renderCompact } from "./render/compact.ts";
|
|
25
25
|
import { renderExplain } from "./render/explain.ts";
|
|
26
26
|
import { renderFriendly } from "./render/friendly.ts";
|
|
@@ -28,27 +28,32 @@ import { renderGenres } from "./render/genres.ts";
|
|
|
28
28
|
import { loadGenres, presetLevels } from "./genre-load.ts";
|
|
29
29
|
import { fileHeader } from "./file-header.ts";
|
|
30
30
|
import { rulesJson } from "./render/rules-json.ts";
|
|
31
|
+
import { rulesTable } from "./render/rules-table.ts";
|
|
31
32
|
import { renderSarif } from "./render/sarif.ts";
|
|
32
33
|
import { VERSION, VERSION_LINES } from "./version.ts";
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
34
|
+
import type { TreeContext } from "./commands/tree.ts";
|
|
35
|
+
import { DOCUMENT_COMMANDS } from "./commands/document-commands.ts";
|
|
35
36
|
import { runSkill } from "./commands/skill.ts";
|
|
36
|
-
import {
|
|
37
|
+
import { fixPlanTargets, runFixPlan } from "./commands/fix-plan.ts";
|
|
38
|
+
import { runConditions, runFeedback, settingsOf, type Checked } from "./commands/feedback.ts";
|
|
37
39
|
import { homedir } from "node:os";
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
+
import { settingWarnings } from "./config/warnings.ts";
|
|
41
|
+
import { readConfigIn } from "./config/read.ts";
|
|
42
|
+
import { optionLayersOf, settingSourcesOf } from "./config/option-problems.ts";
|
|
40
43
|
import { renderSummary, type FileOutcome } from "./render/summary.ts";
|
|
41
|
-
import { neededBy,
|
|
42
|
-
import type { Level, RuleDefinition } from "./plugin.ts";
|
|
44
|
+
import { neededBy, runRulesWith } from "./run.ts";
|
|
45
|
+
import type { Finding, Level, RuleDefinition } from "./plugin.ts";
|
|
43
46
|
import { CLI_TEXT, type CliText, type GenreSource } from "./cli-text.ts";
|
|
44
47
|
import { hostLanguage, sharedLanguage, uiLanguageOf, type UiLanguage } from "./ui.ts";
|
|
45
48
|
import { profileFor } from "./profile/for-file.ts";
|
|
49
|
+
import { notRunAmong } from "./not-run.ts";
|
|
46
50
|
import { settingProblems } from "./setting-problems.ts";
|
|
51
|
+
import { withExtensions } from "./extension/load.ts";
|
|
47
52
|
|
|
48
53
|
/** Text for output that is not about one document. */
|
|
49
54
|
const hostText = (config: Config): CliText => CLI_TEXT[hostLanguage(config.language, process.env)];
|
|
50
55
|
|
|
51
|
-
const readConfig = (): Config => (
|
|
56
|
+
const readConfig = (): Config => readConfigIn(process.cwd());
|
|
52
57
|
|
|
53
58
|
/** resolveGenre with this run's --genre, for the commands that take it as a dependency. */
|
|
54
59
|
const genreFrom =
|
|
@@ -58,10 +63,9 @@ const genreFrom =
|
|
|
58
63
|
|
|
59
64
|
const findRule = (rules: readonly RuleDefinition[], id: string | undefined): RuleDefinition | undefined => rules.find((rule) => rule.id === id);
|
|
60
65
|
|
|
61
|
-
const changeSetting = (command: Level, ruleId: string | undefined, why: string | undefined): number => {
|
|
62
|
-
const config = readConfig();
|
|
66
|
+
const changeSetting = (config: Config, command: Level, ruleId: string | undefined, why: string | undefined): number => {
|
|
63
67
|
const language = config.language ?? hostLanguage(undefined, process.env);
|
|
64
|
-
const rule = findRule(
|
|
68
|
+
const rule = findRule(rulesOf(language, config), ruleId);
|
|
65
69
|
if (rule === undefined) {
|
|
66
70
|
console.error(hostText(config).unknownRule(ruleId ?? hostText(config).unnamed));
|
|
67
71
|
return 1;
|
|
@@ -84,20 +88,29 @@ type Inspected = {
|
|
|
84
88
|
readonly genre: string;
|
|
85
89
|
readonly outcome: FileOutcome;
|
|
86
90
|
readonly perFile: PerFile;
|
|
87
|
-
readonly
|
|
91
|
+
readonly checked: Omit<Checked, "conditions">;
|
|
92
|
+
/** stet で黙らせたものを除いた、baseline で棚上げする前の指摘。fingerprint は baseline を書くときだけ作る。 */
|
|
93
|
+
readonly kept: readonly Finding[];
|
|
88
94
|
};
|
|
89
95
|
|
|
90
96
|
const inspect = async (path: string, config: Config, argv: readonly string[]): Promise<Inspected> => {
|
|
91
|
-
const source =
|
|
97
|
+
const source = await readDocumentFile(path);
|
|
92
98
|
const language = applyByPath(config.byPath, config.baseDir, path).language ?? config.language ?? guessLanguage(source).language;
|
|
93
99
|
const adapter = await loadAdapter(language);
|
|
94
100
|
const { genre, from, unread } = resolveGenre(path, source, config, flag(argv, "--genre"));
|
|
95
101
|
if (unread !== undefined) console.error(`chaff: ${CLI_TEXT[uiLanguageOf(language)].unreadFrontMatterGenre(path, unread, GENRES)}`);
|
|
96
|
-
const rules =
|
|
102
|
+
const rules = rulesOf(language, config);
|
|
97
103
|
const experimental = config.experimental || argv.includes("--experimental");
|
|
98
104
|
await adapter.prepare?.(neededBy(rules, config.rules, experimental, genre, language));
|
|
99
|
-
const doc = buildDocument(path, source, adapter, teamRules(config), profileFor(config, path, source, language, genre));
|
|
100
|
-
const raw =
|
|
105
|
+
const doc = buildDocument(path, source, adapter, teamRules(config, language), profileFor(config, path, source, language, genre));
|
|
106
|
+
const raw = runRulesWith(doc, rules, {
|
|
107
|
+
settings: config.rules,
|
|
108
|
+
experimental,
|
|
109
|
+
genre,
|
|
110
|
+
limits: limitsFor(config, language),
|
|
111
|
+
optionLayers: optionLayersOf(config),
|
|
112
|
+
detectors: config.extensions?.detectors ?? {},
|
|
113
|
+
});
|
|
101
114
|
// 応答は 3 つ。stet で黙らせたものは、ここで落とす。
|
|
102
115
|
const applied = applySuppressions(
|
|
103
116
|
source,
|
|
@@ -108,6 +121,7 @@ const inspect = async (path: string, config: Config, argv: readonly string[]): P
|
|
|
108
121
|
const split = splitByBaseline(path, applied.kept, baseline);
|
|
109
122
|
const result = { ...raw, findings: split.fresh };
|
|
110
123
|
const { header, notes } = fileHeader(path, source, language, { genre, from, unread }, { shelved: split.shelved, hushed: applied.suppressed.length });
|
|
124
|
+
const notRun = notRunAmong(applied.named, raw.skipped);
|
|
111
125
|
const text = argv.includes("--compact") ? renderCompact(header, result, rules, language) : renderFriendly(header, result, rules, language, notes);
|
|
112
126
|
return {
|
|
113
127
|
text,
|
|
@@ -115,8 +129,9 @@ const inspect = async (path: string, config: Config, argv: readonly string[]): P
|
|
|
115
129
|
language,
|
|
116
130
|
genre,
|
|
117
131
|
outcome: { path, findings: split.fresh, notRun: raw.skipped.length },
|
|
118
|
-
perFile: { path, suppressed: applied.suppressed, reasonless: applied.unusedReasonless },
|
|
119
|
-
|
|
132
|
+
perFile: { path, suppressed: applied.suppressed, reasonless: applied.unusedReasonless, notRun },
|
|
133
|
+
checked: { findings: split.fresh, rules, language, genre, skipped: raw.skipped },
|
|
134
|
+
kept: applied.kept,
|
|
120
135
|
};
|
|
121
136
|
};
|
|
122
137
|
|
|
@@ -124,7 +139,7 @@ const inspect = async (path: string, config: Config, argv: readonly string[]): P
|
|
|
124
139
|
* 指摘を PR の変更行に出すための出口。--sarif <path> を書いたときだけ作る。
|
|
125
140
|
* 端末の出力は変えない。CI で上げるためのファイルが増えるだけ。
|
|
126
141
|
*/
|
|
127
|
-
const writeSarif = (results: readonly Inspected[], argv: readonly string[]): void => {
|
|
142
|
+
const writeSarif = (results: readonly Inspected[], argv: readonly string[], config: Config): void => {
|
|
128
143
|
const path = flag(argv, "--sarif");
|
|
129
144
|
if (path === undefined) return;
|
|
130
145
|
// 文言はファイルの言語で描く。by_path で 1 つの repo に 2 言語が混ざるため。
|
|
@@ -133,14 +148,12 @@ const writeSarif = (results: readonly Inspected[], argv: readonly string[]): voi
|
|
|
133
148
|
);
|
|
134
149
|
mkdirSync(dirname(path), { recursive: true });
|
|
135
150
|
writeFileSync(path, renderSarif(located, VERSION), "utf8");
|
|
136
|
-
console.log(hostText(
|
|
151
|
+
console.log(hostText(config).sarifWritten(path, located.length));
|
|
137
152
|
};
|
|
138
153
|
|
|
139
154
|
/** 効いていない設定は、結果の前に一度だけ言う。標準エラーに出すので、JSON や SARIF の出力は汚さない。 */
|
|
140
|
-
const warnRuleProblems = (config: Config, language: string): void =>
|
|
141
|
-
|
|
142
|
-
[...ruleProblems(config, loadRules(language), ui), ...nameProblems(config, ui)].forEach((problem) => console.error(`chaff: ${problem}`));
|
|
143
|
-
};
|
|
155
|
+
const warnRuleProblems = (config: Config, language: string): void =>
|
|
156
|
+
settingWarnings(config, rulesOf(language, config), hostLanguage(config.language, process.env)).forEach((problem) => console.error(`chaff: ${problem}`));
|
|
144
157
|
|
|
145
158
|
/** Several files end with one summary: in their language when they share one, else the host's. */
|
|
146
159
|
const summaryLanguage = (results: readonly Inspected[], config: Config): UiLanguage => {
|
|
@@ -148,9 +161,8 @@ const summaryLanguage = (results: readonly Inspected[], config: Config): UiLangu
|
|
|
148
161
|
return sharedLanguage(languages, hostLanguage(config.language, process.env));
|
|
149
162
|
};
|
|
150
163
|
|
|
151
|
-
const lint = async (targets: readonly string[], argv: readonly string[]): Promise<number> => {
|
|
164
|
+
const lint = async (targets: readonly string[], argv: readonly string[], config: Config): Promise<number> => {
|
|
152
165
|
const paths = collectTargets(targets);
|
|
153
|
-
const config = readConfig();
|
|
154
166
|
if (paths.length === 0) {
|
|
155
167
|
// 0 件を成功にすると「CI は通っているが何も検証していない」状態が続く。§14。
|
|
156
168
|
console.error(hostText(config).noMarkdown(targets.join(", ")));
|
|
@@ -163,7 +175,7 @@ const lint = async (targets: readonly string[], argv: readonly string[]): Promis
|
|
|
163
175
|
}
|
|
164
176
|
warnRuleProblems(config, language);
|
|
165
177
|
const results = await Promise.all(paths.map((path) => inspect(path, config, argv)));
|
|
166
|
-
writeSarif(results, argv);
|
|
178
|
+
writeSarif(results, argv, config);
|
|
167
179
|
results.filter((result) => result.outcome.findings.length > 0 || paths.length === 1).forEach((result) => console.log(result.text));
|
|
168
180
|
renderSummary(
|
|
169
181
|
results.map((result) => result.outcome),
|
|
@@ -176,9 +188,8 @@ const lint = async (targets: readonly string[], argv: readonly string[]): Promis
|
|
|
176
188
|
* 書いている最中は、全件を出し直されても何が変わったのか分からない。
|
|
177
189
|
* 差分だけを出す。workflow spec §11。
|
|
178
190
|
*/
|
|
179
|
-
const runWatch = async (targets: readonly string[], argv: readonly string[]): Promise<number> => {
|
|
191
|
+
const runWatch = async (targets: readonly string[], argv: readonly string[], config: Config): Promise<number> => {
|
|
180
192
|
const paths = collectTargets(targets);
|
|
181
|
-
const config = readConfig();
|
|
182
193
|
const text = hostText(config);
|
|
183
194
|
if (paths.length === 0) {
|
|
184
195
|
console.error(text.noMarkdown(targets.join(", ")));
|
|
@@ -208,13 +219,12 @@ const runWatch = async (targets: readonly string[], argv: readonly string[]): Pr
|
|
|
208
219
|
};
|
|
209
220
|
|
|
210
221
|
/** genreFlag: --genre, which wins over chaff.yaml's genre here as it does in a run. */
|
|
211
|
-
const explain = (ruleId: string | undefined, genreFlag: string | undefined): number => {
|
|
212
|
-
const config = readConfig();
|
|
222
|
+
const explain = (config: Config, ruleId: string | undefined, genreFlag: string | undefined): number => {
|
|
213
223
|
const genre = genreFlag ?? config.genre;
|
|
214
224
|
// The rule's limits differ by language (characters for Japanese, words for English): explain in the one being written.
|
|
215
225
|
const language = config.language ?? hostLanguage(undefined, process.env);
|
|
216
226
|
const text = CLI_TEXT[uiLanguageOf(language)];
|
|
217
|
-
const rules =
|
|
227
|
+
const rules = rulesOf(language, config);
|
|
218
228
|
const rule = findRule(rules, ruleId);
|
|
219
229
|
if (rule === undefined) {
|
|
220
230
|
const list = rules.map((entry) => ` ${entry.id}`).join("\n");
|
|
@@ -223,90 +233,81 @@ const explain = (ruleId: string | undefined, genreFlag: string | undefined): num
|
|
|
223
233
|
}
|
|
224
234
|
const preset = genre === undefined ? {} : presetLevels(genre);
|
|
225
235
|
const current = config.rules[rule.id] ?? preset[rule.id] ?? (rule.status === "experimental" && !config.experimental ? "off" : "normal");
|
|
226
|
-
console.log(renderExplain(rule, current, language,
|
|
236
|
+
console.log(renderExplain(rule, current, language, genre, settingSourcesOf(config, rule.id, language)));
|
|
227
237
|
return 0;
|
|
228
238
|
};
|
|
229
239
|
|
|
230
|
-
const runBaseline = async (targets: readonly string[], argv: readonly string[]): Promise<number> => {
|
|
240
|
+
const runBaseline = async (targets: readonly string[], argv: readonly string[], config: Config): Promise<number> => {
|
|
231
241
|
const paths = collectTargets(targets.length > 0 ? targets : ["."]);
|
|
232
|
-
const config = readConfig();
|
|
233
242
|
if (paths.length === 0) {
|
|
234
243
|
console.error(hostText(config).noMarkdownHere);
|
|
235
244
|
return 1;
|
|
236
245
|
}
|
|
237
246
|
const results = await Promise.all(paths.map((path) => inspect(path, config, [...argv, "--show-baseline"])));
|
|
238
|
-
const entries = results.flatMap((result) => result.
|
|
247
|
+
const entries = results.flatMap((result) => fingerprints(result.outcome.path, result.kept));
|
|
239
248
|
const file = join(process.cwd(), BASELINE_FILE);
|
|
240
249
|
writeBaseline(file, entries);
|
|
241
250
|
console.log(hostText(config).baselineDone(paths.length, entries.length, BASELINE_FILE).join("\n"));
|
|
242
251
|
return 0;
|
|
243
252
|
};
|
|
244
253
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
const config = readConfig();
|
|
248
|
-
const results = await Promise.all(paths.map((path) => inspect(path, config, [...argv, "--show-baseline"])));
|
|
249
|
-
console.log(
|
|
250
|
-
renderSuppressions(
|
|
251
|
-
results.map((result) => result.perFile),
|
|
252
|
-
hostLanguage(config.language, process.env),
|
|
253
|
-
),
|
|
254
|
-
);
|
|
255
|
-
return 0;
|
|
256
|
-
};
|
|
254
|
+
/** A file's findings, shelved ones included: commands that look findings up are not asking what is new. */
|
|
255
|
+
const inspectAll = (config: Config, argv: readonly string[]) => (path: string) => inspect(path, config, [...argv, "--show-baseline"]);
|
|
257
256
|
|
|
258
|
-
|
|
257
|
+
/** A subcommand, given the command line and chaff.yaml as read once, with the code it names loaded. */
|
|
258
|
+
type Handler = (argv: readonly string[], config: Config) => number | Promise<number>;
|
|
259
259
|
|
|
260
260
|
/** `--` で始まらない引数。対象のパス。 */
|
|
261
261
|
const positional = (argv: readonly string[]): string[] => targetsOf(argv.slice(1));
|
|
262
262
|
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
/** `rules --json` for an AI to read; `rules` alone, a table for a person. */
|
|
264
|
+
const showRules = (argv: readonly string[], written: Config): number => {
|
|
265
|
+
const config = withExperimental(written, argv);
|
|
265
266
|
const language = config.language ?? hostLanguage(undefined, process.env);
|
|
266
267
|
warnRuleProblems(config, language);
|
|
267
|
-
|
|
268
|
+
const genre = flag(argv, "--genre") ?? config.genre ?? "blog/tech";
|
|
269
|
+
const rules = rulesOf(language, config);
|
|
270
|
+
console.log(argv.includes("--json") ? rulesJson(rules, config, language, genre, optionLayersOf(config)) : rulesTable(rules, config, language, genre));
|
|
268
271
|
return 0;
|
|
269
272
|
};
|
|
270
273
|
|
|
271
|
-
const showGenres = (): number => {
|
|
272
|
-
console.log(renderGenres(loadGenres(), hostLanguage(
|
|
274
|
+
const showGenres = (config: Config): number => {
|
|
275
|
+
console.log(renderGenres(loadGenres(), hostLanguage(config.language, process.env)));
|
|
273
276
|
return 0;
|
|
274
277
|
};
|
|
275
278
|
|
|
276
|
-
const treeContext = (): TreeContext => {
|
|
277
|
-
const config = readConfig();
|
|
279
|
+
const treeContext = (config: Config): TreeContext => {
|
|
278
280
|
return { config, flag, ui: hostLanguage(config.language, process.env) };
|
|
279
281
|
};
|
|
280
282
|
|
|
281
283
|
/** What eval and test share: the settings, this run's genre, and the language for what is not about one document. */
|
|
282
|
-
const measureContext = (argv: readonly string[]): { config: Config; resolveGenre: ReturnType<typeof genreFrom>; ui: UiLanguage } => {
|
|
283
|
-
const config = readConfig();
|
|
284
|
+
const measureContext = (argv: readonly string[], config: Config): { config: Config; resolveGenre: ReturnType<typeof genreFrom>; ui: UiLanguage } => {
|
|
284
285
|
return { config, resolveGenre: genreFrom(argv), ui: hostLanguage(config.language, process.env) };
|
|
285
286
|
};
|
|
286
287
|
|
|
287
288
|
/** 分岐を数珠つなぎにせず表にする。足すときに main を太らせない。 */
|
|
288
289
|
const HANDLERS: Readonly<Record<string, Handler>> = {
|
|
289
|
-
init: async (argv) => {
|
|
290
|
-
const ui = hostLanguage(
|
|
290
|
+
init: async (argv, config) => {
|
|
291
|
+
const ui = hostLanguage(config.language, process.env);
|
|
291
292
|
const chosen = await initGenre(flag(argv, "--genre"), ui, process.cwd());
|
|
292
293
|
if ("error" in chosen) console.error(chosen.error);
|
|
293
294
|
else runInit(process.cwd(), chosen.genre, ui).forEach((line) => console.log(line));
|
|
294
295
|
return "error" in chosen ? 1 : 0;
|
|
295
296
|
},
|
|
296
|
-
genres: showGenres,
|
|
297
|
-
rules:
|
|
298
|
-
explain: (argv) => explain(argv[1], flag(argv, "--genre")),
|
|
299
|
-
eval: (argv) => runEval(positional(argv), argv, { ...measureContext(argv), flag }),
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
297
|
+
genres: (_argv, config) => showGenres(config),
|
|
298
|
+
rules: showRules,
|
|
299
|
+
explain: (argv, config) => explain(config, argv[1], flag(argv, "--genre")),
|
|
300
|
+
eval: (argv, config) => runEval(positional(argv), argv, { ...measureContext(argv, config), flag }),
|
|
301
|
+
...Object.fromEntries(Object.entries(DOCUMENT_COMMANDS).map(([name, run]): [string, Handler] => [name, (argv, config) => run(argv, treeContext(config))])),
|
|
302
|
+
test: (argv, config) => runTest(positional(argv), argv, { ...measureContext(argv, config), inspect }),
|
|
303
|
+
"fix-plan": (argv, config) =>
|
|
304
|
+
runFixPlan(fixPlanTargets(argv), argv, { ...treeContext(config), check: async (path) => (await inspectAll(config, argv)(path)).checked }),
|
|
305
|
+
baseline: (argv, config) => runBaseline(positional(argv), argv, config),
|
|
306
|
+
suppressions: (argv, config) => runSuppressions(positional(argv), inspectAll(config, argv), hostLanguage(config.language, process.env)),
|
|
307
|
+
relax: (argv, config) => changeSetting(config, "relaxed", argv[1], flag(argv, "--why")),
|
|
308
|
+
strict: (argv, config) => changeSetting(config, "strict", argv[1], flag(argv, "--why")),
|
|
309
|
+
off: (argv, config) => changeSetting(config, "off", argv[1], flag(argv, "--why")),
|
|
310
|
+
feedback: (argv, config) => {
|
|
310
311
|
return runFeedback(positional(argv), argv, {
|
|
311
312
|
cwd: process.cwd(),
|
|
312
313
|
ui: hostLanguage(config.language, process.env),
|
|
@@ -314,13 +315,13 @@ const HANDLERS: Readonly<Record<string, Handler>> = {
|
|
|
314
315
|
runtime: `Node ${process.version} · ${process.platform} ${process.arch}`,
|
|
315
316
|
flag,
|
|
316
317
|
settingsOf: (ruleIds) => settingsOf(config, ruleIds),
|
|
317
|
-
check: async (path) => {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
},
|
|
318
|
+
check: async (path) => ({
|
|
319
|
+
...(await inspectAll(config, argv)(path)).checked,
|
|
320
|
+
conditions: runConditions(argv, flag(argv, "--genre"), config.experimental),
|
|
321
|
+
}),
|
|
321
322
|
});
|
|
322
323
|
},
|
|
323
|
-
skill: (argv) => runSkill(argv, { cwd: process.cwd(), home: homedir(), ui: hostLanguage(
|
|
324
|
+
skill: (argv, config) => runSkill(argv, { cwd: process.cwd(), home: homedir(), ui: hostLanguage(config.language, process.env) }),
|
|
324
325
|
};
|
|
325
326
|
|
|
326
327
|
/** Every subcommand. Anything else on the command line is a file to check. */
|
|
@@ -337,12 +338,12 @@ export const main = async (argv: readonly string[]): Promise<number> => {
|
|
|
337
338
|
return 0;
|
|
338
339
|
}
|
|
339
340
|
// 知らないジャンルではどの rule も当たらず、知らない文書の種類では種類の知識が外れる。どちらも素通りに見えるので、何かする前に止める。
|
|
340
|
-
const config = readConfig();
|
|
341
|
-
const problems = settingProblems(first, flag(argv, "--genre"), config, hostText(config));
|
|
341
|
+
const config = await withExtensions(readConfig());
|
|
342
|
+
const problems = settingProblems(first, flag(argv, "--genre"), config, hostText(config), hostLanguage(config.language, process.env));
|
|
342
343
|
problems.forEach((problem) => console.error(problem));
|
|
343
344
|
if (problems.length > 0) return 1;
|
|
344
345
|
const handler = HANDLERS[first];
|
|
345
|
-
if (handler !== undefined) return handler(argv);
|
|
346
|
+
if (handler !== undefined) return handler(argv, config);
|
|
346
347
|
const targets = targetsOf(first === "lint" ? argv.slice(1) : argv);
|
|
347
|
-
return argv.includes("--watch") ? runWatch(targets, argv) : lint(targets, argv);
|
|
348
|
+
return argv.includes("--watch") ? runWatch(targets, argv, config) : lint(targets, argv, config);
|
|
348
349
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Paragraph, Section, Sentence } from "./plugin.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 結びとして読む、最後の節の終わりの段落の数。決まり文句の後ろに一言や追記が続く結び(「いかがでしたか。」→ 感想 → 「よいお年を!」)は
|
|
5
|
+
* 人の書いた記事に多く、最後の段落だけでは取りこぼす。
|
|
6
|
+
*/
|
|
7
|
+
const CLOSING_PARAGRAPHS = 4;
|
|
8
|
+
|
|
9
|
+
/** 文書の最初の段落は書き出しで、結びではない(冒頭の「簡単にまとめると、」)。段落が一つだけなら、それが結びでもある。 */
|
|
10
|
+
const isOpening = (paragraphs: readonly Paragraph[], paragraph: Paragraph): boolean => paragraphs.length > 1 && paragraphs[0] === paragraph;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 結びの文。最後の節の終わりの段落で、書き出しの段落でないもの。見出しの無い文書は本文全体が一つの節なので、節だけで切ると冒頭の
|
|
14
|
+
* 「まとめると」や、長い書き起こしの途中の問いかけまで結びになる。箇条書きは段落に数えない。
|
|
15
|
+
*/
|
|
16
|
+
export const closingSentences = (sections: readonly Pick<Section, "span">[], paragraphs: readonly Paragraph[]): readonly Sentence[] => {
|
|
17
|
+
const last = sections.at(-1);
|
|
18
|
+
if (last === undefined) return [];
|
|
19
|
+
return paragraphs
|
|
20
|
+
.filter((paragraph) => paragraph.span.start >= last.span.start && paragraph.span.start < last.span.end)
|
|
21
|
+
.slice(-CLOSING_PARAGRAPHS)
|
|
22
|
+
.filter((paragraph) => !isOpening(paragraphs, paragraph))
|
|
23
|
+
.flatMap((paragraph) => paragraph.sentences);
|
|
24
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { readMarkdown } from "../markdown-read.ts";
|
|
2
|
+
import { isMarkdownPath } from "../structure/markdown-path.ts";
|
|
3
|
+
import { uiLanguageOf } from "../ui.ts";
|
|
4
|
+
import { ATOM_KINDS, isAtomKind, type AtomKind } from "../compare/atom.ts";
|
|
5
|
+
import { extractFacts } from "../compare/extract.ts";
|
|
6
|
+
import { outcomeOf, type Allowed, type Compared } from "../compare/outcome.ts";
|
|
7
|
+
import { renderCompact, renderFriendly, renderJson } from "../compare/render.ts";
|
|
8
|
+
import { COMPARE_TEXT } from "../compare/text.ts";
|
|
9
|
+
import { readDocument } from "./read-document.ts";
|
|
10
|
+
import type { TreeContext } from "./tree.ts";
|
|
11
|
+
|
|
12
|
+
/** Options whose value is the next argument. That value is not a file. */
|
|
13
|
+
const VALUED: ReadonlySet<string> = new Set(["--language", "--genre", "--allow-dropped", "--allow-added"]);
|
|
14
|
+
|
|
15
|
+
export const compareTargets = (argv: readonly string[]): string[] =>
|
|
16
|
+
argv.slice(1).filter((arg, index, all) => !arg.startsWith("--") && !VALUED.has(all[index - 1] ?? ""));
|
|
17
|
+
|
|
18
|
+
/** Every value given to a repeatable option, split at commas: `--allow-dropped url,code --allow-dropped quote`. */
|
|
19
|
+
const optionValues = (argv: readonly string[], name: string): string[] =>
|
|
20
|
+
argv.flatMap((arg, index) => (arg === name ? (argv[index + 1] ?? "").split(",") : [])).filter((value) => value !== "");
|
|
21
|
+
|
|
22
|
+
type ParsedAllowed = { readonly allowed: Allowed } | { readonly unknown: string };
|
|
23
|
+
|
|
24
|
+
/** The kinds allowed to be dropped and added, or the first word that is not a kind. */
|
|
25
|
+
const parseAllowed = (argv: readonly string[]): ParsedAllowed => {
|
|
26
|
+
const dropped = optionValues(argv, "--allow-dropped");
|
|
27
|
+
const added = optionValues(argv, "--allow-added");
|
|
28
|
+
const unknown = [...dropped, ...added].find((kind) => !isAtomKind(kind));
|
|
29
|
+
if (unknown !== undefined) return { unknown };
|
|
30
|
+
const kinds = (values: readonly string[]): Set<AtomKind> => new Set(values.filter(isAtomKind));
|
|
31
|
+
return { allowed: { dropped: kinds(dropped), added: kinds(added) } };
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type DocumentFacts = Compared & { readonly language: string };
|
|
35
|
+
|
|
36
|
+
/** One document's facts, read as lint reads it: its language, the team's names, and the parts of speech. */
|
|
37
|
+
export const readFacts = async (path: string, argv: readonly string[], context: TreeContext): Promise<DocumentFacts | undefined> => {
|
|
38
|
+
const prose = await readDocument(path, argv, context, true);
|
|
39
|
+
if (prose === undefined) return undefined;
|
|
40
|
+
const root = isMarkdownPath(path) ? readMarkdown(prose.doc.source).root : undefined;
|
|
41
|
+
const extraction = extractFacts({ doc: prose.doc, root, structure: prose.structure, names: context.config.names ?? [] });
|
|
42
|
+
return { path, extraction, language: prose.language };
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const renderFor = (argv: readonly string[]): typeof renderFriendly => {
|
|
46
|
+
if (argv.includes("--json")) return (outcome) => renderJson(outcome);
|
|
47
|
+
return argv.includes("--compact") ? renderCompact : renderFriendly;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Whether a rewrite kept every fact: numbers, dates, URLs, code, names, quotations, headings, references and footnotes.
|
|
52
|
+
* Compares; never rewrites. Ends with 1 when a fact was dropped or added, so a rewrite can be checked like a test.
|
|
53
|
+
* --distinct counts a fact as kept when the other document states it at least once.
|
|
54
|
+
*/
|
|
55
|
+
export const runCompare = async (targets: readonly string[], argv: readonly string[], context: TreeContext): Promise<number> => {
|
|
56
|
+
const host = COMPARE_TEXT[context.ui ?? "ja"];
|
|
57
|
+
const [beforePath, afterPath] = targets;
|
|
58
|
+
if (beforePath === undefined || afterPath === undefined || targets.length !== 2) {
|
|
59
|
+
console.error(host.usage);
|
|
60
|
+
return 1;
|
|
61
|
+
}
|
|
62
|
+
const parsed = parseAllowed(argv);
|
|
63
|
+
if ("unknown" in parsed) {
|
|
64
|
+
console.error(host.unknownKind(parsed.unknown, ATOM_KINDS.join(", ")));
|
|
65
|
+
return 1;
|
|
66
|
+
}
|
|
67
|
+
const before = await readFacts(beforePath, argv, context);
|
|
68
|
+
const after = before === undefined ? undefined : await readFacts(afterPath, argv, context);
|
|
69
|
+
if (before === undefined || after === undefined) return 1;
|
|
70
|
+
const outcome = outcomeOf(before, after, parsed.allowed, argv.includes("--distinct") ? "distinct" : "as-stated");
|
|
71
|
+
console.log(renderFor(argv)(outcome, COMPARE_TEXT[uiLanguageOf(before.language)]));
|
|
72
|
+
return outcome.ok ? 0 : 1;
|
|
73
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { citeTargets, runCite } from "./cite.ts";
|
|
2
|
+
import { compareTargets, runCompare } from "./compare.ts";
|
|
3
|
+
import { factsTargets, runFacts } from "./facts.ts";
|
|
4
|
+
import { outlineTargets, runOutline } from "./outline.ts";
|
|
5
|
+
import { runTree, treeTargets, type TreeContext } from "./tree.ts";
|
|
6
|
+
|
|
7
|
+
type DocumentCommand = (argv: readonly string[], context: TreeContext) => Promise<number>;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The commands that read one or two documents and report on them without linting: the tree, quotations, facts and
|
|
11
|
+
* outline. Each is given the settings the command line read once.
|
|
12
|
+
*/
|
|
13
|
+
export const DOCUMENT_COMMANDS: Readonly<Record<string, DocumentCommand>> = {
|
|
14
|
+
tree: (argv, context) => runTree(treeTargets(argv), argv, context),
|
|
15
|
+
cite: (argv, context) => runCite(citeTargets(argv), argv, context),
|
|
16
|
+
compare: (argv, context) => runCompare(compareTargets(argv), argv, context),
|
|
17
|
+
facts: (argv, context) => runFacts(factsTargets(argv), argv, context),
|
|
18
|
+
outline: (argv, context) => runOutline(outlineTargets(argv), argv, context),
|
|
19
|
+
};
|
package/src/commands/eval.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { plainSource } from "../plain-source.ts";
|
|
2
|
-
import { readFile } from "node:fs/promises";
|
|
3
1
|
import { loadAdapter } from "../adapter-load.ts";
|
|
4
2
|
import { applyByPath } from "../config/by-path.ts";
|
|
5
3
|
import { buildDocument, teamRules } from "../document.ts";
|
|
6
4
|
import { guessLanguage } from "../detect.ts";
|
|
7
|
-
import { collectTargets } from "../files.ts";
|
|
8
|
-
import {
|
|
5
|
+
import { collectTargets, readDocumentFile } from "../files.ts";
|
|
6
|
+
import { rulesOf } from "../custom/load.ts";
|
|
9
7
|
import { evaluate } from "../eval.ts";
|
|
10
8
|
import { renderEval } from "../render/eval.ts";
|
|
11
|
-
import { neededBy } from "../run.ts";
|
|
9
|
+
import { neededBy, tokenFeaturesOf, wantsTags } from "../run.ts";
|
|
10
|
+
import type { AdapterNeeds, RuleDefinition } from "../plugin.ts";
|
|
11
|
+
import { optionLayersOf } from "../config/option-problems.ts";
|
|
12
|
+
import { limitsFor } from "../config/style.ts";
|
|
12
13
|
import type { Config } from "../config/load.ts";
|
|
13
14
|
import { profileFor } from "../profile/for-file.ts";
|
|
14
15
|
import { CLI_TEXT } from "../cli-text.ts";
|
|
@@ -28,6 +29,16 @@ const TEXT: Texts<{
|
|
|
28
29
|
},
|
|
29
30
|
};
|
|
30
31
|
|
|
32
|
+
/**
|
|
33
|
+
* What the adapter must prepare. eval measures a rule whatever its level, so a rule named with --rule gets the tags and the
|
|
34
|
+
* token features it reads even when lint would not run it; without --rule, the tags are what lint would prepare.
|
|
35
|
+
*/
|
|
36
|
+
const evalNeeds = (rules: readonly RuleDefinition[], only: string | undefined, config: Config, genre: string, language: string): AdapterNeeds => {
|
|
37
|
+
const measured = rules.filter((rule) => only === undefined || rule.id === only);
|
|
38
|
+
const lint = neededBy(rules, config.rules, config.experimental, genre, language);
|
|
39
|
+
return { pos: lint.pos || (only !== undefined && measured.some(wantsTags)), features: tokenFeaturesOf(measured) };
|
|
40
|
+
};
|
|
41
|
+
|
|
31
42
|
export type Context = {
|
|
32
43
|
readonly config: Config;
|
|
33
44
|
readonly resolveGenre: (path: string, source: string, config: Config) => { genre: string; from: string };
|
|
@@ -51,12 +62,12 @@ export const runEval = async (targets: readonly string[], argv: readonly string[
|
|
|
51
62
|
const only = flag(argv, "--rule");
|
|
52
63
|
const docs = await Promise.all(
|
|
53
64
|
paths.map(async (path) => {
|
|
54
|
-
const source =
|
|
65
|
+
const source = await readDocumentFile(path);
|
|
55
66
|
const language = applyByPath(config.byPath, config.baseDir, path).language ?? config.language ?? guessLanguage(source).language;
|
|
56
67
|
const adapter = await loadAdapter(language);
|
|
57
68
|
const { genre } = resolveGenre(path, source, config);
|
|
58
|
-
await adapter.prepare?.(
|
|
59
|
-
return { doc: buildDocument(path, source, adapter, teamRules(config), profileFor(config, path, source, language, genre)), language, genre };
|
|
69
|
+
await adapter.prepare?.(evalNeeds(rulesOf(language, config), only, config, genre, language));
|
|
70
|
+
return { doc: buildDocument(path, source, adapter, teamRules(config, language), profileFor(config, path, source, language, genre)), language, genre };
|
|
60
71
|
}),
|
|
61
72
|
);
|
|
62
73
|
const language = docs[0]?.language ?? "ja";
|
|
@@ -67,7 +78,7 @@ export const runEval = async (targets: readonly string[], argv: readonly string[
|
|
|
67
78
|
console.error(TEXT[ui].mixed([...mixed].join(", ")));
|
|
68
79
|
return 1;
|
|
69
80
|
}
|
|
70
|
-
const rules =
|
|
81
|
+
const rules = rulesOf(language, config).filter((rule) => only === undefined || rule.id === only);
|
|
71
82
|
if (rules.length === 0) {
|
|
72
83
|
console.error(TEXT[ui].unknownRule(only ?? CLI_TEXT[ui].unnamed));
|
|
73
84
|
return 1;
|
|
@@ -79,7 +90,8 @@ export const runEval = async (targets: readonly string[], argv: readonly string[
|
|
|
79
90
|
rules,
|
|
80
91
|
genre,
|
|
81
92
|
language,
|
|
82
|
-
config
|
|
93
|
+
limitsFor(config, language),
|
|
94
|
+
optionLayersOf(config),
|
|
83
95
|
),
|
|
84
96
|
docs.length,
|
|
85
97
|
paths.length,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { uiLanguageOf } from "../ui.ts";
|
|
2
|
+
import { FACTS_TEXT } from "../compare/facts-text.ts";
|
|
3
|
+
import { renderFactsCompact, renderFactsFriendly, renderFactsJson, type FactList } from "../compare/facts-render.ts";
|
|
4
|
+
import { readFacts } from "./compare.ts";
|
|
5
|
+
import type { TreeContext } from "./tree.ts";
|
|
6
|
+
|
|
7
|
+
/** Options whose value is the next argument. That value is not a file. */
|
|
8
|
+
const VALUED: ReadonlySet<string> = new Set(["--language", "--genre"]);
|
|
9
|
+
|
|
10
|
+
export const factsTargets = (argv: readonly string[]): string[] =>
|
|
11
|
+
argv.slice(1).filter((arg, index, all) => !arg.startsWith("--") && !VALUED.has(all[index - 1] ?? ""));
|
|
12
|
+
|
|
13
|
+
const renderFor = (argv: readonly string[], list: FactList): string => {
|
|
14
|
+
const text = FACTS_TEXT[uiLanguageOf(list.language)];
|
|
15
|
+
if (argv.includes("--json")) return renderFactsJson(list);
|
|
16
|
+
return argv.includes("--compact") ? renderFactsCompact(list, text) : renderFactsFriendly(list, text);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The facts `chaff compare` would check in one document, listed before a rewrite: the inventory a full rewrite
|
|
21
|
+
* starts from. Read by compare's own extractor, so the list is exactly what compare holds the rewrite to.
|
|
22
|
+
*/
|
|
23
|
+
export const runFacts = async (targets: readonly string[], argv: readonly string[], context: TreeContext): Promise<number> => {
|
|
24
|
+
const [path] = targets;
|
|
25
|
+
if (path === undefined || targets.length !== 1) {
|
|
26
|
+
console.error(FACTS_TEXT[context.ui ?? "ja"].usage);
|
|
27
|
+
return 1;
|
|
28
|
+
}
|
|
29
|
+
const documentFacts = await readFacts(path, argv, context);
|
|
30
|
+
if (documentFacts === undefined) return 1;
|
|
31
|
+
console.log(renderFor(argv, documentFacts));
|
|
32
|
+
return 0;
|
|
33
|
+
};
|