chaffjs 0.20.0 → 0.21.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 +5 -4
- package/dist/api.d.ts +16 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js.map +1 -1
- package/dist/cli-text.d.ts +2 -0
- package/dist/cli-text.d.ts.map +1 -1
- package/dist/cli-text.js +14 -5
- package/dist/cli-text.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/dist/command-help.d.ts +7 -0
- package/dist/command-help.d.ts.map +1 -0
- package/dist/command-help.js +18 -0
- package/dist/command-help.js.map +1 -0
- package/dist/commands/eval.js +2 -2
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/fix-plan.d.ts.map +1 -1
- package/dist/commands/fix-plan.js +11 -1
- package/dist/commands/fix-plan.js.map +1 -1
- package/dist/commands/help.d.ts +4 -0
- package/dist/commands/help.d.ts.map +1 -0
- package/dist/commands/help.js +7 -0
- package/dist/commands/help.js.map +1 -0
- package/dist/config/load.d.ts +2 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +1 -0
- package/dist/config/load.js.map +1 -1
- package/dist/config/option-problems.js +2 -2
- package/dist/config/option-problems.js.map +1 -1
- package/dist/config/rule-problems.js +2 -2
- package/dist/config/rule-problems.js.map +1 -1
- package/dist/custom/checked.d.ts +9 -0
- package/dist/custom/checked.d.ts.map +1 -0
- package/dist/custom/checked.js +3 -0
- package/dist/custom/checked.js.map +1 -0
- package/dist/custom/dsl-fields.d.ts +27 -0
- package/dist/custom/dsl-fields.d.ts.map +1 -0
- package/dist/custom/dsl-fields.js +86 -0
- package/dist/custom/dsl-fields.js.map +1 -0
- package/dist/custom/load.d.ts.map +1 -1
- package/dist/custom/load.js +2 -0
- package/dist/custom/load.js.map +1 -1
- package/dist/custom/parse.d.ts +14 -3
- package/dist/custom/parse.d.ts.map +1 -1
- package/dist/custom/parse.js +44 -40
- package/dist/custom/parse.js.map +1 -1
- package/dist/custom/problems.d.ts.map +1 -1
- package/dist/custom/problems.js +11 -1
- package/dist/custom/problems.js.map +1 -1
- package/dist/detectors/blank-structure.d.ts.map +1 -1
- package/dist/detectors/blank-structure.js +6 -4
- package/dist/detectors/blank-structure.js.map +1 -1
- package/dist/detectors/clause-shape.d.ts +22 -0
- package/dist/detectors/clause-shape.d.ts.map +1 -0
- package/dist/detectors/clause-shape.js +149 -0
- package/dist/detectors/clause-shape.js.map +1 -0
- package/dist/detectors/code-fences.d.ts +34 -0
- package/dist/detectors/code-fences.d.ts.map +1 -0
- package/dist/detectors/code-fences.js +100 -0
- package/dist/detectors/code-fences.js.map +1 -0
- package/dist/detectors/cross-definitions.d.ts +4 -0
- package/dist/detectors/cross-definitions.d.ts.map +1 -0
- package/dist/detectors/cross-definitions.js +43 -0
- package/dist/detectors/cross-definitions.js.map +1 -0
- package/dist/detectors/cross-facts.d.ts +4 -0
- package/dist/detectors/cross-facts.d.ts.map +1 -0
- package/dist/detectors/cross-facts.js +53 -0
- package/dist/detectors/cross-facts.js.map +1 -0
- package/dist/detectors/cross-registry/cross-doc-duplicate-definition.d.ts +3 -0
- package/dist/detectors/cross-registry/cross-doc-duplicate-definition.d.ts.map +1 -0
- package/dist/detectors/cross-registry/cross-doc-duplicate-definition.js +3 -0
- package/dist/detectors/cross-registry/cross-doc-duplicate-definition.js.map +1 -0
- package/dist/detectors/cross-registry/cross-doc-fact-conflict.d.ts +3 -0
- package/dist/detectors/cross-registry/cross-doc-fact-conflict.d.ts.map +1 -0
- package/dist/detectors/cross-registry/cross-doc-fact-conflict.js +3 -0
- package/dist/detectors/cross-registry/cross-doc-fact-conflict.js.map +1 -0
- package/dist/detectors/custom.d.ts.map +1 -1
- package/dist/detectors/custom.js +4 -1
- package/dist/detectors/custom.js.map +1 -1
- package/dist/detectors/defined-term-form.d.ts +25 -0
- package/dist/detectors/defined-term-form.d.ts.map +1 -0
- package/dist/detectors/defined-term-form.js +170 -0
- package/dist/detectors/defined-term-form.js.map +1 -0
- package/dist/detectors/email-letter.d.ts +46 -0
- package/dist/detectors/email-letter.d.ts.map +1 -0
- package/dist/detectors/email-letter.js +234 -0
- package/dist/detectors/email-letter.js.map +1 -0
- package/dist/detectors/impossible-date.d.ts +20 -0
- package/dist/detectors/impossible-date.d.ts.map +1 -0
- package/dist/detectors/impossible-date.js +105 -0
- package/dist/detectors/impossible-date.js.map +1 -0
- package/dist/detectors/impossible-time.d.ts +18 -0
- package/dist/detectors/impossible-time.d.ts.map +1 -0
- package/dist/detectors/impossible-time.js +116 -0
- package/dist/detectors/impossible-time.js.map +1 -0
- package/dist/detectors/link-shape.d.ts +11 -0
- package/dist/detectors/link-shape.d.ts.map +1 -0
- package/dist/detectors/link-shape.js +56 -0
- package/dist/detectors/link-shape.js.map +1 -0
- package/dist/detectors/mark-shape.d.ts +53 -0
- package/dist/detectors/mark-shape.d.ts.map +1 -0
- package/dist/detectors/mark-shape.js +160 -0
- package/dist/detectors/mark-shape.js.map +1 -0
- package/dist/detectors/registry/adverb-polarity.d.ts +3 -0
- package/dist/detectors/registry/adverb-polarity.d.ts.map +1 -0
- package/dist/detectors/registry/adverb-polarity.js +3 -0
- package/dist/detectors/registry/adverb-polarity.js.map +1 -0
- package/dist/detectors/registry/attachment-missing.d.ts +3 -0
- package/dist/detectors/registry/attachment-missing.d.ts.map +1 -0
- package/dist/detectors/registry/attachment-missing.js +3 -0
- package/dist/detectors/registry/attachment-missing.js.map +1 -0
- package/dist/detectors/registry/bare-url-mix.d.ts +3 -0
- package/dist/detectors/registry/bare-url-mix.d.ts.map +1 -0
- package/dist/detectors/registry/bare-url-mix.js +3 -0
- package/dist/detectors/registry/bare-url-mix.js.map +1 -0
- package/dist/detectors/registry/caps-shouting.d.ts +3 -0
- package/dist/detectors/registry/caps-shouting.d.ts.map +1 -0
- package/dist/detectors/registry/caps-shouting.js +3 -0
- package/dist/detectors/registry/caps-shouting.js.map +1 -0
- package/dist/detectors/registry/code-fence-language.d.ts +3 -0
- package/dist/detectors/registry/code-fence-language.d.ts.map +1 -0
- package/dist/detectors/registry/code-fence-language.js +3 -0
- package/dist/detectors/registry/code-fence-language.js.map +1 -0
- package/dist/detectors/registry/defined-name-repeated.d.ts +3 -0
- package/dist/detectors/registry/defined-name-repeated.d.ts.map +1 -0
- package/dist/detectors/registry/defined-name-repeated.js +3 -0
- package/dist/detectors/registry/defined-name-repeated.js.map +1 -0
- package/dist/detectors/registry/defined-term-form.d.ts +3 -0
- package/dist/detectors/registry/defined-term-form.d.ts.map +1 -0
- package/dist/detectors/registry/defined-term-form.js +3 -0
- package/dist/detectors/registry/defined-term-form.js.map +1 -0
- package/dist/detectors/registry/email-frame.d.ts +3 -0
- package/dist/detectors/registry/email-frame.d.ts.map +1 -0
- package/dist/detectors/registry/email-frame.js +3 -0
- package/dist/detectors/registry/email-frame.js.map +1 -0
- package/dist/detectors/registry/email-subject.d.ts +3 -0
- package/dist/detectors/registry/email-subject.d.ts.map +1 -0
- package/dist/detectors/registry/email-subject.js +3 -0
- package/dist/detectors/registry/email-subject.js.map +1 -0
- package/dist/detectors/registry/ending-run.d.ts +3 -0
- package/dist/detectors/registry/ending-run.d.ts.map +1 -0
- package/dist/detectors/registry/ending-run.js +3 -0
- package/dist/detectors/registry/ending-run.js.map +1 -0
- package/dist/detectors/registry/heading-command.d.ts +3 -0
- package/dist/detectors/registry/heading-command.d.ts.map +1 -0
- package/dist/detectors/registry/heading-command.js +3 -0
- package/dist/detectors/registry/heading-command.js.map +1 -0
- package/dist/detectors/registry/hyphen-dash.d.ts +3 -0
- package/dist/detectors/registry/hyphen-dash.d.ts.map +1 -0
- package/dist/detectors/registry/hyphen-dash.js +3 -0
- package/dist/detectors/registry/hyphen-dash.js.map +1 -0
- package/dist/detectors/registry/image-file-name-alt.d.ts +3 -0
- package/dist/detectors/registry/image-file-name-alt.d.ts.map +1 -0
- package/dist/detectors/registry/image-file-name-alt.js +3 -0
- package/dist/detectors/registry/image-file-name-alt.js.map +1 -0
- package/dist/detectors/registry/impossible-date.d.ts +3 -0
- package/dist/detectors/registry/impossible-date.d.ts.map +1 -0
- package/dist/detectors/registry/impossible-date.js +3 -0
- package/dist/detectors/registry/impossible-date.js.map +1 -0
- package/dist/detectors/registry/impossible-time.d.ts +3 -0
- package/dist/detectors/registry/impossible-time.d.ts.map +1 -0
- package/dist/detectors/registry/impossible-time.js +3 -0
- package/dist/detectors/registry/impossible-time.js.map +1 -0
- package/dist/detectors/registry/latin-abbreviation.d.ts +3 -0
- package/dist/detectors/registry/latin-abbreviation.d.ts.map +1 -0
- package/dist/detectors/registry/latin-abbreviation.js +3 -0
- package/dist/detectors/registry/latin-abbreviation.js.map +1 -0
- package/dist/detectors/registry/link-text-url-mismatch.d.ts +3 -0
- package/dist/detectors/registry/link-text-url-mismatch.d.ts.map +1 -0
- package/dist/detectors/registry/link-text-url-mismatch.js +3 -0
- package/dist/detectors/registry/link-text-url-mismatch.js.map +1 -0
- package/dist/detectors/registry/mark-consistency.d.ts +3 -0
- package/dist/detectors/registry/mark-consistency.d.ts.map +1 -0
- package/dist/detectors/registry/mark-consistency.js +3 -0
- package/dist/detectors/registry/mark-consistency.js.map +1 -0
- package/dist/detectors/registry/origin-particle.d.ts +3 -0
- package/dist/detectors/registry/origin-particle.d.ts.map +1 -0
- package/dist/detectors/registry/origin-particle.js +3 -0
- package/dist/detectors/registry/origin-particle.js.map +1 -0
- package/dist/detectors/registry/request-without-deadline.d.ts +3 -0
- package/dist/detectors/registry/request-without-deadline.d.ts.map +1 -0
- package/dist/detectors/registry/request-without-deadline.js +3 -0
- package/dist/detectors/registry/request-without-deadline.js.map +1 -0
- package/dist/detectors/registry/sentence-spacing.d.ts +3 -0
- package/dist/detectors/registry/sentence-spacing.d.ts.map +1 -0
- package/dist/detectors/registry/sentence-spacing.js +3 -0
- package/dist/detectors/registry/sentence-spacing.js.map +1 -0
- package/dist/detectors/registry/shell-prompt.d.ts +3 -0
- package/dist/detectors/registry/shell-prompt.d.ts.map +1 -0
- package/dist/detectors/registry/shell-prompt.js +3 -0
- package/dist/detectors/registry/shell-prompt.js.map +1 -0
- package/dist/detectors/registry/step-statement.d.ts +3 -0
- package/dist/detectors/registry/step-statement.d.ts.map +1 -0
- package/dist/detectors/registry/step-statement.js +3 -0
- package/dist/detectors/registry/step-statement.js.map +1 -0
- package/dist/detectors/registry/unpaired-parallel.d.ts +3 -0
- package/dist/detectors/registry/unpaired-parallel.d.ts.map +1 -0
- package/dist/detectors/registry/unpaired-parallel.js +3 -0
- package/dist/detectors/registry/unpaired-parallel.js.map +1 -0
- package/dist/detectors/request-owner.d.ts +23 -0
- package/dist/detectors/request-owner.d.ts.map +1 -0
- package/dist/detectors/request-owner.js +110 -0
- package/dist/detectors/request-owner.js.map +1 -0
- package/dist/detectors/technical-docs.d.ts +32 -0
- package/dist/detectors/technical-docs.d.ts.map +1 -0
- package/dist/detectors/technical-docs.js +199 -0
- package/dist/detectors/technical-docs.js.map +1 -0
- package/dist/extension/pack-read.d.ts +21 -0
- package/dist/extension/pack-read.d.ts.map +1 -0
- package/dist/extension/pack-read.js +117 -0
- package/dist/extension/pack-read.js.map +1 -0
- package/dist/extension/plugin-load.d.ts.map +1 -1
- package/dist/extension/plugin-load.js +44 -10
- package/dist/extension/plugin-load.js.map +1 -1
- package/dist/extension/plugin-parse.d.ts.map +1 -1
- package/dist/extension/plugin-parse.js +10 -3
- package/dist/extension/plugin-parse.js.map +1 -1
- package/dist/facts/address-values.d.ts +5 -0
- package/dist/facts/address-values.d.ts.map +1 -0
- package/dist/facts/address-values.js +64 -0
- package/dist/facts/address-values.js.map +1 -0
- package/dist/facts/cross-facts.d.ts +20 -0
- package/dist/facts/cross-facts.d.ts.map +1 -0
- package/dist/facts/cross-facts.js +41 -0
- package/dist/facts/cross-facts.js.map +1 -0
- package/dist/fix-plan/chosen-depth.d.ts +10 -0
- package/dist/fix-plan/chosen-depth.d.ts.map +1 -0
- package/dist/fix-plan/chosen-depth.js +24 -0
- package/dist/fix-plan/chosen-depth.js.map +1 -0
- package/dist/fix-plan/mode.d.ts +13 -4
- package/dist/fix-plan/mode.d.ts.map +1 -1
- package/dist/fix-plan/mode.js +38 -7
- package/dist/fix-plan/mode.js.map +1 -1
- package/dist/fix-plan/plan.d.ts +20 -0
- package/dist/fix-plan/plan.d.ts.map +1 -1
- package/dist/fix-plan/plan.js +23 -5
- package/dist/fix-plan/plan.js.map +1 -1
- package/dist/fix-plan/render.d.ts.map +1 -1
- package/dist/fix-plan/render.js +24 -0
- package/dist/fix-plan/render.js.map +1 -1
- package/dist/fix-plan/text.d.ts +8 -0
- package/dist/fix-plan/text.d.ts.map +1 -1
- package/dist/fix-plan/text.js +36 -10
- package/dist/fix-plan/text.js.map +1 -1
- package/dist/genre-load.d.ts +1 -1
- package/dist/genre-load.d.ts.map +1 -1
- package/dist/genre-load.js +7 -4
- package/dist/genre-load.js.map +1 -1
- package/dist/genre-parse.d.ts +6 -0
- package/dist/genre-parse.d.ts.map +1 -1
- package/dist/genre-parse.js +18 -0
- package/dist/genre-parse.js.map +1 -1
- package/dist/init.js +10 -10
- package/dist/init.js.map +1 -1
- package/dist/known-genres.d.ts +8 -0
- package/dist/known-genres.d.ts.map +1 -0
- package/dist/known-genres.js +17 -0
- package/dist/known-genres.js.map +1 -0
- package/dist/link-shape.d.ts +20 -0
- package/dist/link-shape.d.ts.map +1 -0
- package/dist/link-shape.js +58 -0
- package/dist/link-shape.js.map +1 -0
- package/dist/reasons.d.ts.map +1 -1
- package/dist/reasons.js +15 -4
- package/dist/reasons.js.map +1 -1
- package/dist/render/explain.d.ts.map +1 -1
- package/dist/render/explain.js +11 -2
- package/dist/render/explain.js.map +1 -1
- package/dist/render/friendly.js +1 -1
- package/dist/render/friendly.js.map +1 -1
- package/dist/render/rules-json.d.ts.map +1 -1
- package/dist/render/rules-json.js +12 -3
- package/dist/render/rules-json.js.map +1 -1
- package/dist/render/rules-table.js +6 -6
- package/dist/render/rules-table.js.map +1 -1
- package/dist/render/semantic.js +2 -2
- package/dist/render/semantic.js.map +1 -1
- package/dist/render/suppressions.js +2 -2
- package/dist/render/suppressions.js.map +1 -1
- package/dist/rewrite-depth.d.ts +22 -0
- package/dist/rewrite-depth.d.ts.map +1 -0
- package/dist/rewrite-depth.js +42 -0
- package/dist/rewrite-depth.js.map +1 -0
- package/dist/rule-fields.d.ts +23 -0
- package/dist/rule-fields.d.ts.map +1 -0
- package/dist/rule-fields.js +64 -0
- package/dist/rule-fields.js.map +1 -0
- package/dist/rule-guide.d.ts +3 -0
- package/dist/rule-guide.d.ts.map +1 -1
- package/dist/rule-guide.js +6 -0
- package/dist/rule-guide.js.map +1 -1
- package/dist/rule-load.d.ts.map +1 -1
- package/dist/rule-load.js +13 -5
- package/dist/rule-load.js.map +1 -1
- package/dist/rule-offs.d.ts +14 -0
- package/dist/rule-offs.d.ts.map +1 -0
- package/dist/rule-offs.js +45 -0
- package/dist/rule-offs.js.map +1 -0
- package/dist/structure/build.d.ts.map +1 -1
- package/dist/structure/build.js +14 -1
- package/dist/structure/build.js.map +1 -1
- package/dist/structure/cross-definitions.d.ts +23 -0
- package/dist/structure/cross-definitions.d.ts.map +1 -0
- package/dist/structure/cross-definitions.js +34 -0
- package/dist/structure/cross-definitions.js.map +1 -0
- package/genres.yaml +14 -313
- package/package.json +3 -3
- package/rules/absolute-exception.yaml +3 -1
- package/rules/abstract-length.yaml +7 -1
- package/rules/acronym-expansion-conflict.yaml +2 -1
- package/rules/adverb-overuse.yaml +7 -1
- package/rules/adverb-without-negation.yaml +60 -0
- package/rules/adversative-ga-repeat.yaml +2 -1
- package/rules/agentless-passive.yaml +10 -1
- package/rules/agreement-slip.yaml +4 -1
- package/rules/ai-generated-composite.yaml +6 -1
- package/rules/ai-structure.yaml +8 -2
- package/rules/ai-tell.yaml +7 -1
- package/rules/all-caps-shouting.yaml +61 -0
- package/rules/announced-count-mismatch.yaml +3 -1
- package/rules/announcing-opener.yaml +7 -1
- package/rules/article-sound.yaml +6 -2
- package/rules/assistant-residue.yaml +4 -1
- package/rules/attachment-not-attached.yaml +112 -0
- package/rules/baito-keigo.yaml +64 -0
- package/rules/bare-url-mix.yaml +86 -0
- package/rules/bold-density.yaml +1 -0
- package/rules/bold-label-list.yaml +9 -1
- package/rules/bracket-nesting.yaml +2 -1
- package/rules/bracket-width-consistency.yaml +64 -0
- package/rules/broken-link.yaml +1 -1
- package/rules/chat-citation-residue.yaml +2 -1
- package/rules/citation-reference-mismatch.yaml +7 -1
- package/rules/citation-style-mix.yaml +7 -1
- package/rules/clause-chain.yaml +6 -1
- package/rules/closing-cliche.yaml +7 -0
- package/rules/code-fence-language-mix.yaml +176 -0
- package/rules/colloquial-opener.yaml +62 -0
- package/rules/colon-lead-in.yaml +7 -1
- package/rules/concrete-evidence-density.yaml +6 -0
- package/rules/contraction-consistency.yaml +4 -1
- package/rules/contrast-framing.yaml +7 -1
- package/rules/cross-doc-duplicate-definition.yaml +70 -0
- package/rules/cross-doc-fact-conflict.yaml +64 -0
- package/rules/cushion-phrase-density.yaml +8 -1
- package/rules/dangling-figure-reference.yaml +3 -1
- package/rules/dangling-reference.yaml +3 -1
- package/rules/date-format-consistency.yaml +3 -2
- package/rules/date-order.yaml +3 -1
- package/rules/date-range-reversed.yaml +3 -1
- package/rules/date-weekday-mismatch.yaml +3 -1
- package/rules/date-without-year.yaml +4 -3
- package/rules/defined-name-repeated.yaml +97 -0
- package/rules/defined-term-form.yaml +113 -0
- package/rules/demonstrative-opener-run.yaml +2 -1
- package/rules/double-keigo.yaml +6 -1
- package/rules/double-negative.yaml +5 -1
- package/rules/doubled-nado.yaml +2 -1
- package/rules/doubled-punctuation.yaml +1 -1
- package/rules/doubled-word.yaml +4 -1
- package/rules/duplicate-definition.yaml +3 -1
- package/rules/duplicate-heading.yaml +1 -1
- package/rules/duration-mismatch.yaml +2 -1
- package/rules/elapsed-years-mismatch.yaml +4 -1
- package/rules/email-greeting-closing.yaml +122 -0
- package/rules/email-subject-length.yaml +112 -0
- package/rules/emoji-density.yaml +3 -1
- package/rules/emoji-heading.yaml +7 -1
- package/rules/empty-intensifier.yaml +4 -0
- package/rules/empty-list-item.yaml +2 -1
- package/rules/empty-section.yaml +1 -1
- package/rules/empty-table-cell.yaml +2 -1
- package/rules/excessive-hedging.yaml +7 -1
- package/rules/exclamation-width-consistency.yaml +64 -0
- package/rules/expletive-construction.yaml +7 -1
- package/rules/fact-conflict.yaml +4 -1
- package/rules/figure-reference-order.yaml +7 -1
- package/rules/fullwidth-alnum-consistency.yaml +2 -2
- package/rules/hankaku-kana.yaml +1 -1
- package/rules/heading-command-missing.yaml +109 -0
- package/rules/heading-echo.yaml +6 -1
- package/rules/heading-level-skip.yaml +3 -3
- package/rules/heading-numbering-mix.yaml +4 -3
- package/rules/hiragana-fukushi.yaml +4 -1
- package/rules/homophone-slip.yaml +5 -1
- package/rules/humble-for-others.yaml +63 -0
- package/rules/hyphen-as-dash.yaml +59 -0
- package/rules/idiom-misuse.yaml +4 -1
- package/rules/image-file-name-alt.yaml +83 -0
- package/rules/impossible-date.yaml +79 -0
- package/rules/impossible-time.yaml +76 -0
- package/rules/internal-jargon.yaml +1 -1
- package/rules/invisible-character.yaml +1 -1
- package/rules/katakana-density.yaml +2 -1
- package/rules/katakana-long-vowel.yaml +1 -1
- package/rules/known-misspelling.yaml +2 -1
- package/rules/kutoten-consistency.yaml +1 -1
- package/rules/latin-abbreviation-form.yaml +58 -0
- package/rules/latin-spacing.yaml +6 -2
- package/rules/link-text-url-mismatch.yaml +72 -0
- package/rules/list-item-form-mix.yaml +7 -1
- package/rules/max-kanji-continuous.yaml +10 -2
- package/rules/max-paragraph-length.yaml +4 -1
- package/rules/max-sentence-length.yaml +29 -21
- package/rules/max-ten.yaml +4 -1
- package/rules/misconversion.yaml +2 -1
- package/rules/modal-conflict.yaml +2 -1
- package/rules/name-variant.yaml +4 -3
- package/rules/ngram-repetition.yaml +5 -0
- package/rules/no-doubled-joshi.yaml +5 -1
- package/rules/no-em-dash.yaml +4 -1
- package/rules/no-lead.yaml +6 -1
- package/rules/no-mixed-desumasu.yaml +5 -2
- package/rules/no-nakaguro-parallel.yaml +3 -0
- package/rules/nominalization.yaml +5 -1
- package/rules/number-style-consistency.yaml +6 -1
- package/rules/number-without-unit.yaml +2 -1
- package/rules/numbering-gap.yaml +1 -1
- package/rules/one-sentence-paragraph-run.yaml +5 -1
- package/rules/orthographic-variant.yaml +4 -1
- package/rules/outside-announced-list.yaml +2 -1
- package/rules/oxford-comma-consistency.yaml +3 -1
- package/rules/padded-intro.yaml +7 -0
- package/rules/paragraph-length-variance.yaml +7 -1
- package/rules/paragraph-restatement.yaml +6 -1
- package/rules/percent-sum-mismatch.yaml +3 -1
- package/rules/person-consistency.yaml +4 -1
- package/rules/preamble-length.yaml +6 -0
- package/rules/preferred-term.yaml +1 -1
- package/rules/proper-noun-density.yaml +8 -1
- package/rules/quote-style-consistency.yaml +66 -0
- package/rules/ra-nuki.yaml +4 -1
- package/rules/redundant-expression.yaml +4 -1
- package/rules/reference-title-mismatch.yaml +4 -3
- package/rules/reference-topic-missing.yaml +2 -1
- package/rules/relative-date-mismatch.yaml +2 -1
- package/rules/repeated-conjunction.yaml +4 -1
- package/rules/repeated-sentence-ending.yaml +62 -0
- package/rules/repeated-sentence-head.yaml +4 -0
- package/rules/request-without-deadline.yaml +92 -0
- package/rules/required-sections.yaml +1 -1
- package/rules/requirement-modal.yaml +1 -1
- package/rules/requirement-smell.yaml +12 -4
- package/rules/rule-of-three.yaml +8 -1
- package/rules/sasete-itadaku.yaml +7 -1
- package/rules/section-length-uniformity.yaml +7 -1
- package/rules/sentence-initial-conjunction-run.yaml +5 -1
- package/rules/sentence-initial-so.yaml +6 -1
- package/rules/sentence-rhythm.yaml +8 -1
- package/rules/sentence-spacing-consistency.yaml +63 -0
- package/rules/shell-prompt-mix.yaml +128 -0
- package/rules/space-before-punctuation.yaml +1 -1
- package/rules/spelling-consistency.yaml +3 -1
- package/rules/step-statement-mix.yaml +76 -0
- package/rules/stock-transition.yaml +8 -1
- package/rules/stray-space.yaml +2 -2
- package/rules/summary-fact-mismatch.yaml +4 -1
- package/rules/table-header-variant.yaml +2 -1
- package/rules/taigen-dome-in-prose.yaml +6 -0
- package/rules/tari-unpaired.yaml +58 -0
- package/rules/teki-overuse.yaml +2 -1
- package/rules/title-case-consistency.yaml +1 -1
- package/rules/title-length.yaml +7 -1
- package/rules/topic-predicate-distance.yaml +6 -1
- package/rules/total-mismatch.yaml +3 -1
- package/rules/translationese-density.yaml +4 -1
- package/rules/unbalanced-bracket.yaml +3 -3
- package/rules/undefined-acronym.yaml +8 -1
- package/rules/unfilled-placeholder.yaml +1 -1
- package/rules/unit-mismatch.yaml +2 -1
- package/rules/unknown-word.yaml +4 -1
- package/rules/unqualified-superlative.yaml +6 -1
- package/rules/unused-definition.yaml +4 -3
- package/rules/url-run-on.yaml +1 -1
- package/rules/use-before-definition.yaml +4 -3
- package/rules/vague-figure-reference.yaml +3 -1
- package/rules/vague-link-text.yaml +2 -1
- package/rules/vague-word-density.yaml +2 -1
- package/rules/very-adjective.yaml +5 -1
- package/rules/weasel-word.yaml +6 -1
- package/rules/wordy-phrase.yaml +6 -1
- package/rules/yori-as-from.yaml +61 -0
- package/src/api.ts +13 -1
- package/src/cli-text.ts +18 -7
- package/src/cli.ts +3 -0
- package/src/command-help.ts +26 -0
- package/src/commands/eval.ts +2 -2
- package/src/commands/fix-plan.ts +13 -1
- package/src/commands/help.ts +8 -0
- package/src/config/load.ts +3 -0
- package/src/config/option-problems.ts +2 -2
- package/src/config/rule-problems.ts +2 -2
- package/src/custom/checked.ts +8 -0
- package/src/custom/dsl-fields.ts +102 -0
- package/src/custom/load.ts +2 -0
- package/src/custom/parse.ts +72 -50
- package/src/custom/problems.ts +18 -2
- package/src/detectors/blank-structure.ts +12 -4
- package/src/detectors/clause-shape.ts +199 -0
- package/src/detectors/code-fences.ts +113 -0
- package/src/detectors/cross-definitions.ts +49 -0
- package/src/detectors/cross-facts.ts +60 -0
- package/src/detectors/cross-registry/cross-doc-duplicate-definition.ts +4 -0
- package/src/detectors/cross-registry/cross-doc-fact-conflict.ts +4 -0
- package/src/detectors/custom.ts +10 -2
- package/src/detectors/defined-term-form.ts +200 -0
- package/src/detectors/email-letter.ts +262 -0
- package/src/detectors/impossible-date.ts +141 -0
- package/src/detectors/impossible-time.ts +151 -0
- package/src/detectors/link-shape.ts +70 -0
- package/src/detectors/mark-shape.ts +202 -0
- package/src/detectors/registry/adverb-polarity.ts +4 -0
- package/src/detectors/registry/attachment-missing.ts +4 -0
- package/src/detectors/registry/bare-url-mix.ts +4 -0
- package/src/detectors/registry/caps-shouting.ts +4 -0
- package/src/detectors/registry/code-fence-language.ts +4 -0
- package/src/detectors/registry/defined-name-repeated.ts +4 -0
- package/src/detectors/registry/defined-term-form.ts +4 -0
- package/src/detectors/registry/email-frame.ts +4 -0
- package/src/detectors/registry/email-subject.ts +4 -0
- package/src/detectors/registry/ending-run.ts +4 -0
- package/src/detectors/registry/heading-command.ts +4 -0
- package/src/detectors/registry/hyphen-dash.ts +4 -0
- package/src/detectors/registry/image-file-name-alt.ts +4 -0
- package/src/detectors/registry/impossible-date.ts +4 -0
- package/src/detectors/registry/impossible-time.ts +4 -0
- package/src/detectors/registry/latin-abbreviation.ts +4 -0
- package/src/detectors/registry/link-text-url-mismatch.ts +4 -0
- package/src/detectors/registry/mark-consistency.ts +4 -0
- package/src/detectors/registry/origin-particle.ts +4 -0
- package/src/detectors/registry/request-without-deadline.ts +4 -0
- package/src/detectors/registry/sentence-spacing.ts +4 -0
- package/src/detectors/registry/shell-prompt.ts +4 -0
- package/src/detectors/registry/step-statement.ts +4 -0
- package/src/detectors/registry/unpaired-parallel.ts +4 -0
- package/src/detectors/request-owner.ts +141 -0
- package/src/detectors/technical-docs.ts +230 -0
- package/src/extension/pack-read.ts +128 -0
- package/src/extension/plugin-load.ts +49 -9
- package/src/extension/plugin-parse.ts +10 -3
- package/src/facts/address-values.ts +74 -0
- package/src/facts/cross-facts.ts +54 -0
- package/src/fix-plan/chosen-depth.ts +28 -0
- package/src/fix-plan/mode.ts +57 -11
- package/src/fix-plan/plan.ts +37 -5
- package/src/fix-plan/render.ts +24 -0
- package/src/fix-plan/text.ts +47 -10
- package/src/genre-load.ts +7 -4
- package/src/genre-parse.ts +19 -0
- package/src/init.ts +10 -10
- package/src/known-genres.ts +19 -0
- package/src/link-shape.ts +62 -0
- package/src/reasons.ts +16 -4
- package/src/render/explain.ts +14 -2
- package/src/render/friendly.ts +1 -1
- package/src/render/rules-json.ts +14 -3
- package/src/render/rules-table.ts +6 -6
- package/src/render/semantic.ts +2 -2
- package/src/render/suppressions.ts +2 -2
- package/src/rewrite-depth.ts +60 -0
- package/src/rule-fields.ts +95 -0
- package/src/rule-guide.ts +9 -0
- package/src/rule-load.ts +10 -4
- package/src/rule-offs.ts +50 -0
- package/src/structure/build.ts +21 -1
- package/src/structure/cross-definitions.ts +60 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: undefined-acronym
|
|
2
2
|
layer: L1
|
|
3
|
-
status:
|
|
3
|
+
status: stable
|
|
4
4
|
how_to_find: undefined-acronym
|
|
5
5
|
word_list: common-acronym
|
|
6
6
|
extra_word_lists:
|
|
@@ -40,7 +40,14 @@ how_to_fix:
|
|
|
40
40
|
|
|
41
41
|
levels: { strict: 1, normal: 3, relaxed: 6 }
|
|
42
42
|
|
|
43
|
+
# 技術文書の読み手は、分野の略語を知っている。既定の数では group の文書の過半に出たので、測って上げた(spec §21.1)。
|
|
44
|
+
by_genre:
|
|
45
|
+
technical: { strict: 3, normal: 5, relaxed: 8 }
|
|
46
|
+
|
|
43
47
|
use_for: [business, technical, legal, docs, academic, literature, speech]
|
|
48
|
+
off_for:
|
|
49
|
+
literature: "Length, rhythm, repetition and register are the author's choices in literature, and dialogue mixes styles. Only what one work can hold itself to runs: consistent spacing and commas, and numbering without gaps."
|
|
50
|
+
speech/transcript: "A transcript records what was said: its sentences, repeats and register are the speaker's, not the writer's to fix."
|
|
44
51
|
sources: [plain-2011, jis-z8301-2019]
|
|
45
52
|
|
|
46
53
|
group: readability
|
package/rules/unit-mismatch.yaml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: unit-mismatch
|
|
2
2
|
layer: L3
|
|
3
|
-
status:
|
|
3
|
+
status: stable
|
|
4
4
|
how_to_find: unit-mismatch
|
|
5
5
|
requires: [quantities]
|
|
6
6
|
uses: [pos]
|
|
@@ -58,6 +58,7 @@ not_flagged:
|
|
|
58
58
|
ja: 単位が同じ量(食い違いは fact-conflict が見ます)、種類の違う量(長さと重さ)、違う見出しや違う親の項目の下の量、2% までの差は見ません。GB や MB は 1000 倍でも 1024 倍でも合えば合うとみなします。
|
|
59
59
|
en: Values in the same unit (fact-conflict looks at those), of different kinds (a length and a mass), under different headings or parent items, and differences within 2% are left alone. GB and MB agree when they match at either 1000 or 1024.
|
|
60
60
|
rewrite:
|
|
61
|
+
depth: light
|
|
61
62
|
ja:
|
|
62
63
|
direction: 二つの量のどちらが正しいかを書き手に確かめ、もう一方を換算して直してください。どちらが正しいか文書から決まらないときは、推測で選ばずに書き手に聞いてください。
|
|
63
64
|
pairs:
|
package/rules/unknown-word.yaml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: unknown-word
|
|
2
2
|
layer: L2
|
|
3
|
-
status:
|
|
3
|
+
status: stable
|
|
4
4
|
how_to_find: unknown-word
|
|
5
5
|
languages: [en]
|
|
6
6
|
severity: info
|
|
@@ -32,6 +32,8 @@ placeholders:
|
|
|
32
32
|
levels: { strict: warning, normal: info, relaxed: info }
|
|
33
33
|
|
|
34
34
|
use_for: [business, technical, blog, legal, docs, academic, literature, speech]
|
|
35
|
+
off_for:
|
|
36
|
+
literature: "A narrator may hedge, speak with ら dropped, and spell as the work's time and place did."
|
|
35
37
|
|
|
36
38
|
group: slips
|
|
37
39
|
summary:
|
|
@@ -48,6 +50,7 @@ not_flagged:
|
|
|
48
50
|
ja: 大文字を含む語、四字より短い語、コード・URL・メールアドレスの中の語、文書で二度以上使う語、一字違いの辞書の語が無い語、chaff.yaml の names に並べた語、語彙表 known-misspelling が別に言う語は指しません。
|
|
49
51
|
en: Words with a capital letter, words shorter than four letters, words in code, URLs and email addresses, words used twice or more in the document, words with no dictionary word one letter away, words listed under names in chaff.yaml, and the misspellings known-misspelling reports are not reported.
|
|
50
52
|
rewrite:
|
|
53
|
+
depth: light
|
|
51
54
|
en:
|
|
52
55
|
direction: If the flagged word is a typo, replace it with the suggested dictionary word, or another word the sentence means. If it is a real word or a name, leave it and add it to names in chaff.yaml.
|
|
53
56
|
pairs:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: unqualified-superlative
|
|
2
2
|
layer: L2
|
|
3
|
-
status:
|
|
3
|
+
status: stable
|
|
4
4
|
how_to_find: unqualified-superlative
|
|
5
5
|
word_list: superlative
|
|
6
6
|
extra_word_lists: [comparison-marker, superlative-scope, quantity-noun]
|
|
@@ -26,6 +26,11 @@ how_to_fix:
|
|
|
26
26
|
levels: { strict: 1, normal: 2, relaxed: 4 }
|
|
27
27
|
|
|
28
28
|
use_for: [business, blog, legal, docs, academic, literature, speech]
|
|
29
|
+
off_for:
|
|
30
|
+
legal: "Legal drafting repeats its terms and its sentence heads on purpose, puts the actor in the passive (shall be deemed), and joins long noun compounds (個人情報取扱事業者). This rule would only flag the form."
|
|
31
|
+
docs: "A help page repeats its heading in its first line (To upload a file, ...) and states no claims to back up."
|
|
32
|
+
literature: "Length, rhythm, repetition and register are the author's choices in literature, and dialogue mixes styles. Only what one work can hold itself to runs: consistent spacing and commas, and numbering without gaps."
|
|
33
|
+
speech/transcript: "A transcript records what was said: its sentences, repeats and register are the speaker's, not the writer's to fix."
|
|
29
34
|
sources: [femmer-2017]
|
|
30
35
|
|
|
31
36
|
group: wording
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
id: unused-definition
|
|
2
2
|
layer: L3
|
|
3
|
-
status:
|
|
3
|
+
status: stable
|
|
4
4
|
how_to_find: unused-definition
|
|
5
5
|
requires: [structure]
|
|
6
|
-
severity:
|
|
6
|
+
severity: info
|
|
7
7
|
|
|
8
8
|
name:
|
|
9
9
|
ja: 定義したのに使っていない語
|
|
@@ -27,7 +27,7 @@ placeholders:
|
|
|
27
27
|
ja: 〇〇
|
|
28
28
|
en: the term
|
|
29
29
|
|
|
30
|
-
levels: { strict:
|
|
30
|
+
levels: { strict: warning, normal: info, relaxed: info }
|
|
31
31
|
|
|
32
32
|
use_for: [business, technical, blog, legal, docs, academic, literature, speech]
|
|
33
33
|
|
|
@@ -51,6 +51,7 @@ not_flagged:
|
|
|
51
51
|
ja: 定義の書き方(「X」とは、以下「X」という)で書いた語だけを見ます。複数形と所有の形(Services、Seller's)は使用に数えます。同じ語の二つ目の定義は duplicate-definition が言います。
|
|
52
52
|
en: Only terms defined in a recognised form ("X" means, (the "X")) are checked. Plurals and possessives (Services, Seller's) count as uses. A second definition of the same term is duplicate-definition's to report.
|
|
53
53
|
rewrite:
|
|
54
|
+
depth: light
|
|
54
55
|
ja:
|
|
55
56
|
direction: 本文で使っていない定義を消してください。本文が同じものを別の語で呼んでいるなら、その語を定義した語に替えます。どちらかは書き手に聞きます。
|
|
56
57
|
pairs:
|
package/rules/url-run-on.yaml
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
id: use-before-definition
|
|
2
2
|
layer: L3
|
|
3
|
-
status:
|
|
3
|
+
status: stable
|
|
4
4
|
how_to_find: use-before-definition
|
|
5
5
|
requires: [structure]
|
|
6
|
-
severity:
|
|
6
|
+
severity: info
|
|
7
7
|
|
|
8
8
|
name:
|
|
9
9
|
ja: 定義より前で使っている語
|
|
@@ -29,7 +29,7 @@ placeholders:
|
|
|
29
29
|
ja: 〇
|
|
30
30
|
en: N
|
|
31
31
|
|
|
32
|
-
levels: { strict:
|
|
32
|
+
levels: { strict: warning, normal: info, relaxed: info }
|
|
33
33
|
|
|
34
34
|
use_for: [business, technical, blog, legal, docs, academic, literature, speech]
|
|
35
35
|
|
|
@@ -53,6 +53,7 @@ not_flagged:
|
|
|
53
53
|
ja: 定義の条(「X」とは…をいう)で定義した語は、前で使っても言いません。定義の条は文書の頭にも終わりにも置く書き方があるためです。最初の一か所だけを指します。
|
|
54
54
|
en: Terms defined in a definitions clause ("X" means ...) are not checked, since a definitions clause may come first or last. Only the first early use is pointed at.
|
|
55
55
|
rewrite:
|
|
56
|
+
depth: structure
|
|
56
57
|
ja:
|
|
57
58
|
direction: 定義を、その語を最初に使う文へ移してください。移せないなら、前の文を定義した語を使わない書き方にします。
|
|
58
59
|
pairs:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: vague-figure-reference
|
|
2
2
|
layer: L2
|
|
3
|
-
status:
|
|
3
|
+
status: stable
|
|
4
4
|
how_to_find: vague-figure-pointer
|
|
5
5
|
# 置き場所で指す言い方と、その言い方が指す種類(図・表)。図・表に名前を付ける語は dangling-figure-reference と同じ figure-label。
|
|
6
6
|
# 箇条を置き場所で指す言い方は vague-clause-pointer。文書の構造の木に番号付きの条か章があるときだけ見る。
|
|
@@ -35,6 +35,8 @@ placeholders:
|
|
|
35
35
|
levels: { strict: error, normal: warning, relaxed: info }
|
|
36
36
|
|
|
37
37
|
use_for: [business, technical, blog, legal, docs, academic, literature, speech]
|
|
38
|
+
off_for:
|
|
39
|
+
literature: "Length, rhythm, repetition and register are the author's choices in literature, and dialogue mixes styles. Only what one work can hold itself to runs: consistent spacing and commas, and numbering without gaps."
|
|
38
40
|
sources: [jis-z8301-2019]
|
|
39
41
|
|
|
40
42
|
group: structure
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: vague-link-text
|
|
2
2
|
layer: L1
|
|
3
|
-
status:
|
|
3
|
+
status: stable
|
|
4
4
|
how_to_find: vague-link-text
|
|
5
5
|
word_list: vague-link-text
|
|
6
6
|
requires: [markdown]
|
|
@@ -51,6 +51,7 @@ not_flagged:
|
|
|
51
51
|
ja: 言葉の一部に「こちら」を含むだけのリンク(「料金表はこちら」)、URL をそのまま書いたリンク、参照の形のリンク([こちら][1])は指しません。Markdown でない文書と、引用(>)とコードの中のリンクも見ません。
|
|
52
52
|
en: Link text that only contains such a word ("pricing here"), a bare or angle-bracket URL, and reference-style links ([here][1]) are not reported, nor are links in a quotation (>), in code, or in a document that is not Markdown.
|
|
53
53
|
rewrite:
|
|
54
|
+
depth: light
|
|
54
55
|
ja:
|
|
55
56
|
direction: リンクの言葉を、行き先の名前(ページの題、資料の名前)に変えてください。「こちら」「ここ」は文から外し、文は行き先の名前を言う形に組み直します。行き先の URL は変えません。
|
|
56
57
|
pairs:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: vague-word-density
|
|
2
2
|
layer: L2
|
|
3
|
-
status:
|
|
3
|
+
status: stable
|
|
4
4
|
how_to_find: vague-density
|
|
5
5
|
word_list: vague-word
|
|
6
6
|
uses: [pos]
|
|
@@ -59,6 +59,7 @@ level_meaning:
|
|
|
59
59
|
ja: 1000 字あたりあいまいな語 {limit} 個まで
|
|
60
60
|
en: up to {limit} vague words per 1000 words
|
|
61
61
|
rewrite:
|
|
62
|
+
depth: light
|
|
62
63
|
ja:
|
|
63
64
|
direction: あいまいな語を、何を・どこまで・いつまでに置き換えてください。決まっていないなら、決まっていないことと、誰が決めるのかを書きます。
|
|
64
65
|
pairs:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: very-adjective
|
|
2
2
|
layer: L2
|
|
3
|
-
status:
|
|
3
|
+
status: stable
|
|
4
4
|
how_to_find: intensified-adjective
|
|
5
5
|
word_list: very-intensifier
|
|
6
6
|
extra_word_lists: [very-exception]
|
|
@@ -27,6 +27,9 @@ how_to_fix:
|
|
|
27
27
|
levels: { strict: 1, normal: 2, relaxed: 4 }
|
|
28
28
|
|
|
29
29
|
use_for: [business, technical, blog, legal, docs, academic, literature, speech]
|
|
30
|
+
off_for:
|
|
31
|
+
literature: 'Dialect and old usage ("an hospital") are the work''s voice, and dialogue leans on "very".'
|
|
32
|
+
speech: "A transcript keeps the speaker's words: hedges and ら dropped as spoken."
|
|
30
33
|
|
|
31
34
|
group: wording
|
|
32
35
|
summary:
|
|
@@ -47,6 +50,7 @@ level_meaning:
|
|
|
47
50
|
ja: very + 形容詞が 1000 語あたり {limit} 個まで
|
|
48
51
|
en: up to {limit} "very" + adjective per 1000 words
|
|
49
52
|
rewrite:
|
|
53
|
+
depth: light
|
|
50
54
|
en:
|
|
51
55
|
direction: Replace "very" + adjective with a stronger single word, or with what the text says about how much. If the text says nothing more, a plain adjective without "very" will do.
|
|
52
56
|
pairs:
|
package/rules/weasel-word.yaml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: weasel-word
|
|
2
2
|
layer: L2
|
|
3
|
-
status:
|
|
3
|
+
status: stable
|
|
4
4
|
how_to_find: phrase-match
|
|
5
5
|
word_list: weasel-word
|
|
6
6
|
requires: [pos]
|
|
@@ -26,6 +26,10 @@ how_to_fix:
|
|
|
26
26
|
levels: { strict: 1, normal: 1, relaxed: 2 }
|
|
27
27
|
|
|
28
28
|
use_for: [business, technical, blog, legal, docs, academic, literature, speech]
|
|
29
|
+
off_for:
|
|
30
|
+
legal: "Legal drafting repeats its terms and its sentence heads on purpose, puts the actor in the passive (shall be deemed), and joins long noun compounds (個人情報取扱事業者). This rule would only flag the form."
|
|
31
|
+
literature: 'A narrator and a character speak as they speak: dialect ("would of"), "So," and hearsay are the voice.'
|
|
32
|
+
speech: "A transcript keeps the speaker's words: hedges and ら dropped as spoken."
|
|
29
33
|
|
|
30
34
|
group: wording
|
|
31
35
|
summary:
|
|
@@ -45,6 +49,7 @@ level_meaning:
|
|
|
45
49
|
ja: 当てはまる言い回しが {limit} 箇所あれば指摘
|
|
46
50
|
en: reported once there are {limit}
|
|
47
51
|
rewrite:
|
|
52
|
+
depth: light
|
|
48
53
|
en:
|
|
49
54
|
direction: Replace the unnamed crowd ("many experts", "studies") with the person or study the text or its sources name. If they name none, do not invent one; ask the writer, or state the claim as the writer's own.
|
|
50
55
|
pairs:
|
package/rules/wordy-phrase.yaml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
id: wordy-phrase
|
|
2
2
|
layer: L2
|
|
3
|
-
status:
|
|
3
|
+
status: stable
|
|
4
4
|
how_to_find: phrase-match
|
|
5
5
|
word_list: wordy-phrase
|
|
6
6
|
requires: [pos]
|
|
@@ -27,6 +27,10 @@ how_to_fix:
|
|
|
27
27
|
levels: { strict: 1, normal: 2, relaxed: 4 }
|
|
28
28
|
|
|
29
29
|
use_for: [business, technical, blog, legal, docs, academic, literature, speech]
|
|
30
|
+
off_for:
|
|
31
|
+
legal: 'Drafting writes "in the event that" and "for the purpose of" on purpose.'
|
|
32
|
+
literature: 'A narrator and a character speak as they speak: dialect ("would of"), "So," and hearsay are the voice.'
|
|
33
|
+
speech: "A transcript keeps the speaker's words: hedges and ら dropped as spoken."
|
|
30
34
|
|
|
31
35
|
group: wording
|
|
32
36
|
summary:
|
|
@@ -46,6 +50,7 @@ level_meaning:
|
|
|
46
50
|
ja: 回りくどい言い回しを含む文が {limit} 文あれば指摘
|
|
47
51
|
en: reported once {limit} sentences hold one
|
|
48
52
|
rewrite:
|
|
53
|
+
depth: light
|
|
49
54
|
en:
|
|
50
55
|
direction: Replace the wordy phrase with its short form from the lexicon. Leave the rest of the sentence alone.
|
|
51
56
|
pairs:
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
id: yori-as-from
|
|
2
|
+
layer: L3
|
|
3
|
+
status: stable
|
|
4
|
+
how_to_find: origin-particle
|
|
5
|
+
word_list: origin-particle
|
|
6
|
+
extra_word_lists: [origin-head]
|
|
7
|
+
requires: [pos]
|
|
8
|
+
languages: [ja]
|
|
9
|
+
severity: info
|
|
10
|
+
|
|
11
|
+
name:
|
|
12
|
+
ja: 起点を言う「より」
|
|
13
|
+
en: より used for "from"
|
|
14
|
+
|
|
15
|
+
why:
|
|
16
|
+
ja: 公用文では、「より」は比べるときだけに使い、時や所の起点は「から」で書きます。「4月1日より開始」「担当者よりご連絡します」の「より」は起点です。比べる「より」(昨年より増えた)と同じ字なので、読み手は一瞬どちらかを考えます。「より」の後に始まり・送り・来ることを言う語(開始、連絡、参る)が続くときだけ指します。
|
|
17
|
+
en: Japanese official style uses より only for comparison ("more than") and から for a starting point ("from"). In 4月1日より開始 ("starting from 1 April") より marks a start, and the reader has to work out which より it is. chaff reports より only when a word for starting, sending or coming (開始, 連絡, 参る) follows it.
|
|
18
|
+
|
|
19
|
+
message:
|
|
20
|
+
ja: 起点の「{word}」は「{suggestion}」と書けます
|
|
21
|
+
en: '"{word}" marks a starting point here; write "{suggestion}"'
|
|
22
|
+
|
|
23
|
+
how_to_fix:
|
|
24
|
+
ja: 起点なら「から」にしてください(4月1日より開始 → 4月1日から開始)。
|
|
25
|
+
en: For a starting point, write から (4月1日より開始 → 4月1日から開始).
|
|
26
|
+
|
|
27
|
+
levels: { strict: warning, normal: info, relaxed: info }
|
|
28
|
+
|
|
29
|
+
use_for: [business, technical, legal, docs, academic, literature, speech]
|
|
30
|
+
off_for:
|
|
31
|
+
literature: "Spoken 全然大丈夫, なので and より in a character's voice; classical verse has a たり that does not list."
|
|
32
|
+
speech: "Spoken Japanese says 全然大丈夫, opens with なので and greets with より参りました."
|
|
33
|
+
sources: [koyobun-2022]
|
|
34
|
+
|
|
35
|
+
group: wording
|
|
36
|
+
summary:
|
|
37
|
+
ja: 「4月1日より開始」のように、起点を「から」でなく「より」で書いた所
|
|
38
|
+
en: より written for a starting point (4月1日より開始) where Japanese official style writes から
|
|
39
|
+
example:
|
|
40
|
+
ja:
|
|
41
|
+
before: |
|
|
42
|
+
新しい窓口は4月1日より受付を開始します。
|
|
43
|
+
after: |
|
|
44
|
+
新しい窓口は4月1日から受付を開始します。
|
|
45
|
+
|
|
46
|
+
not_flagged:
|
|
47
|
+
ja: 比べる「より」(昨年より増えた、これより大きい)と「により」「より一層」は指しません。名詞が続くときは、それが「を」か「する」「いたす」を伴う動作のときだけ指します(昨年より販売が増えた、は指しません)。鉤括弧で引いた中は見ません。
|
|
48
|
+
en: Comparison (昨年より増えた, "more than last year"), により ("by") and より一層 are not reported. A following noun counts only when it is an action taking を or a light verb, so 昨年より販売が増えた is not reported. Nothing quoted in 「」 is checked.
|
|
49
|
+
rewrite:
|
|
50
|
+
depth: light
|
|
51
|
+
ja:
|
|
52
|
+
direction: 起点を言う「より」を「から」に替えてください。替えるのはその一語だけです。
|
|
53
|
+
pairs:
|
|
54
|
+
- before: 新しい窓口は4月1日より受付を開始します。
|
|
55
|
+
after: 新しい窓口は4月1日から受付を開始します。
|
|
56
|
+
- before: 詳細は担当者よりご連絡いたします。
|
|
57
|
+
after: 詳細は担当者からご連絡いたします。
|
|
58
|
+
keep:
|
|
59
|
+
- 日付、名前、敬語の形
|
|
60
|
+
avoid:
|
|
61
|
+
- 比べる「より」まで替える
|
package/src/api.ts
CHANGED
|
@@ -107,9 +107,21 @@ export type RuleSpec = {
|
|
|
107
107
|
readonly name?: Text;
|
|
108
108
|
readonly why?: Text;
|
|
109
109
|
readonly how_to_fix?: Text;
|
|
110
|
-
|
|
110
|
+
/** { before, after }, or one pair per language as chaff's own rules write it: { ja: { before, after }, en: … }. */
|
|
111
|
+
readonly example?: { readonly before: Text; readonly after: Text } | Readonly<Record<string, { readonly before: string; readonly after: string }>>;
|
|
111
112
|
readonly message?: Text;
|
|
113
|
+
/** One severity for normal; strict is one heavier and relaxed one lighter. Or levels, not both. */
|
|
112
114
|
readonly level?: Severity;
|
|
115
|
+
/** A severity for each level, as chaff's rules with nothing to count write them. normal is required. */
|
|
116
|
+
readonly levels?: Readonly<Partial<Record<"strict" | "normal" | "relaxed", Severity>>>;
|
|
117
|
+
/** The genres the rule is for, or their first part (business, business/report). Without it, every genre. */
|
|
118
|
+
readonly use_for?: readonly string[];
|
|
119
|
+
/** Where the rule reference lists it (readability, wording, …). Without it, team. */
|
|
120
|
+
readonly group?: string;
|
|
121
|
+
/** What the rule finds, in one line. Without it, the name. */
|
|
122
|
+
readonly summary?: Text;
|
|
123
|
+
/** How chaff fix-plan rewrites what the rule flags: depth (light / structure / register) and, by language, direction, pairs, keep and avoid. */
|
|
124
|
+
readonly rewrite?: Readonly<Record<string, unknown>>;
|
|
113
125
|
/** The languages the rule checks. Without it, every language. */
|
|
114
126
|
readonly languages?: readonly string[];
|
|
115
127
|
/** A word list by name; the detector gets it as options.lexicon. A plugin's own lists are named without the plugin's prefix. */
|
package/src/cli-text.ts
CHANGED
|
@@ -5,6 +5,11 @@ import { counted, formFor } from "./render/plural.ts";
|
|
|
5
5
|
import type { GenreSetting } from "./genre-check.ts";
|
|
6
6
|
import type { ProfileSetting } from "./profile/check.ts";
|
|
7
7
|
|
|
8
|
+
const ASCII_AT = /[\x21-\x7e]/u;
|
|
9
|
+
|
|
10
|
+
/** A word set in Japanese text with a space on each side where it starts or ends with Latin text, as the guide writes it. */
|
|
11
|
+
const spacedInJapanese = (word: string): string => `${ASCII_AT.test(word.at(0) ?? "") ? " " : ""}${word}${ASCII_AT.test(word.at(-1) ?? "") ? " " : ""}`;
|
|
12
|
+
|
|
8
13
|
/** What a folder walk looked for, and how to look for more. Markdown always; include adds file-name globs. */
|
|
9
14
|
const lookedForJa = (include: readonly string[]): string => {
|
|
10
15
|
const also = include.length > 0 ? `と ${include.join(" ")}` : "";
|
|
@@ -107,6 +112,8 @@ A rule's level is one of strict / normal / relaxed / off.
|
|
|
107
112
|
|
|
108
113
|
export type CliText = {
|
|
109
114
|
readonly usage: string;
|
|
115
|
+
/** Under one command's lines of the usage, for `chaff <command> --help`. */
|
|
116
|
+
readonly moreHelp: string;
|
|
110
117
|
readonly languageName: (language: string) => string;
|
|
111
118
|
readonly genreSource: Readonly<Record<GenreSource, string>>;
|
|
112
119
|
readonly header: (path: string, genre: string, language: string, from: string, shelved: number, hushed: number) => string;
|
|
@@ -135,6 +142,7 @@ export type CliText = {
|
|
|
135
142
|
export const CLI_TEXT: Texts<CliText> = {
|
|
136
143
|
ja: {
|
|
137
144
|
usage: USAGE_JA,
|
|
145
|
+
moreHelp: "すべてのコマンドと共通の指定は npx chaffjs --help で出ます。",
|
|
138
146
|
languageName: (language) => (language === "ja" ? "日本語" : "英語"),
|
|
139
147
|
genreSource: {
|
|
140
148
|
"--genre": "--genre",
|
|
@@ -146,9 +154,11 @@ export const CLI_TEXT: Texts<CliText> = {
|
|
|
146
154
|
content: "内容",
|
|
147
155
|
},
|
|
148
156
|
header: (path, genre, language, from, shelved, hushed) =>
|
|
149
|
-
[
|
|
150
|
-
|
|
151
|
-
|
|
157
|
+
[
|
|
158
|
+
`${path} ${genre} · ${language} ジャンルは${spacedInJapanese(from)}から`,
|
|
159
|
+
shelved > 0 ? ` 棚上げ ${shelved} 件` : "",
|
|
160
|
+
hushed > 0 ? ` stet ${hushed} 件` : "",
|
|
161
|
+
].join(""),
|
|
152
162
|
suggested: (name, genre) => ` ${name}のようです。--genre ${genre} を試せます`,
|
|
153
163
|
suggestedNote: (name, genre, used) =>
|
|
154
164
|
` ジャンルを決めていないので、${used} として見ました。${name}なら、--genre ${genre} でその種類の書き方に合わせて見ます(npx chaffjs genres で一覧)。`,
|
|
@@ -156,7 +166,7 @@ export const CLI_TEXT: Texts<CliText> = {
|
|
|
156
166
|
noMarkdownHere: (include) => `検査するファイルが 1 つも見つかりませんでした。\n${lookedForJa(include)}`,
|
|
157
167
|
noAdapter: (language) => `言語 "${language}" のアダプタがありません。`,
|
|
158
168
|
unknownGenre: (genre, where, known) =>
|
|
159
|
-
`ジャンル "${genre}" はありません(${where})。使えるのは ${known.join("、")} です。npx
|
|
169
|
+
`ジャンル "${genre}" はありません(${where})。使えるのは ${known.join("、")} です。npx chaffjs genres で一覧が出ます。`,
|
|
160
170
|
genreWhere: (where, files) => {
|
|
161
171
|
if (where === "config") return "chaff.yaml の genre";
|
|
162
172
|
return where === "by_path" ? `chaff.yaml の by_path、files: ${files.join(", ")}` : "--genre";
|
|
@@ -166,7 +176,7 @@ export const CLI_TEXT: Texts<CliText> = {
|
|
|
166
176
|
unknownProfile: (profile, where, known) =>
|
|
167
177
|
`文書の種類 "${profile}" はありません(${where})。使えるのは ${known.join("、")} と、種類を使わない none です。`,
|
|
168
178
|
profileWhere: (where, files) => (where === "config" ? "chaff.yaml の profile" : `chaff.yaml の by_path、files: ${files.join(", ")}`),
|
|
169
|
-
unknownRule: (id) => `${id} というルールはありません。npx
|
|
179
|
+
unknownRule: (id) => `${id} というルールはありません。npx chaffjs rules で一覧が出ます。`,
|
|
170
180
|
unknownRuleWithList: (id, list) => `${id} というルールはありません。\n一覧:\n${list}`,
|
|
171
181
|
unnamed: "(名前なし)",
|
|
172
182
|
sarifWritten: (path, count) => `\n SARIF を書きました: ${path}(${count} 件)`,
|
|
@@ -187,6 +197,7 @@ export const CLI_TEXT: Texts<CliText> = {
|
|
|
187
197
|
},
|
|
188
198
|
en: {
|
|
189
199
|
usage: USAGE_EN,
|
|
200
|
+
moreHelp: "npx chaffjs --help lists every command and the options they share.",
|
|
190
201
|
languageName: (language) => (language === "ja" ? "Japanese" : "English"),
|
|
191
202
|
genreSource: {
|
|
192
203
|
"--genre": "--genre",
|
|
@@ -205,7 +216,7 @@ export const CLI_TEXT: Texts<CliText> = {
|
|
|
205
216
|
noMarkdown: (targets, include) => `No files to check found: ${targets}\n${lookedForEn(include)}`,
|
|
206
217
|
noMarkdownHere: (include) => `No files to check found.\n${lookedForEn(include)}`,
|
|
207
218
|
noAdapter: (language) => `No language package for "${language}".`,
|
|
208
|
-
unknownGenre: (genre, where, known) => `There is no genre "${genre}" (${where}). The genres are ${known.join(", ")}. npx
|
|
219
|
+
unknownGenre: (genre, where, known) => `There is no genre "${genre}" (${where}). The genres are ${known.join(", ")}. npx chaffjs genres lists them.`,
|
|
209
220
|
genreWhere: (where, files) => {
|
|
210
221
|
if (where === "config") return "genre in chaff.yaml";
|
|
211
222
|
return where === "by_path" ? `by_path in chaff.yaml, files: ${files.join(", ")}` : "--genre";
|
|
@@ -215,7 +226,7 @@ export const CLI_TEXT: Texts<CliText> = {
|
|
|
215
226
|
unknownProfile: (profile, where, known) =>
|
|
216
227
|
`There is no document profile "${profile}" (${where}). The profiles are ${known.join(", ")}; none uses no profile.`,
|
|
217
228
|
profileWhere: (where, files) => (where === "config" ? "profile in chaff.yaml" : `by_path in chaff.yaml, files: ${files.join(", ")}`),
|
|
218
|
-
unknownRule: (id) => `There is no rule named ${id}. npx
|
|
229
|
+
unknownRule: (id) => `There is no rule named ${id}. npx chaffjs rules lists them.`,
|
|
219
230
|
unknownRuleWithList: (id, list) => `There is no rule named ${id}.\nRules:\n${list}`,
|
|
220
231
|
unnamed: "(no name)",
|
|
221
232
|
sarifWritten: (path, count) => `\n Wrote SARIF: ${path} (${counted(count, "finding")})`,
|
package/src/cli.ts
CHANGED
|
@@ -29,6 +29,8 @@ import { renderSarif } from "./render/sarif.ts";
|
|
|
29
29
|
import { VERSION, VERSION_LINES } from "./version.ts";
|
|
30
30
|
import type { TreeContext } from "./commands/tree.ts";
|
|
31
31
|
import { DOCUMENT_COMMANDS } from "./commands/document-commands.ts";
|
|
32
|
+
import { asksForHelp } from "./command-help.ts";
|
|
33
|
+
import { printCommandHelp } from "./commands/help.ts";
|
|
32
34
|
import { runSkill } from "./commands/skill.ts";
|
|
33
35
|
import { GRADE_EXIT, runGrade } from "./commands/grade.ts";
|
|
34
36
|
import { fixPlanTargets, runFixPlan } from "./commands/fix-plan.ts";
|
|
@@ -338,6 +340,7 @@ const dispatch = async (argv: readonly string[]): Promise<number> => {
|
|
|
338
340
|
console.log(VERSION_LINES.join("\n"));
|
|
339
341
|
return 0;
|
|
340
342
|
}
|
|
343
|
+
if ((first === "lint" || HANDLERS[first] !== undefined) && asksForHelp(argv)) return printCommandHelp(hostText(readConfig()), first);
|
|
341
344
|
// 知らないジャンルではどの rule も当たらず、知らない文書の種類では種類の知識が外れる。どちらも素通りに見えるので、何かする前に止める。
|
|
342
345
|
const config = withIncludes(await withExtensions(readConfig()), argv);
|
|
343
346
|
const problems = settingProblems(first, flag(argv, "--genre"), config, hostText(config), hostLanguage(config.language, process.env));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Pure: what `chaff <command> --help` prints, taken from the usage that `chaff --help` prints, so the two cannot drift.
|
|
2
|
+
|
|
3
|
+
const ENTRY = /^ {2}chaff (\S+)/u;
|
|
4
|
+
const CONTINUATION = /^ {3,}\S/u;
|
|
5
|
+
const HELP_FLAGS: ReadonlySet<string> = new Set(["--help", "-h"]);
|
|
6
|
+
|
|
7
|
+
/** Whether the arguments after the command ask for its help. */
|
|
8
|
+
export const asksForHelp = (argv: readonly string[]): boolean => argv.slice(1).some((arg) => HELP_FLAGS.has(arg));
|
|
9
|
+
|
|
10
|
+
const namesOf = (line: string): readonly string[] => ENTRY.exec(line)?.[1]?.split("|") ?? [];
|
|
11
|
+
|
|
12
|
+
/** The usage's lines for one command: each line naming it (" chaff relax|strict|off …"), with the lines indented under it. */
|
|
13
|
+
export const commandUsage = (usage: string, command: string): string[] =>
|
|
14
|
+
usage.split("\n").reduce<{ owned: boolean; lines: string[] }>(
|
|
15
|
+
(state, line) => {
|
|
16
|
+
const owned = ENTRY.test(line) ? namesOf(line).includes(command) : state.owned && CONTINUATION.test(line);
|
|
17
|
+
return { owned, lines: owned ? [...state.lines, line] : state.lines };
|
|
18
|
+
},
|
|
19
|
+
{ owned: false, lines: [] },
|
|
20
|
+
).lines;
|
|
21
|
+
|
|
22
|
+
/** `chaff <command> --help`: the command's lines of the usage and where the rest is, or the whole usage when it has none. */
|
|
23
|
+
export const commandHelp = (usage: string, command: string, moreHelp: string): string => {
|
|
24
|
+
const lines = commandUsage(usage, command);
|
|
25
|
+
return lines.length === 0 ? usage : [...lines, "", moreHelp].join("\n");
|
|
26
|
+
};
|
package/src/commands/eval.ts
CHANGED
|
@@ -20,11 +20,11 @@ const TEXT: Texts<{
|
|
|
20
20
|
readonly unknownRule: (id: string) => string;
|
|
21
21
|
}> = {
|
|
22
22
|
ja: {
|
|
23
|
-
mixed: (mixes) => `言語かジャンルが混ざっています: ${mixes}\n1 つに絞って測ってください(例: npx
|
|
23
|
+
mixed: (mixes) => `言語かジャンルが混ざっています: ${mixes}\n1 つに絞って測ってください(例: npx chaffjs eval examples/blog-ja/)。`,
|
|
24
24
|
unknownRule: (id) => `${id} という rule はありません。`,
|
|
25
25
|
},
|
|
26
26
|
en: {
|
|
27
|
-
mixed: (mixes) => `Languages or genres are mixed: ${mixes}\nMeasure one at a time (for example npx
|
|
27
|
+
mixed: (mixes) => `Languages or genres are mixed: ${mixes}\nMeasure one at a time (for example npx chaffjs eval examples/blog-en/).`,
|
|
28
28
|
unknownRule: (id) => `There is no rule named ${id}.`,
|
|
29
29
|
},
|
|
30
30
|
};
|
package/src/commands/fix-plan.ts
CHANGED
|
@@ -4,12 +4,17 @@ import { structureOf } from "../structure-shape/of-document.ts";
|
|
|
4
4
|
import { buildFixPlan } from "../fix-plan/plan.ts";
|
|
5
5
|
import { renderFixPlanJson, renderFixPlanMarkdown } from "../fix-plan/render.ts";
|
|
6
6
|
import { FIX_PLAN_TEXT } from "../fix-plan/text.ts";
|
|
7
|
+
import { chosenDepthOf } from "../fix-plan/chosen-depth.ts";
|
|
7
8
|
import type { Checked } from "./feedback.ts";
|
|
8
9
|
import { readDocument } from "./read-document.ts";
|
|
9
10
|
import type { TreeContext } from "./tree.ts";
|
|
10
11
|
|
|
11
12
|
/** Options whose value is the next argument. That value is not a file. */
|
|
12
|
-
const VALUED: ReadonlySet<string> = new Set(["--language", "--genre"]);
|
|
13
|
+
const VALUED: ReadonlySet<string> = new Set(["--language", "--genre", "--depth"]);
|
|
14
|
+
|
|
15
|
+
/** --depth's value: undefined when not given, empty when given with nothing after it (which is then reported). */
|
|
16
|
+
const depthFlag = (argv: readonly string[], context: FixPlanContext): string | undefined =>
|
|
17
|
+
argv.includes("--depth") ? (context.flag(argv, "--depth") ?? "") : undefined;
|
|
13
18
|
|
|
14
19
|
export const fixPlanTargets = (argv: readonly string[]): string[] =>
|
|
15
20
|
argv.slice(1).filter((arg, index, all) => !arg.startsWith("--") && !VALUED.has(all[index - 1] ?? ""));
|
|
@@ -24,6 +29,12 @@ export type FixPlanContext = TreeContext & {
|
|
|
24
29
|
* the document-level signals, the structure targets from human articles, a recommended mode and the checks to run after. Deterministic; sends nothing anywhere.
|
|
25
30
|
*/
|
|
26
31
|
export const runFixPlan = async (targets: readonly string[], argv: readonly string[], context: FixPlanContext): Promise<number> => {
|
|
32
|
+
// Checked first: a file name written after --depth by mistake is reported as the depth it was read as.
|
|
33
|
+
const depth = chosenDepthOf(depthFlag(argv, context), context.config.fixPlan, context.ui ?? "ja");
|
|
34
|
+
if ("problem" in depth) {
|
|
35
|
+
console.error(`chaff: ${depth.problem}`);
|
|
36
|
+
return 1;
|
|
37
|
+
}
|
|
27
38
|
const [path] = targets;
|
|
28
39
|
if (path === undefined || targets.length > 1) {
|
|
29
40
|
console.error(FIX_PLAN_TEXT[context.ui ?? "ja"].usage);
|
|
@@ -49,6 +60,7 @@ export const runFixPlan = async (targets: readonly string[], argv: readonly stri
|
|
|
49
60
|
outline: outlineOf(prose.doc),
|
|
50
61
|
structure: structureOf(prose.doc),
|
|
51
62
|
phrases: prose.doc.lexicons["ai-tell"] ?? [],
|
|
63
|
+
chosenDepth: depth.chosen,
|
|
52
64
|
});
|
|
53
65
|
console.log(argv.includes("--json") ? renderFixPlanJson(plan) : renderFixPlanMarkdown(plan));
|
|
54
66
|
return 0;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { commandHelp } from "../command-help.ts";
|
|
2
|
+
import type { CliText } from "../cli-text.ts";
|
|
3
|
+
|
|
4
|
+
/** `chaff <command> --help` prints the command's usage and runs nothing: `init --help` must not write chaff.yaml. */
|
|
5
|
+
export const printCommandHelp = (text: CliText, command: string): number => {
|
|
6
|
+
console.log(commandHelp(text.usage, command, text.moreHelp));
|
|
7
|
+
return 0;
|
|
8
|
+
};
|
package/src/config/load.ts
CHANGED
|
@@ -52,6 +52,8 @@ export type Config = {
|
|
|
52
52
|
readonly customRules?: unknown;
|
|
53
53
|
/** grade as written: the rubric `chaff grade` reads (grade/rubric.ts). */
|
|
54
54
|
readonly grade?: unknown;
|
|
55
|
+
/** fix_plan as written: the depth chaff fix-plan rewrites to (fix-plan/chosen-depth.ts reads and checks it). */
|
|
56
|
+
readonly fixPlan?: unknown;
|
|
55
57
|
/** plugins as written: package names and paths. extension/plugin-load.ts reads and checks them. */
|
|
56
58
|
readonly plugins?: unknown;
|
|
57
59
|
/** The code chaff.yaml names, once loaded (extension/load.ts). Reading chaff.yaml does not load it. */
|
|
@@ -197,6 +199,7 @@ export const loadConfig = (path: string): Config => {
|
|
|
197
199
|
style: raw["style"] === undefined || raw["style"] === null ? undefined : (str(raw["style"]) ?? printed(raw["style"])),
|
|
198
200
|
customRules: raw["custom_rules"],
|
|
199
201
|
grade: raw["grade"],
|
|
202
|
+
fixPlan: raw["fix_plan"],
|
|
200
203
|
plugins: raw["plugins"],
|
|
201
204
|
};
|
|
202
205
|
};
|
|
@@ -36,7 +36,7 @@ const TEXT: Texts<ProblemText> = {
|
|
|
36
36
|
ja: {
|
|
37
37
|
notAMap: (where, value) => `${where}: options の ${value} は読めません。ルールの名前の下に、オプションの名前と値を並べてください`,
|
|
38
38
|
problem: (where, problem) => {
|
|
39
|
-
if (problem.kind === "unknown-rule") return `${where}: options の ${problem.rule} というルールはありません(npx
|
|
39
|
+
if (problem.kind === "unknown-rule") return `${where}: options の ${problem.rule} というルールはありません(npx chaffjs rules --json で一覧が出ます)`;
|
|
40
40
|
if (problem.kind === "no-options") return `${where}: ${problem.rule} にはオプションがありません。options に書いても何も変わりません`;
|
|
41
41
|
if (problem.kind === "not-a-map") return `${where}: options の ${problem.rule} の下には、オプションの名前と値を並べてください`;
|
|
42
42
|
if (problem.kind === "unknown-option")
|
|
@@ -47,7 +47,7 @@ const TEXT: Texts<ProblemText> = {
|
|
|
47
47
|
en: {
|
|
48
48
|
notAMap: (where, value) => `${where}: cannot read ${value} under options. Under each rule's name, list option names and values`,
|
|
49
49
|
problem: (where, problem) => {
|
|
50
|
-
if (problem.kind === "unknown-rule") return `${where}: there is no rule named ${problem.rule} under options (npx
|
|
50
|
+
if (problem.kind === "unknown-rule") return `${where}: there is no rule named ${problem.rule} under options (npx chaffjs rules --json lists them)`;
|
|
51
51
|
if (problem.kind === "no-options") return `${where}: ${problem.rule} takes no options, so writing some changes nothing`;
|
|
52
52
|
if (problem.kind === "not-a-map") return `${where}: under options, ${problem.rule} needs option names and values`;
|
|
53
53
|
if (problem.kind === "unknown-option") return `${where}: ${problem.rule} has no option ${problem.option} (it takes ${problem.known.join(" / ")})`;
|
|
@@ -9,7 +9,7 @@ const TEXT: Texts<{
|
|
|
9
9
|
readonly numberOnSeverity: (where: string, id: string) => string;
|
|
10
10
|
}> = {
|
|
11
11
|
ja: {
|
|
12
|
-
unknown: (where, id) => `${where}: ${id} というルールはありません(npx
|
|
12
|
+
unknown: (where, id) => `${where}: ${id} というルールはありません(npx chaffjs rules --json で一覧が出ます)`,
|
|
13
13
|
unreadable: (where, id, value) => `${where}: ${id} の値 ${value} は読めません(strict / normal / relaxed / off か、正の数)`,
|
|
14
14
|
numberOnSemantic: (where, id) =>
|
|
15
15
|
`${where}: ${id} は意味を読む検査なので数値の上限はありません。normal として動きます(strict / normal / relaxed / off で書いてください)`,
|
|
@@ -17,7 +17,7 @@ const TEXT: Texts<{
|
|
|
17
17
|
`${where}: ${id} には数の上限がありません。normal として動きます(段階は指摘の重さを変えます。relaxed で一段軽く、off で止まります)`,
|
|
18
18
|
},
|
|
19
19
|
en: {
|
|
20
|
-
unknown: (where, id) => `${where}: there is no rule named ${id} (npx
|
|
20
|
+
unknown: (where, id) => `${where}: there is no rule named ${id} (npx chaffjs rules --json lists them)`,
|
|
21
21
|
unreadable: (where, id, value) => `${where}: cannot read ${value} as the level of ${id} (strict / normal / relaxed / off, or a positive number)`,
|
|
22
22
|
numberOnSemantic: (where, id) => `${where}: ${id} reads meaning and has no numeric limit; it runs as normal (write strict / normal / relaxed / off)`,
|
|
23
23
|
numberOnSeverity: (where, id) =>
|