@greyworld/code-check-core 1.0.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/dist/facade/code-checker.d.ts +14 -0
- package/dist/facade/code-checker.d.ts.map +1 -0
- package/dist/facade/code-checker.js +63 -0
- package/dist/facade/code-checker.js.map +1 -0
- package/dist/facade/index.d.ts +3 -0
- package/dist/facade/index.d.ts.map +1 -0
- package/dist/facade/index.js +6 -0
- package/dist/facade/index.js.map +1 -0
- package/dist/facade/types.d.ts +24 -0
- package/dist/facade/types.d.ts.map +1 -0
- package/dist/facade/types.js +3 -0
- package/dist/facade/types.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/ast-parser/go/index.d.ts +3 -0
- package/dist/tools/ast-parser/go/index.d.ts.map +1 -0
- package/dist/tools/ast-parser/go/index.js +6 -0
- package/dist/tools/ast-parser/go/index.js.map +1 -0
- package/dist/tools/ast-parser/go/parser.d.ts +56 -0
- package/dist/tools/ast-parser/go/parser.d.ts.map +1 -0
- package/dist/tools/ast-parser/go/parser.js +147 -0
- package/dist/tools/ast-parser/go/parser.js.map +1 -0
- package/dist/tools/ast-parser/go/schema-extractor.d.ts +103 -0
- package/dist/tools/ast-parser/go/schema-extractor.d.ts.map +1 -0
- package/dist/tools/ast-parser/go/schema-extractor.js +487 -0
- package/dist/tools/ast-parser/go/schema-extractor.js.map +1 -0
- package/dist/tools/ast-parser/go/semantic-normalizer.d.ts +51 -0
- package/dist/tools/ast-parser/go/semantic-normalizer.d.ts.map +1 -0
- package/dist/tools/ast-parser/go/semantic-normalizer.js +263 -0
- package/dist/tools/ast-parser/go/semantic-normalizer.js.map +1 -0
- package/dist/tools/ast-parser/go/types.d.ts +131 -0
- package/dist/tools/ast-parser/go/types.d.ts.map +1 -0
- package/dist/tools/ast-parser/go/types.js +3 -0
- package/dist/tools/ast-parser/go/types.js.map +1 -0
- package/dist/tools/ast-parser/markdown/index.d.ts +28 -0
- package/dist/tools/ast-parser/markdown/index.d.ts.map +1 -0
- package/dist/tools/ast-parser/markdown/index.js +31 -0
- package/dist/tools/ast-parser/markdown/index.js.map +1 -0
- package/dist/tools/ast-parser/markdown/parser.d.ts +271 -0
- package/dist/tools/ast-parser/markdown/parser.d.ts.map +1 -0
- package/dist/tools/ast-parser/markdown/parser.js +613 -0
- package/dist/tools/ast-parser/markdown/parser.js.map +1 -0
- package/dist/tools/ast-parser/markdown/types.d.ts +131 -0
- package/dist/tools/ast-parser/markdown/types.d.ts.map +1 -0
- package/dist/tools/ast-parser/markdown/types.js +3 -0
- package/dist/tools/ast-parser/markdown/types.js.map +1 -0
- package/dist/tools/env/index.d.ts +2 -0
- package/dist/tools/env/index.d.ts.map +1 -0
- package/dist/tools/env/index.js +6 -0
- package/dist/tools/env/index.js.map +1 -0
- package/dist/tools/env/load-env.d.ts +9 -0
- package/dist/tools/env/load-env.d.ts.map +1 -0
- package/dist/tools/env/load-env.js +39 -0
- package/dist/tools/env/load-env.js.map +1 -0
- package/dist/tools/line-pattern/index.d.ts +15 -0
- package/dist/tools/line-pattern/index.d.ts.map +1 -0
- package/dist/tools/line-pattern/index.js +25 -0
- package/dist/tools/line-pattern/index.js.map +1 -0
- package/dist/tools/line-pattern/line-pattern.d.ts +53 -0
- package/dist/tools/line-pattern/line-pattern.d.ts.map +1 -0
- package/dist/tools/line-pattern/line-pattern.js +88 -0
- package/dist/tools/line-pattern/line-pattern.js.map +1 -0
- package/dist/tools/line-pattern/segment.d.ts +24 -0
- package/dist/tools/line-pattern/segment.d.ts.map +1 -0
- package/dist/tools/line-pattern/segment.js +15 -0
- package/dist/tools/line-pattern/segment.js.map +1 -0
- package/dist/tools/line-pattern/segments.d.ts +43 -0
- package/dist/tools/line-pattern/segments.d.ts.map +1 -0
- package/dist/tools/line-pattern/segments.js +91 -0
- package/dist/tools/line-pattern/segments.js.map +1 -0
- package/dist/tools/llm/description-intent/format-spec.d.ts +3 -0
- package/dist/tools/llm/description-intent/format-spec.d.ts.map +1 -0
- package/dist/tools/llm/description-intent/format-spec.js +167 -0
- package/dist/tools/llm/description-intent/format-spec.js.map +1 -0
- package/dist/tools/llm/description-intent/index.d.ts +7 -0
- package/dist/tools/llm/description-intent/index.d.ts.map +1 -0
- package/dist/tools/llm/description-intent/index.js +15 -0
- package/dist/tools/llm/description-intent/index.js.map +1 -0
- package/dist/tools/llm/description-intent/intent-detector.d.ts +8 -0
- package/dist/tools/llm/description-intent/intent-detector.d.ts.map +1 -0
- package/dist/tools/llm/description-intent/intent-detector.js +103 -0
- package/dist/tools/llm/description-intent/intent-detector.js.map +1 -0
- package/dist/tools/llm/description-intent/normalizer.d.ts +12 -0
- package/dist/tools/llm/description-intent/normalizer.d.ts.map +1 -0
- package/dist/tools/llm/description-intent/normalizer.js +73 -0
- package/dist/tools/llm/description-intent/normalizer.js.map +1 -0
- package/dist/tools/llm/description-intent/slot-extractor.d.ts +3 -0
- package/dist/tools/llm/description-intent/slot-extractor.d.ts.map +1 -0
- package/dist/tools/llm/description-intent/slot-extractor.js +66 -0
- package/dist/tools/llm/description-intent/slot-extractor.js.map +1 -0
- package/dist/tools/llm/description-intent/types.d.ts +28 -0
- package/dist/tools/llm/description-intent/types.d.ts.map +1 -0
- package/dist/tools/llm/description-intent/types.js +19 -0
- package/dist/tools/llm/description-intent/types.js.map +1 -0
- package/dist/tools/llm/index.d.ts +16 -0
- package/dist/tools/llm/index.d.ts.map +1 -0
- package/dist/tools/llm/index.js +26 -0
- package/dist/tools/llm/index.js.map +1 -0
- package/dist/tools/llm/model.d.ts +3 -0
- package/dist/tools/llm/model.d.ts.map +1 -0
- package/dist/tools/llm/model.js +18 -0
- package/dist/tools/llm/model.js.map +1 -0
- package/dist/tools/llm/structured-caller.d.ts +86 -0
- package/dist/tools/llm/structured-caller.d.ts.map +1 -0
- package/dist/tools/llm/structured-caller.js +181 -0
- package/dist/tools/llm/structured-caller.js.map +1 -0
- package/dist/tools/node-pattern/index.d.ts +17 -0
- package/dist/tools/node-pattern/index.d.ts.map +1 -0
- package/dist/tools/node-pattern/index.js +36 -0
- package/dist/tools/node-pattern/index.js.map +1 -0
- package/dist/tools/node-pattern/matchers.d.ts +61 -0
- package/dist/tools/node-pattern/matchers.d.ts.map +1 -0
- package/dist/tools/node-pattern/matchers.js +154 -0
- package/dist/tools/node-pattern/matchers.js.map +1 -0
- package/dist/tools/node-pattern/node-matcher.d.ts +69 -0
- package/dist/tools/node-pattern/node-matcher.d.ts.map +1 -0
- package/dist/tools/node-pattern/node-matcher.js +122 -0
- package/dist/tools/node-pattern/node-matcher.js.map +1 -0
- package/dist/tools/node-pattern/node-pattern.d.ts +65 -0
- package/dist/tools/node-pattern/node-pattern.d.ts.map +1 -0
- package/dist/tools/node-pattern/node-pattern.js +129 -0
- package/dist/tools/node-pattern/node-pattern.js.map +1 -0
- package/dist/tools/section-check/index.d.ts +4 -0
- package/dist/tools/section-check/index.d.ts.map +1 -0
- package/dist/tools/section-check/index.js +10 -0
- package/dist/tools/section-check/index.js.map +1 -0
- package/dist/tools/section-check/section-check.d.ts +46 -0
- package/dist/tools/section-check/section-check.d.ts.map +1 -0
- package/dist/tools/section-check/section-check.js +264 -0
- package/dist/tools/section-check/section-check.js.map +1 -0
- package/dist/tools/section-check/types.d.ts +35 -0
- package/dist/tools/section-check/types.d.ts.map +1 -0
- package/dist/tools/section-check/types.js +23 -0
- package/dist/tools/section-check/types.js.map +1 -0
- package/dist/tools/text-grep/index.d.ts +10 -0
- package/dist/tools/text-grep/index.d.ts.map +1 -0
- package/dist/tools/text-grep/index.js +13 -0
- package/dist/tools/text-grep/index.js.map +1 -0
- package/dist/tools/text-grep/regex-grep.d.ts +92 -0
- package/dist/tools/text-grep/regex-grep.d.ts.map +1 -0
- package/dist/tools/text-grep/regex-grep.js +141 -0
- package/dist/tools/text-grep/regex-grep.js.map +1 -0
- package/dist/workflow/context/context.d.ts +13 -0
- package/dist/workflow/context/context.d.ts.map +1 -0
- package/dist/workflow/context/context.js +29 -0
- package/dist/workflow/context/context.js.map +1 -0
- package/dist/workflow/implement/resource-check/context-keys.d.ts +30 -0
- package/dist/workflow/implement/resource-check/context-keys.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/context-keys.js +33 -0
- package/dist/workflow/implement/resource-check/context-keys.js.map +1 -0
- package/dist/workflow/implement/resource-check/resource-check-workflow.d.ts +20 -0
- package/dist/workflow/implement/resource-check/resource-check-workflow.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/resource-check-workflow.js +325 -0
- package/dist/workflow/implement/resource-check/resource-check-workflow.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/index.d.ts +5 -0
- package/dist/workflow/implement/resource-check/rules/index.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/index.js +21 -0
- package/dist/workflow/implement/resource-check/rules/index.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/arguments/argument-section-format-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/arguments/argument-section-format-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/arguments/argument-section-format-rule.js +51 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/arguments/argument-section-format-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/attributes/attribute-section-format-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/attributes/attribute-section-format-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/attributes/attribute-section-format-rule.js +60 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/attributes/attribute-section-format-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/blank-line-between-blocks-rule.d.ts +9 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/blank-line-between-blocks-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/blank-line-between-blocks-rule.js +80 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/blank-line-between-blocks-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example/example-section-exists-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example/example-section-exists-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example/example-section-exists-rule.js +42 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example/example-section-exists-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example-section-exists-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example-section-exists-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example-section-exists-rule.js +34 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/example-section-exists-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter/frontmatter-check-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter/frontmatter-check-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter/frontmatter-check-rule.js +33 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter/frontmatter-check-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter-check-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter-check-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter-check-rule.js +33 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/frontmatter-check-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/h1-exists-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/h1-exists-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/h1-exists-rule.js +34 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/h1-exists-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/index.d.ts +11 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/index.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/index.js +38 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/index.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/line-length-rule.d.ts +15 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/line-length-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/line-length-rule.js +77 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/line-length-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/number-format-rule.d.ts +23 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/number-format-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/number-format-rule.js +128 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/number-format-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/shared/section-check-result.d.ts +9 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/shared/section-check-result.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/shared/section-check-result.js +19 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/shared/section-check-result.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/title/h1-exists-rule.d.ts +8 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/title/h1-exists-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/title/h1-exists-rule.js +44 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/title/h1-exists-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/blank-line-between-blocks-rule.d.ts +9 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/blank-line-between-blocks-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/blank-line-between-blocks-rule.js +80 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/blank-line-between-blocks-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/line-length-rule.d.ts +15 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/line-length-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/line-length-rule.js +77 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/line-length-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/number-format-rule.d.ts +23 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/number-format-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/number-format-rule.js +128 -0
- package/dist/workflow/implement/resource-check/rules/markdown-format/total/number-format-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/argument-section-semantic-rule.d.ts +11 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/argument-section-semantic-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/argument-section-semantic-rule.js +145 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/argument-section-semantic-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/arguments/argument-section-semantic-rule.d.ts +11 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/arguments/argument-section-semantic-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/arguments/argument-section-semantic-rule.js +145 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/arguments/argument-section-semantic-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attribute-section-semantic-rule.d.ts +9 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attribute-section-semantic-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attribute-section-semantic-rule.js +83 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attribute-section-semantic-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attributes/attribute-section-semantic-rule.d.ts +9 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attributes/attribute-section-semantic-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attributes/attribute-section-semantic-rule.js +83 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/attributes/attribute-section-semantic-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/index.d.ts +7 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/index.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/index.js +15 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/index.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/section-existence-rule.d.ts +9 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/section-existence-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/section-existence-rule.js +96 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/section-existence-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/total/section-existence-rule.d.ts +9 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/total/section-existence-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/total/section-existence-rule.js +109 -0
- package/dist/workflow/implement/resource-check/rules/markdown-semantic/total/section-existence-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/rules/stage-placeholder-rule.d.ts +19 -0
- package/dist/workflow/implement/resource-check/rules/stage-placeholder-rule.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/rules/stage-placeholder-rule.js +31 -0
- package/dist/workflow/implement/resource-check/rules/stage-placeholder-rule.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/builder.d.ts +15 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/builder.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/builder.js +554 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/builder.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/index.d.ts +5 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/index.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/index.js +16 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/index.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/types.d.ts +94 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/types.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/types.js +42 -0
- package/dist/workflow/implement/resource-check/tools/doc-semantic/types.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/builder.d.ts +4 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/builder.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/builder.js +103 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/builder.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/index.d.ts +3 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/index.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/index.js +6 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/index.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/types.d.ts +47 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/types.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/types.js +3 -0
- package/dist/workflow/implement/resource-check/tools/schema-semantic/types.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/index.d.ts +4 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/index.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/index.js +8 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/index.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/schema-extractor.d.ts +108 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/schema-extractor.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/schema-extractor.js +498 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/schema-extractor.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/semantic-normalizer.d.ts +51 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/semantic-normalizer.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/semantic-normalizer.js +271 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/semantic-normalizer.js.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/types.d.ts +133 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/types.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/types.js +3 -0
- package/dist/workflow/implement/resource-check/tools/terraform-schema/types.js.map +1 -0
- package/dist/workflow/implement/resource-check/types.d.ts +18 -0
- package/dist/workflow/implement/resource-check/types.d.ts.map +1 -0
- package/dist/workflow/implement/resource-check/types.js +107 -0
- package/dist/workflow/implement/resource-check/types.js.map +1 -0
- package/dist/workflow/types/rule/rule.d.ts +72 -0
- package/dist/workflow/types/rule/rule.d.ts.map +1 -0
- package/dist/workflow/types/rule/rule.js +110 -0
- package/dist/workflow/types/rule/rule.js.map +1 -0
- package/dist/workflow/workflow.d.ts +52 -0
- package/dist/workflow/workflow.d.ts.map +1 -0
- package/dist/workflow/workflow.js +121 -0
- package/dist/workflow/workflow.js.map +1 -0
- package/package.json +36 -0
package/dist/workflow/implement/resource-check/rules/markdown-format/total/number-format-rule.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-format-rule.js","sourceRoot":"","sources":["../../../../../../../src/workflow/implement/resource-check/rules/markdown-format/total/number-format-rule.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EAAE,GAAG,CAAC,EACpC,QAAQ,EACR,QAAQ,EACR,EAAE,EACF,sBAAe,CAAC,QAAQ,CAAC,OAAO,CAAC,CACpC,CACJ,CAAC;YACN,CAAC;QACL,CAAC;IACL,CAAC;IAEO,qBAAqB,CAAC,GAAW;QACrC,OAAO,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;IAEO,eAAe,CAAC,MAAc;QAClC,OAAO,MAAM,CAAC,OAAO,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC;IACxD,CAAC;CACJ;AA9ID,4CA8IC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Rule, RuleCheckResult } from "../../../../types/rule/rule";
|
|
2
|
+
import type { Context } from "../../../../context/context";
|
|
3
|
+
export declare class ArgumentSectionSemanticRule extends Rule {
|
|
4
|
+
constructor();
|
|
5
|
+
test(_code: string, _ast?: unknown, parentCtx?: Context): Promise<RuleCheckResult[]>;
|
|
6
|
+
private checkOrdering;
|
|
7
|
+
private checkTagAlignment;
|
|
8
|
+
private checkDescriptionAlignment;
|
|
9
|
+
private checkCompleteness;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=argument-section-semantic-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"argument-section-semantic-rule.d.ts","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-semantic/argument-section-semantic-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAiB,MAAM,6BAA6B,CAAC;AACnF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAmC3D,qBAAa,2BAA4B,SAAQ,IAAI;;IAKpC,IAAI,CACb,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,OAAO,EACd,SAAS,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,eAAe,EAAE,CAAC;IA0C7B,OAAO,CAAC,aAAa;IAmDrB,OAAO,CAAC,iBAAiB;IA0CzB,OAAO,CAAC,yBAAyB;IAiCjC,OAAO,CAAC,iBAAiB;CA+B5B"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArgumentSectionSemanticRule = void 0;
|
|
4
|
+
const rule_1 = require("../../../../types/rule/rule");
|
|
5
|
+
const context_keys_1 = require("../../context-keys");
|
|
6
|
+
const META = {
|
|
7
|
+
name: "argument-section-semantic",
|
|
8
|
+
description: "Arguments in the Markdown document must align with the provider schema " +
|
|
9
|
+
"(ordering, tags, completeness)",
|
|
10
|
+
messages: {
|
|
11
|
+
regionNotFirst: (line) => `Argument "region" must be the first argument, but found at line ${line}.`,
|
|
12
|
+
orderViolation: (name, line) => `Required argument "${name}" (line ${line}) appears after Optional arguments. ` +
|
|
13
|
+
`All Required arguments must precede Optional ones.`,
|
|
14
|
+
missingTag: (name, tag, line) => `Argument "${name}" (line ${line}): missing expected tag "${tag}".`,
|
|
15
|
+
extraTag: (name, tag, line) => `Argument "${name}" (line ${line}): unexpected tag "${tag}" (not in schema).`,
|
|
16
|
+
descriptionMismatch: (name, expected, actual, line) => `Argument "${name}" (line ${line}): description should start with "${expected}" ` +
|
|
17
|
+
`but found "${actual}".`,
|
|
18
|
+
missingInDoc: (name) => `Argument "${name}" is defined in schema but missing from the document.`,
|
|
19
|
+
extraInDoc: (name, line) => `Argument "${name}" (line ${line}) is documented but not found in the schema.`,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
const TAG_SCHEMA_MAP = {
|
|
23
|
+
ForceNew: (f) => f.forceNew,
|
|
24
|
+
NonUpdatable: (f) => f.nonUpdatable,
|
|
25
|
+
};
|
|
26
|
+
class ArgumentSectionSemanticRule extends rule_1.Rule {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(META, "markdown");
|
|
29
|
+
}
|
|
30
|
+
async test(_code, _ast, parentCtx) {
|
|
31
|
+
if (!parentCtx) {
|
|
32
|
+
return [rule_1.RuleCheckResult.pass("Context unavailable, rule skipped")];
|
|
33
|
+
}
|
|
34
|
+
const view = parentCtx.get(context_keys_1.CTX_SCHEMA_SEMANTIC_VIEW);
|
|
35
|
+
const docView = parentCtx.get(context_keys_1.CTX_DOC_SEMANTIC_VIEW);
|
|
36
|
+
if (!view || !docView) {
|
|
37
|
+
return [rule_1.RuleCheckResult.pass("Schema view or doc semantic view unavailable, rule skipped")];
|
|
38
|
+
}
|
|
39
|
+
if (view.arguments.size === 0) {
|
|
40
|
+
return [rule_1.RuleCheckResult.pass("No schema arguments, argument semantic check skipped")];
|
|
41
|
+
}
|
|
42
|
+
const docArgs = docView.argumentLists.flatMap((list) => list.arguments);
|
|
43
|
+
if (docArgs.length === 0) {
|
|
44
|
+
return [rule_1.RuleCheckResult.pass("No doc arguments found, existence checked by SectionExistenceRule")];
|
|
45
|
+
}
|
|
46
|
+
const failures = [];
|
|
47
|
+
this.checkOrdering(docArgs, view, failures);
|
|
48
|
+
this.checkTagAlignment(docArgs, view, failures);
|
|
49
|
+
this.checkDescriptionAlignment(docArgs, view, failures);
|
|
50
|
+
this.checkCompleteness(docArgs, view, failures);
|
|
51
|
+
if (failures.length === 0) {
|
|
52
|
+
return [rule_1.RuleCheckResult.pass("Argument section semantic checks passed")];
|
|
53
|
+
}
|
|
54
|
+
return [
|
|
55
|
+
new rule_1.RuleCheckResult(false, `Argument section has ${failures.length} semantic issue(s)`, "", "", failures),
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
checkOrdering(docArgs, view, failures) {
|
|
59
|
+
if (docArgs.length === 0)
|
|
60
|
+
return;
|
|
61
|
+
const regionIndex = docArgs.findIndex((a) => a.name === "region");
|
|
62
|
+
if (regionIndex > 0) {
|
|
63
|
+
const line = getStartLine(docArgs[regionIndex]);
|
|
64
|
+
failures.push(this.fail("regionNotFirst", "", undefined, rule_1.RuleCheckResult.fromLine(line), line));
|
|
65
|
+
}
|
|
66
|
+
let firstOptionalIndex = -1;
|
|
67
|
+
for (let i = 0; i < docArgs.length; i++) {
|
|
68
|
+
const arg = docArgs[i];
|
|
69
|
+
if (arg.name === "region")
|
|
70
|
+
continue;
|
|
71
|
+
const field = view.arguments.get(arg.name);
|
|
72
|
+
if (!field)
|
|
73
|
+
continue;
|
|
74
|
+
if (field.required) {
|
|
75
|
+
if (firstOptionalIndex >= 0) {
|
|
76
|
+
const line = getStartLine(arg);
|
|
77
|
+
failures.push(this.fail("orderViolation", "", undefined, rule_1.RuleCheckResult.fromLine(line), arg.name, line));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
else if (field.optional) {
|
|
81
|
+
if (firstOptionalIndex < 0) {
|
|
82
|
+
firstOptionalIndex = i;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
checkTagAlignment(docArgs, view, failures) {
|
|
88
|
+
for (const arg of docArgs) {
|
|
89
|
+
const field = view.arguments.get(arg.name);
|
|
90
|
+
if (!field)
|
|
91
|
+
continue;
|
|
92
|
+
const docTagSet = new Set(arg.tags);
|
|
93
|
+
for (const [tag, predicate] of Object.entries(TAG_SCHEMA_MAP)) {
|
|
94
|
+
const line = getStartLine(arg);
|
|
95
|
+
if (predicate(field) && !docTagSet.has(tag)) {
|
|
96
|
+
failures.push(this.fail("missingTag", "", undefined, rule_1.RuleCheckResult.fromLine(line), arg.name, tag, line));
|
|
97
|
+
}
|
|
98
|
+
if (!predicate(field) && docTagSet.has(tag)) {
|
|
99
|
+
failures.push(this.fail("extraTag", "", undefined, rule_1.RuleCheckResult.fromLine(line), arg.name, tag, line));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
checkDescriptionAlignment(docArgs, view, failures) {
|
|
105
|
+
for (const arg of docArgs) {
|
|
106
|
+
const field = view.arguments.get(arg.name);
|
|
107
|
+
if (!field || !field.description)
|
|
108
|
+
continue;
|
|
109
|
+
const expectedPrefix = "Specifies " + lowercaseFirst(field.description);
|
|
110
|
+
const docDesc = arg.description;
|
|
111
|
+
if (!docDesc.startsWith(expectedPrefix)) {
|
|
112
|
+
const previewLen = expectedPrefix.length + 20;
|
|
113
|
+
const actualPreview = docDesc.length > previewLen
|
|
114
|
+
? docDesc.slice(0, previewLen) + "..."
|
|
115
|
+
: docDesc;
|
|
116
|
+
const line = getStartLine(arg);
|
|
117
|
+
failures.push(this.fail("descriptionMismatch", "", undefined, rule_1.RuleCheckResult.fromLine(line), arg.name, expectedPrefix, actualPreview, line));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
checkCompleteness(docArgs, view, failures) {
|
|
122
|
+
const docArgNames = new Set(docArgs.map((a) => a.name));
|
|
123
|
+
for (const [name] of view.arguments) {
|
|
124
|
+
if (!docArgNames.has(name)) {
|
|
125
|
+
failures.push(this.fail("missingInDoc", "", undefined, undefined, name));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
for (const arg of docArgs) {
|
|
129
|
+
if (!view.arguments.has(arg.name)) {
|
|
130
|
+
const line = getStartLine(arg);
|
|
131
|
+
failures.push(this.fail("extraInDoc", "", undefined, rule_1.RuleCheckResult.fromLine(line), arg.name, line));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.ArgumentSectionSemanticRule = ArgumentSectionSemanticRule;
|
|
137
|
+
function lowercaseFirst(s) {
|
|
138
|
+
if (s.length === 0)
|
|
139
|
+
return s;
|
|
140
|
+
return s[0].toLowerCase() + s.slice(1);
|
|
141
|
+
}
|
|
142
|
+
function getStartLine(arg) {
|
|
143
|
+
return arg.sourceRange?.start.line;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=argument-section-semantic-rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"argument-section-semantic-rule.js","sourceRoot":"","sources":["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EAAE,KAAK,CAAC,IAAI,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Rule, RuleCheckResult } from "../../../../../types/rule/rule";
|
|
2
|
+
import type { Context } from "../../../../../context/context";
|
|
3
|
+
export declare class ArgumentSectionSemanticRule extends Rule {
|
|
4
|
+
constructor();
|
|
5
|
+
test(_code: string, _ast?: unknown, parentCtx?: Context): Promise<RuleCheckResult[]>;
|
|
6
|
+
private checkOrdering;
|
|
7
|
+
private checkTagAlignment;
|
|
8
|
+
private checkDescriptionAlignment;
|
|
9
|
+
private checkCompleteness;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=argument-section-semantic-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"argument-section-semantic-rule.d.ts","sourceRoot":"","sources":["../../../../../../../src/workflow/implement/resource-check/rules/markdown-semantic/arguments/argument-section-semantic-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AACtF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAmC9D,qBAAa,2BAA4B,SAAQ,IAAI;;IAKpC,IAAI,CACb,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,OAAO,EACd,SAAS,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,eAAe,EAAE,CAAC;IA0C7B,OAAO,CAAC,aAAa;IAmDrB,OAAO,CAAC,iBAAiB;IA0CzB,OAAO,CAAC,yBAAyB;IAiCjC,OAAO,CAAC,iBAAiB;CA+B5B"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArgumentSectionSemanticRule = void 0;
|
|
4
|
+
const rule_1 = require("../../../../../types/rule/rule");
|
|
5
|
+
const context_keys_1 = require("../../../context-keys");
|
|
6
|
+
const META = {
|
|
7
|
+
name: "argument-section-semantic",
|
|
8
|
+
description: "Arguments in the Markdown document must align with the provider schema " +
|
|
9
|
+
"(ordering, tags, completeness)",
|
|
10
|
+
messages: {
|
|
11
|
+
regionNotFirst: (line) => `Argument "region" must be the first argument, but found at line ${line}.`,
|
|
12
|
+
orderViolation: (name, line) => `Required argument "${name}" (line ${line}) appears after Optional arguments. ` +
|
|
13
|
+
`All Required arguments must precede Optional ones.`,
|
|
14
|
+
missingTag: (name, tag, line) => `Argument "${name}" (line ${line}): missing expected tag "${tag}".`,
|
|
15
|
+
extraTag: (name, tag, line) => `Argument "${name}" (line ${line}): unexpected tag "${tag}" (not in schema).`,
|
|
16
|
+
descriptionMismatch: (name, expected, actual, line) => `Argument "${name}" (line ${line}): description should start with "${expected}" ` +
|
|
17
|
+
`but found "${actual}".`,
|
|
18
|
+
missingInDoc: (name) => `Argument "${name}" is defined in schema but missing from the document.`,
|
|
19
|
+
extraInDoc: (name, line) => `Argument "${name}" (line ${line}) is documented but not found in the schema.`,
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
const TAG_SCHEMA_MAP = {
|
|
23
|
+
ForceNew: (f) => f.forceNew && !f.nonUpdatable,
|
|
24
|
+
NonUpdatable: (f) => f.nonUpdatable,
|
|
25
|
+
};
|
|
26
|
+
class ArgumentSectionSemanticRule extends rule_1.Rule {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(META, "markdown");
|
|
29
|
+
}
|
|
30
|
+
async test(_code, _ast, parentCtx) {
|
|
31
|
+
if (!parentCtx) {
|
|
32
|
+
return [rule_1.RuleCheckResult.pass("Context unavailable, rule skipped")];
|
|
33
|
+
}
|
|
34
|
+
const view = parentCtx.get(context_keys_1.CTX_SCHEMA_SEMANTIC_VIEW);
|
|
35
|
+
const docView = parentCtx.get(context_keys_1.CTX_DOC_SEMANTIC_VIEW);
|
|
36
|
+
if (!view || !docView) {
|
|
37
|
+
return [rule_1.RuleCheckResult.pass("Schema view or doc semantic view unavailable, rule skipped")];
|
|
38
|
+
}
|
|
39
|
+
if (view.arguments.size === 0) {
|
|
40
|
+
return [rule_1.RuleCheckResult.pass("No schema arguments, argument semantic check skipped")];
|
|
41
|
+
}
|
|
42
|
+
const docArgs = docView.argumentLists.flatMap((list) => list.arguments);
|
|
43
|
+
if (docArgs.length === 0) {
|
|
44
|
+
return [rule_1.RuleCheckResult.pass("No doc arguments found, existence checked by SectionExistenceRule")];
|
|
45
|
+
}
|
|
46
|
+
const failures = [];
|
|
47
|
+
this.checkOrdering(docArgs, view, failures);
|
|
48
|
+
this.checkTagAlignment(docArgs, view, failures);
|
|
49
|
+
this.checkDescriptionAlignment(docArgs, view, failures);
|
|
50
|
+
this.checkCompleteness(docArgs, view, failures);
|
|
51
|
+
if (failures.length === 0) {
|
|
52
|
+
return [rule_1.RuleCheckResult.pass("Argument section semantic checks passed")];
|
|
53
|
+
}
|
|
54
|
+
return [
|
|
55
|
+
new rule_1.RuleCheckResult(false, `Argument section has ${failures.length} semantic issue(s)`, "", "", failures),
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
checkOrdering(docArgs, view, failures) {
|
|
59
|
+
if (docArgs.length === 0)
|
|
60
|
+
return;
|
|
61
|
+
const regionIndex = docArgs.findIndex((a) => a.name === "region");
|
|
62
|
+
if (regionIndex > 0) {
|
|
63
|
+
const line = getStartLine(docArgs[regionIndex]);
|
|
64
|
+
failures.push(this.fail("regionNotFirst", "", undefined, rule_1.RuleCheckResult.fromLine(line), line));
|
|
65
|
+
}
|
|
66
|
+
let firstOptionalIndex = -1;
|
|
67
|
+
for (let i = 0; i < docArgs.length; i++) {
|
|
68
|
+
const arg = docArgs[i];
|
|
69
|
+
if (arg.name === "region")
|
|
70
|
+
continue;
|
|
71
|
+
const field = view.arguments.get(arg.name);
|
|
72
|
+
if (!field)
|
|
73
|
+
continue;
|
|
74
|
+
if (field.required) {
|
|
75
|
+
if (firstOptionalIndex >= 0) {
|
|
76
|
+
const line = getStartLine(arg);
|
|
77
|
+
failures.push(this.fail("orderViolation", "", undefined, rule_1.RuleCheckResult.fromLine(line), arg.name, line));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
else if (field.optional) {
|
|
81
|
+
if (firstOptionalIndex < 0) {
|
|
82
|
+
firstOptionalIndex = i;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
checkTagAlignment(docArgs, view, failures) {
|
|
88
|
+
for (const arg of docArgs) {
|
|
89
|
+
const field = view.arguments.get(arg.name);
|
|
90
|
+
if (!field)
|
|
91
|
+
continue;
|
|
92
|
+
const docTagSet = new Set(arg.tags);
|
|
93
|
+
for (const [tag, predicate] of Object.entries(TAG_SCHEMA_MAP)) {
|
|
94
|
+
const line = getStartLine(arg);
|
|
95
|
+
if (predicate(field) && !docTagSet.has(tag)) {
|
|
96
|
+
failures.push(this.fail("missingTag", "", undefined, rule_1.RuleCheckResult.fromLine(line), arg.name, tag, line));
|
|
97
|
+
}
|
|
98
|
+
if (!predicate(field) && docTagSet.has(tag)) {
|
|
99
|
+
failures.push(this.fail("extraTag", "", undefined, rule_1.RuleCheckResult.fromLine(line), arg.name, tag, line));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
checkDescriptionAlignment(docArgs, view, failures) {
|
|
105
|
+
for (const arg of docArgs) {
|
|
106
|
+
const field = view.arguments.get(arg.name);
|
|
107
|
+
if (!field || !field.description)
|
|
108
|
+
continue;
|
|
109
|
+
const expectedPrefix = "Specifies " + lowercaseFirst(field.description);
|
|
110
|
+
const docDesc = arg.description;
|
|
111
|
+
if (!docDesc.startsWith(expectedPrefix)) {
|
|
112
|
+
const previewLen = expectedPrefix.length + 20;
|
|
113
|
+
const actualPreview = docDesc.length > previewLen
|
|
114
|
+
? docDesc.slice(0, previewLen) + "..."
|
|
115
|
+
: docDesc;
|
|
116
|
+
const line = getStartLine(arg);
|
|
117
|
+
failures.push(this.fail("descriptionMismatch", "", undefined, rule_1.RuleCheckResult.fromLine(line), arg.name, expectedPrefix, actualPreview, line));
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
checkCompleteness(docArgs, view, failures) {
|
|
122
|
+
const docArgNames = new Set(docArgs.map((a) => a.name));
|
|
123
|
+
for (const [name] of view.arguments) {
|
|
124
|
+
if (!docArgNames.has(name)) {
|
|
125
|
+
failures.push(this.fail("missingInDoc", "", undefined, undefined, name));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
for (const arg of docArgs) {
|
|
129
|
+
if (!view.arguments.has(arg.name)) {
|
|
130
|
+
const line = getStartLine(arg);
|
|
131
|
+
failures.push(this.fail("extraInDoc", "", undefined, rule_1.RuleCheckResult.fromLine(line), arg.name, line));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
exports.ArgumentSectionSemanticRule = ArgumentSectionSemanticRule;
|
|
137
|
+
function lowercaseFirst(s) {
|
|
138
|
+
if (s.length === 0)
|
|
139
|
+
return s;
|
|
140
|
+
return s[0].toLowerCase() + s.slice(1);
|
|
141
|
+
}
|
|
142
|
+
function getStartLine(arg) {
|
|
143
|
+
return arg.sourceRange?.start.line;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=argument-section-semantic-rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"argument-section-semantic-rule.js","sourceRoot":"","sources":["../../../../../../../src/workflow/implement/resource-check/rules/markdown-semantic/arguments/argument-section-semantic-rule.ts"],"names":[],"mappings":";;;AAAA,yDAAsF;AAItF,wDAAwF;AAExF,MAAM,IAAI,GAAa;IACnB,IAAI,EAAE,2BAA2B;IACjC,WAAW,EACP,yEAAyE;QACzE,gCAAgC;IACpC,QAAQ,EAAE;QACN,cAAc,EAAE,CAAC,IAAa,EAAE,EAAE,CAC9B,mEAAmE,IAAI,GAAG;QAC9E,cAAc,EAAE,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IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAClC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACzB,QAAQ,CAAC,IAAI,CACT,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,CAC5D,CAAC;YACN,CAAC;QACL,CAAC;QAED,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YACxB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBAChC,MAAM,IAAI,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;gBAC/B,QAAQ,CAAC,IAAI,CACT,IAAI,CAAC,IAAI,CACL,YAAY,EACZ,EAAE,EACF,SAAS,EACT,sBAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC9B,GAAG,CAAC,IAAI,EACR,IAAI,CACP,CACJ,CAAC;YACN,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AAhND,kEAgNC;AAED,SAAS,cAAc,CAAC,CAAS;IAC7B,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IAC7B,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,YAAY,CAAC,GAAa;IAC/B,OAAO,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Rule, RuleCheckResult } from "../../../../types/rule/rule";
|
|
2
|
+
import type { Context } from "../../../../context/context";
|
|
3
|
+
export declare class AttributeSectionSemanticRule extends Rule {
|
|
4
|
+
constructor();
|
|
5
|
+
test(_code: string, _ast?: unknown, parentCtx?: Context): Promise<RuleCheckResult[]>;
|
|
6
|
+
private checkCompleteness;
|
|
7
|
+
private checkDescriptionAlignment;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=attribute-section-semantic-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribute-section-semantic-rule.d.ts","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-semantic/attribute-section-semantic-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAiB,MAAM,6BAA6B,CAAC;AACnF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAqB3D,qBAAa,4BAA6B,SAAQ,IAAI;;IAKrC,IAAI,CACb,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,OAAO,EACd,SAAS,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,eAAe,EAAE,CAAC;IA0C7B,OAAO,CAAC,iBAAiB;IAgCzB,OAAO,CAAC,yBAAyB;CAgCpC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AttributeSectionSemanticRule = void 0;
|
|
4
|
+
const rule_1 = require("../../../../types/rule/rule");
|
|
5
|
+
const context_keys_1 = require("../../context-keys");
|
|
6
|
+
const META = {
|
|
7
|
+
name: "attribute-section-semantic",
|
|
8
|
+
description: "Attributes in the Markdown document must align with the provider schema " +
|
|
9
|
+
"(completeness and consistency)",
|
|
10
|
+
messages: {
|
|
11
|
+
missingInDoc: (name) => `Attribute "${name}" is defined in schema but missing from the document.`,
|
|
12
|
+
extraInDoc: (name, line) => `Attribute "${name}" (line ${line}) is documented but not found in the schema.`,
|
|
13
|
+
descriptionMismatch: (name, expected, actual, line) => `Attribute "${name}" (line ${line}): description should be "${expected}" ` +
|
|
14
|
+
`but found "${actual}".`,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
class AttributeSectionSemanticRule extends rule_1.Rule {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(META, "markdown");
|
|
20
|
+
}
|
|
21
|
+
async test(_code, _ast, parentCtx) {
|
|
22
|
+
if (!parentCtx) {
|
|
23
|
+
return [rule_1.RuleCheckResult.pass("Context unavailable, rule skipped")];
|
|
24
|
+
}
|
|
25
|
+
const view = parentCtx.get(context_keys_1.CTX_SCHEMA_SEMANTIC_VIEW);
|
|
26
|
+
const docView = parentCtx.get(context_keys_1.CTX_DOC_SEMANTIC_VIEW);
|
|
27
|
+
if (!view || !docView) {
|
|
28
|
+
return [rule_1.RuleCheckResult.pass("Schema view or doc semantic view unavailable, rule skipped")];
|
|
29
|
+
}
|
|
30
|
+
if (view.attributes.size === 0) {
|
|
31
|
+
return [rule_1.RuleCheckResult.pass("No schema attributes, attribute semantic check skipped")];
|
|
32
|
+
}
|
|
33
|
+
const docAttrs = docView.attributeLists.flatMap((list) => list.attributes);
|
|
34
|
+
if (docAttrs.length === 0) {
|
|
35
|
+
return [rule_1.RuleCheckResult.pass("No doc attributes found, existence checked by SectionExistenceRule")];
|
|
36
|
+
}
|
|
37
|
+
const failures = [];
|
|
38
|
+
this.checkCompleteness(docAttrs, view, failures);
|
|
39
|
+
this.checkDescriptionAlignment(docAttrs, view, failures);
|
|
40
|
+
if (failures.length === 0) {
|
|
41
|
+
return [rule_1.RuleCheckResult.pass("Attribute section semantic checks passed")];
|
|
42
|
+
}
|
|
43
|
+
return [
|
|
44
|
+
new rule_1.RuleCheckResult(false, `Attribute section has ${failures.length} semantic issue(s)`, "", "", failures),
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
checkCompleteness(docAttrs, view, failures) {
|
|
48
|
+
const docAttrNames = new Set(docAttrs.map((a) => a.name));
|
|
49
|
+
for (const [name] of view.attributes) {
|
|
50
|
+
if (!docAttrNames.has(name)) {
|
|
51
|
+
failures.push(this.fail("missingInDoc", "", undefined, undefined, name));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
for (const attr of docAttrs) {
|
|
55
|
+
if (!view.attributes.has(attr.name)) {
|
|
56
|
+
const line = getStartLine(attr);
|
|
57
|
+
failures.push(this.fail("extraInDoc", "", undefined, rule_1.RuleCheckResult.fromLine(line), attr.name, line));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
checkDescriptionAlignment(docAttrs, view, failures) {
|
|
62
|
+
for (const attr of docAttrs) {
|
|
63
|
+
const field = view.attributes.get(attr.name);
|
|
64
|
+
if (!field || !field.description)
|
|
65
|
+
continue;
|
|
66
|
+
const expected = field.description.trim();
|
|
67
|
+
const actual = attr.description.trim();
|
|
68
|
+
if (expected && actual !== expected) {
|
|
69
|
+
const previewLen = Math.min(expected.length + 20, 80);
|
|
70
|
+
const actualPreview = actual.length > previewLen
|
|
71
|
+
? actual.slice(0, previewLen) + "..."
|
|
72
|
+
: actual;
|
|
73
|
+
const line = getStartLine(attr);
|
|
74
|
+
failures.push(this.fail("descriptionMismatch", "", undefined, rule_1.RuleCheckResult.fromLine(line), attr.name, expected, actualPreview, line));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.AttributeSectionSemanticRule = AttributeSectionSemanticRule;
|
|
80
|
+
function getStartLine(attr) {
|
|
81
|
+
return attr.sourceRange?.start.line;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=attribute-section-semantic-rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribute-section-semantic-rule.js","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-semantic/attribute-section-semantic-rule.ts"],"names":[],"mappings":";;;AAAA,sDAAmF;AAInF,qDAAqF;AAErF,MAAM,IAAI,GAAa;IACnB,IAAI,EAAE,4BAA4B;IAClC,WAAW,EACP,0EAA0E;QAC1E,gCAAgC;IACpC,QAAQ,EAAE;QACN,YAAY,EAAE,CAAC,IA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AAC,IAAe;IACjC,OAAO,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Rule, RuleCheckResult } from "../../../../../types/rule/rule";
|
|
2
|
+
import type { Context } from "../../../../../context/context";
|
|
3
|
+
export declare class AttributeSectionSemanticRule extends Rule {
|
|
4
|
+
constructor();
|
|
5
|
+
test(_code: string, _ast?: unknown, parentCtx?: Context): Promise<RuleCheckResult[]>;
|
|
6
|
+
private checkCompleteness;
|
|
7
|
+
private checkDescriptionAlignment;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=attribute-section-semantic-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribute-section-semantic-rule.d.ts","sourceRoot":"","sources":["../../../../../../../src/workflow/implement/resource-check/rules/markdown-semantic/attributes/attribute-section-semantic-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AACtF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAqB9D,qBAAa,4BAA6B,SAAQ,IAAI;;IAKrC,IAAI,CACb,KAAK,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,OAAO,EACd,SAAS,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,eAAe,EAAE,CAAC;IA0C7B,OAAO,CAAC,iBAAiB;IAgCzB,OAAO,CAAC,yBAAyB;CAgCpC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AttributeSectionSemanticRule = void 0;
|
|
4
|
+
const rule_1 = require("../../../../../types/rule/rule");
|
|
5
|
+
const context_keys_1 = require("../../../context-keys");
|
|
6
|
+
const META = {
|
|
7
|
+
name: "attribute-section-semantic",
|
|
8
|
+
description: "Attributes in the Markdown document must align with the provider schema " +
|
|
9
|
+
"(completeness and consistency)",
|
|
10
|
+
messages: {
|
|
11
|
+
missingInDoc: (name) => `Attribute "${name}" is defined in schema but missing from the document.`,
|
|
12
|
+
extraInDoc: (name, line) => `Attribute "${name}" (line ${line}) is documented but not found in the schema.`,
|
|
13
|
+
descriptionMismatch: (name, expected, actual, line) => `Attribute "${name}" (line ${line}): description should be "${expected}" ` +
|
|
14
|
+
`but found "${actual}".`,
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
class AttributeSectionSemanticRule extends rule_1.Rule {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(META, "markdown");
|
|
20
|
+
}
|
|
21
|
+
async test(_code, _ast, parentCtx) {
|
|
22
|
+
if (!parentCtx) {
|
|
23
|
+
return [rule_1.RuleCheckResult.pass("Context unavailable, rule skipped")];
|
|
24
|
+
}
|
|
25
|
+
const view = parentCtx.get(context_keys_1.CTX_SCHEMA_SEMANTIC_VIEW);
|
|
26
|
+
const docView = parentCtx.get(context_keys_1.CTX_DOC_SEMANTIC_VIEW);
|
|
27
|
+
if (!view || !docView) {
|
|
28
|
+
return [rule_1.RuleCheckResult.pass("Schema view or doc semantic view unavailable, rule skipped")];
|
|
29
|
+
}
|
|
30
|
+
if (view.attributes.size === 0) {
|
|
31
|
+
return [rule_1.RuleCheckResult.pass("No schema attributes, attribute semantic check skipped")];
|
|
32
|
+
}
|
|
33
|
+
const docAttrs = docView.attributeLists.flatMap((list) => list.attributes);
|
|
34
|
+
if (docAttrs.length === 0) {
|
|
35
|
+
return [rule_1.RuleCheckResult.pass("No doc attributes found, existence checked by SectionExistenceRule")];
|
|
36
|
+
}
|
|
37
|
+
const failures = [];
|
|
38
|
+
this.checkCompleteness(docAttrs, view, failures);
|
|
39
|
+
this.checkDescriptionAlignment(docAttrs, view, failures);
|
|
40
|
+
if (failures.length === 0) {
|
|
41
|
+
return [rule_1.RuleCheckResult.pass("Attribute section semantic checks passed")];
|
|
42
|
+
}
|
|
43
|
+
return [
|
|
44
|
+
new rule_1.RuleCheckResult(false, `Attribute section has ${failures.length} semantic issue(s)`, "", "", failures),
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
checkCompleteness(docAttrs, view, failures) {
|
|
48
|
+
const docAttrNames = new Set(docAttrs.map((a) => a.name));
|
|
49
|
+
for (const [name] of view.attributes) {
|
|
50
|
+
if (!docAttrNames.has(name)) {
|
|
51
|
+
failures.push(this.fail("missingInDoc", "", undefined, undefined, name));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
for (const attr of docAttrs) {
|
|
55
|
+
if (!view.attributes.has(attr.name)) {
|
|
56
|
+
const line = getStartLine(attr);
|
|
57
|
+
failures.push(this.fail("extraInDoc", "", undefined, rule_1.RuleCheckResult.fromLine(line), attr.name, line));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
checkDescriptionAlignment(docAttrs, view, failures) {
|
|
62
|
+
for (const attr of docAttrs) {
|
|
63
|
+
const field = view.attributes.get(attr.name);
|
|
64
|
+
if (!field || !field.description)
|
|
65
|
+
continue;
|
|
66
|
+
const expected = field.description.trim();
|
|
67
|
+
const actual = attr.description.trim();
|
|
68
|
+
if (expected && actual !== expected) {
|
|
69
|
+
const previewLen = Math.min(expected.length + 20, 80);
|
|
70
|
+
const actualPreview = actual.length > previewLen
|
|
71
|
+
? actual.slice(0, previewLen) + "..."
|
|
72
|
+
: actual;
|
|
73
|
+
const line = getStartLine(attr);
|
|
74
|
+
failures.push(this.fail("descriptionMismatch", "", undefined, rule_1.RuleCheckResult.fromLine(line), attr.name, expected, actualPreview, line));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.AttributeSectionSemanticRule = AttributeSectionSemanticRule;
|
|
80
|
+
function getStartLine(attr) {
|
|
81
|
+
return attr.sourceRange?.start.line;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=attribute-section-semantic-rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribute-section-semantic-rule.js","sourceRoot":"","sources":["../../../../../../../src/workflow/implement/resource-check/rules/markdown-semantic/attributes/attribute-section-semantic-rule.ts"],"names":[],"mappings":";;;AAAA,yDAAsF;AAItF,wDAAwF;AAExF,MAAM,IAAI,GAAa;IACnB,IAAI,EAAE,4BAA4B;IAClC,WAAW,EACP,0EAA0E;QAC1E,gCAAgC;IACpC,QAAQ,EAAE;QACN,YAAY,EAAE,CAAC,IAAa,EAAE,EAAE,CAC5B,cAAc,IAAI,uDAAuD;QAC7E,UAAU,EAAE,CAAC,IAAa,EAAE,IAAa,EAAE,EAAE,CACzC,cAAc,IAAI,WAAW,IAAI,8CAA8C;QACnF,mBAAmB,EAAE,CAAC,IAAa,EAAE,QAAiB,EAAE,MAAe,EAAE,IAAa,EAAE,EAAE,CACtF,cAAc,IAAI,WAAW,IAAI,6BAA6B,QAAQ,IAAI;YAC1E,cAAc,MAAM,IAAI;KAC/B;CACJ,CAAC;AAEF,MAAa,4BAA6B,SAAQ,WAAI;IAClD;QACI,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,IAAI,CACb,KAAa,EACb,IAAc,EACd,SAAmB;QAEnB,IAAI,CAAC,SAAS,EAAE,CAAC;YACb,OAAO,CAAC,sBAAe,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC,CAAC;QACvE,CAAC;QAED,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAqB,uCAAwB,CAAC,CAAC;QACzE,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAkB,oCAAqB,CAAC,CAAC;QACtE,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,CAAC,sBAAe,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC,CAAC;QAChG,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,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,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;gBAChC,QAAQ,CAAC,IAAI,CACT,IAAI,CAAC,IAAI,CACL,qBAAqB,EACrB,EAAE,EACF,SAAS,EACT,sBAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,EAC9B,IAAI,CAAC,IAAI,EACT,QAAQ,EACR,aAAa,EACb,IAAI,CACP,CACJ,CAAC;YACN,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AAnHD,oEAmHC;AAED,SAAS,YAAY,CAAC,IAAe;IACjC,OAAO,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,IAAI,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Rule } from "../../../../types/rule/rule";
|
|
2
|
+
import { SectionExistenceRule } from "./total/section-existence-rule";
|
|
3
|
+
import { ArgumentSectionSemanticRule } from "./arguments/argument-section-semantic-rule";
|
|
4
|
+
import { AttributeSectionSemanticRule } from "./attributes/attribute-section-semantic-rule";
|
|
5
|
+
export { SectionExistenceRule, ArgumentSectionSemanticRule, AttributeSectionSemanticRule, };
|
|
6
|
+
export declare const MARKDOWN_SEMANTIC_RULES: Rule[];
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-semantic/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,8CAA8C,CAAC;AAE5F,OAAO,EACH,oBAAoB,EACpB,2BAA2B,EAC3B,4BAA4B,GAC/B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,IAAI,EAIzC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MARKDOWN_SEMANTIC_RULES = exports.AttributeSectionSemanticRule = exports.ArgumentSectionSemanticRule = exports.SectionExistenceRule = void 0;
|
|
4
|
+
const section_existence_rule_1 = require("./total/section-existence-rule");
|
|
5
|
+
Object.defineProperty(exports, "SectionExistenceRule", { enumerable: true, get: function () { return section_existence_rule_1.SectionExistenceRule; } });
|
|
6
|
+
const argument_section_semantic_rule_1 = require("./arguments/argument-section-semantic-rule");
|
|
7
|
+
Object.defineProperty(exports, "ArgumentSectionSemanticRule", { enumerable: true, get: function () { return argument_section_semantic_rule_1.ArgumentSectionSemanticRule; } });
|
|
8
|
+
const attribute_section_semantic_rule_1 = require("./attributes/attribute-section-semantic-rule");
|
|
9
|
+
Object.defineProperty(exports, "AttributeSectionSemanticRule", { enumerable: true, get: function () { return attribute_section_semantic_rule_1.AttributeSectionSemanticRule; } });
|
|
10
|
+
exports.MARKDOWN_SEMANTIC_RULES = [
|
|
11
|
+
new section_existence_rule_1.SectionExistenceRule(),
|
|
12
|
+
new argument_section_semantic_rule_1.ArgumentSectionSemanticRule(),
|
|
13
|
+
new attribute_section_semantic_rule_1.AttributeSectionSemanticRule(),
|
|
14
|
+
];
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/workflow/implement/resource-check/rules/markdown-semantic/index.ts"],"names":[],"mappings":";;;AACA,2EAAsE;AAKlE,qGALK,6CAAoB,OAKL;AAJxB,+FAAyF;AAKrF,4GALK,4DAA2B,OAKL;AAJ/B,kGAA4F;AAKxF,6GALK,8DAA4B,OAKL;AAGnB,QAAA,uBAAuB,GAAW;IAC3C,IAAI,6CAAoB,EAAE;IAC1B,IAAI,4DAA2B,EAAE;IACjC,IAAI,8DAA4B,EAAE;CACrC,CAAC"}
|
package/dist/workflow/implement/resource-check/rules/markdown-semantic/section-existence-rule.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Rule, RuleCheckResult } from "../../../../types/rule/rule";
|
|
2
|
+
import type { Context } from "../../../../context/context";
|
|
3
|
+
export declare class SectionExistenceRule extends Rule {
|
|
4
|
+
private readonly parser;
|
|
5
|
+
constructor();
|
|
6
|
+
test(_code: string, ast?: unknown, parentCtx?: Context): Promise<RuleCheckResult[]>;
|
|
7
|
+
private checkIntroLine;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=section-existence-rule.d.ts.map
|