@blockml/validator 0.9.4 → 0.9.6

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.
Files changed (32) hide show
  1. package/blocks/org/blockml/bml/compiler/validator/Library.bml +26 -27
  2. package/blocks/org/blockml/bml/compiler/validator/README.bml +15 -22
  3. package/blocks/org/blockml/bml/compiler/validator/ValidatorType.bml +16 -20
  4. package/blocks/org/blockml/bml/compiler/validator/capability/Validate.bml +23 -23
  5. package/blocks/org/blockml/bml/compiler/validator/capability/ValidateStyle.bml +20 -22
  6. package/blocks/org/blockml/bml/compiler/validator/documentation/DesignDecisions.bml +21 -26
  7. package/blocks/org/blockml/bml/compiler/validator/documentation/Diagnostics.bml +21 -25
  8. package/blocks/org/blockml/bml/compiler/validator/documentation/Introduction.bml +20 -26
  9. package/blocks/org/blockml/bml/compiler/validator/documentation/LayerSeparation.bml +18 -23
  10. package/blocks/org/blockml/bml/compiler/validator/documentation/PackageOwnership.bml +20 -26
  11. package/blocks/org/blockml/bml/compiler/validator/documentation/PublicApi.bml +18 -23
  12. package/blocks/org/blockml/bml/compiler/validator/documentation/ScopeExclusions.bml +16 -21
  13. package/blocks/org/blockml/bml/compiler/validator/documentation/ValidationPipeline.bml +17 -22
  14. package/blocks/org/blockml/bml/compiler/validator/documentation/ValidityContract.bml +19 -24
  15. package/blocks/org/blockml/bml/compiler/validator/style/PreferCDataWhenNeedsEscape.bml +14 -18
  16. package/blocks/org/blockml/bml/compiler/validator/style/PreferEmptyElementSelfClosing.bml +14 -18
  17. package/blocks/org/blockml/bml/compiler/validator/style/PreferMarkdownStructure.bml +14 -18
  18. package/blocks/org/blockml/bml/compiler/validator/style/PreferOmitRedundantName.bml +15 -0
  19. package/blocks/org/blockml/bml/compiler/validator/style/PreferOmitRedundantType.bml +15 -0
  20. package/blocks/org/blockml/bml/compiler/validator/style/PreferTypeAsTag.bml +15 -0
  21. package/blocks/org/blockml/bml/compiler/validator/style/StyleCheck.bml +17 -20
  22. package/blocks/org/blockml/bml/compiler/validator/style/StyleRule.bml +29 -25
  23. package/blocks/org/blockml/bml/compiler/validator/style/rule/CDataWhenEscaping.bml +15 -21
  24. package/blocks/org/blockml/bml/compiler/validator/style/rule/EmptyElementSelfClosing.bml +15 -21
  25. package/blocks/org/blockml/bml/compiler/validator/style/rule/MarkdownStructure.bml +15 -21
  26. package/blocks/org/blockml/bml/compiler/validator/style/rule/OmitRedundantName.bml +39 -0
  27. package/blocks/org/blockml/bml/compiler/validator/style/rule/OmitRedundantType.bml +39 -0
  28. package/blocks/org/blockml/bml/compiler/validator/style/rule/TypeAsTag.bml +38 -0
  29. package/dist/validate-style.d.ts.map +1 -1
  30. package/dist/validate-style.js +49 -10
  31. package/dist/validate-style.js.map +1 -1
  32. package/package.json +4 -4
@@ -1,12 +1,6 @@
1
- <!--
2
- Validator Documentation — PackageOwnership
3
- FQN: org.blockml.bml.compiler.validator.documentation.PackageOwnership
4
- -->
5
- <block
6
- xmlns="http://blockml.org/bml"
7
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8
- xsi:schemaLocation="http://blockml.org/bml https://blockml.org/schemas/bml.xsd
9
- "
1
+ <!--Validator Documentation — PackageOwnership
2
+ FQN: org.blockml.bml.compiler.validator.documentation.PackageOwnership-->
3
+ <valdocumentation:PackageOwnership xmlns="http://blockml.org/bml"
10
4
  xmlns:blockml="org.blockml.bml"
11
5
  xmlns:bom="org.blockml.bml.bom"
12
6
  xmlns:bomapi="org.blockml.bml.bom.api"
@@ -22,30 +16,30 @@
22
16
  xmlns:valcap="org.blockml.bml.compiler.validator.capability"
23
17
  xmlns:valdocumentation="org.blockml.bml.compiler.validator.documentation"
24
18
  xmlns:doc="org.blockml.bml.documentation"
25
- xmlns:bomdocumentation="org.blockml.bml.bom.documentation"
26
- >
27
-
28
- <name>PackageOwnership</name>
29
- <type>valdocumentation:PackageOwnership</type>
30
- <baseType>core:Documentation</baseType>
31
- <is>Toolchain package responsibilities for validation</is>
32
-
33
- <documentation>@blockml/validator — validate() orchestration, style catalog, ValidateResult assembly.
19
+ xmlns:bomdocumentation="org.blockml.bml.bom.documentation">
20
+
21
+ <baseType>
22
+ core:Documentation
23
+ </baseType>
24
+ <is>
25
+ Toolchain package responsibilities for validation
26
+ </is>
27
+ <documentation>
28
+ @blockml/validator — validate() orchestration, style catalog, ValidateResult assembly.
34
29
  Owns this BML library including org.blockml.bml.compiler.validator.style.*.
35
-
30
+
36
31
  @blockml/bom — Urmodell types, ValidateOptions/ValidateResult (B26), Diagnostic.
37
32
  Validator consumes; does not redefine.
38
-
33
+
39
34
  @blockml/framework — TypeRegistry, forkBom, validateTypes, validateConstraints,
40
35
  bootstrapTypeRegistry. Validator delegates all semantic work here.
41
-
36
+
42
37
  @blockml/parser — BML → BomDocument; used indirectly via framework bootstrap.
43
-
44
- @blockml/cli — validate command host; may inject TypeRegistry or bootstrap paths.</documentation>
45
-
38
+
39
+ @blockml/cli — validate command host; may inject TypeRegistry or bootstrap paths.
40
+ </documentation>
46
41
  <references>
47
42
  <see type="valdocumentation:ScopeExclusions" relation="ReadNext" />
48
43
  <see type="bomdocumentation:PackageOwnership" relation="SeeAlso" />
49
44
  </references>
50
-
51
- </block>
45
+ </valdocumentation:PackageOwnership>
@@ -1,12 +1,6 @@
1
- <!--
2
- Validator Documentation — PublicApi
3
- FQN: org.blockml.bml.compiler.validator.documentation.PublicApi
4
- -->
5
- <block
6
- xmlns="http://blockml.org/bml"
7
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8
- xsi:schemaLocation="http://blockml.org/bml https://blockml.org/schemas/bml.xsd
9
- "
1
+ <!--Validator Documentation — PublicApi
2
+ FQN: org.blockml.bml.compiler.validator.documentation.PublicApi-->
3
+ <valdocumentation:PublicApi xmlns="http://blockml.org/bml"
10
4
  xmlns:blockml="org.blockml.bml"
11
5
  xmlns:bom="org.blockml.bml.bom"
12
6
  xmlns:bomapi="org.blockml.bml.bom.api"
@@ -23,30 +17,32 @@
23
17
  xmlns:valdocumentation="org.blockml.bml.compiler.validator.documentation"
24
18
  xmlns:doc="org.blockml.bml.documentation">
25
19
 
26
- <name>PublicApi</name>
27
- <type>valdocumentation:PublicApi</type>
28
- <baseType>core:Documentation</baseType>
29
- <is>validate() entry point (B26)</is>
30
-
31
- <documentation> validate(document: BomDocument, options?: ValidateOptions): ValidateResult
20
+ <baseType>
21
+ core:Documentation
22
+ </baseType>
23
+ <is>
24
+ validate() entry point (B26)
25
+ </is>
26
+ <documentation>
27
+ validate(document: BomDocument, options?: ValidateOptions): ValidateResult
32
28
  validateStyle(document: BomDocument): Diagnostic[]
33
-
29
+
34
30
  ValidateOptions (owned by @blockml/bom):
35
31
  • typeRegistry — pre-built TypeRegistryReader / TypeRegistry instance (optional)
36
32
  • bootstrapPaths — corpus roots when bootstrapping (optional)
37
33
  • continueOnError — default true; when false, omit pragmaticModel on failure
38
-
34
+
39
35
  ValidateResult (owned by @blockml/bom):
40
36
  • pragmaticModel — forked BomDocument when validation completes or continueOnError
41
37
  • diagnostics — Diagnostic[]
42
38
  • success — false if any error-severity diagnostic
43
-
39
+
44
40
  Style: validateStyle runs after semantic checks. Catalog SSOT lives under
45
41
  org.blockml.bml.compiler.validator.style.*. Warnings and recommendations do not
46
42
  fail success.
47
-
48
- Sync only; does not throw on validation errors. Host decides abort policy.</documentation>
49
-
43
+
44
+ Sync only; does not throw on validation errors. Host decides abort policy.
45
+ </documentation>
50
46
  <references>
51
47
  <see type="bomapi:ValidateOptions" relation="Defines" />
52
48
  <see type="bomapi:ValidateResult" relation="Defines" />
@@ -54,5 +50,4 @@
54
50
  <see type="valcap:ValidateStyle" relation="Defines" />
55
51
  <see type="valdocumentation:DesignDecisions" relation="ReadNext" />
56
52
  </references>
57
-
58
- </block>
53
+ </valdocumentation:PublicApi>
@@ -1,12 +1,6 @@
1
- <!--
2
- Validator Documentation — ScopeExclusions
3
- FQN: org.blockml.bml.compiler.validator.documentation.ScopeExclusions
4
- -->
5
- <block
6
- xmlns="http://blockml.org/bml"
7
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8
- xsi:schemaLocation="http://blockml.org/bml https://blockml.org/schemas/bml.xsd
9
- "
1
+ <!--Validator Documentation — ScopeExclusions
2
+ FQN: org.blockml.bml.compiler.validator.documentation.ScopeExclusions-->
3
+ <valdocumentation:ScopeExclusions xmlns="http://blockml.org/bml"
10
4
  xmlns:blockml="org.blockml.bml"
11
5
  xmlns:bom="org.blockml.bml.bom"
12
6
  xmlns:bomapi="org.blockml.bml.bom.api"
@@ -23,13 +17,15 @@
23
17
  xmlns:valdocumentation="org.blockml.bml.compiler.validator.documentation"
24
18
  xmlns:doc="org.blockml.bml.documentation">
25
19
 
26
- <name>ScopeExclusions</name>
27
- <type>valdocumentation:ScopeExclusions</type>
28
- <baseType>core:Documentation</baseType>
29
- <is>Explicit out-of-scope for the validator package</is>
30
-
31
- <documentation>Out of scope for @blockml/validator:
32
-
20
+ <baseType>
21
+ core:Documentation
22
+ </baseType>
23
+ <is>
24
+ Explicit out-of-scope for the validator package
25
+ </is>
26
+ <documentation>
27
+ Out of scope for @blockml/validator:
28
+
33
29
  • TypeRegistry implementation — @blockml/framework
34
30
  • Individual semantic validation rules — @blockml/framework (validateTypes, validateEmbeddedBlocks,
35
31
  validateInstances, validatePresets, validateVisibility, validateReadOnly, validateConstraints)
@@ -40,12 +36,11 @@
40
36
  • Render target emit / compile — @blockml/compiler
41
37
  • CLI file I/O — @blockml/cli
42
38
  • Language BML corpus — @blockml/core (npm)
43
-
39
+
44
40
  In scope: validate() orchestration on BomDocument with framework utilities and the
45
- style catalog.</documentation>
46
-
41
+ style catalog.
42
+ </documentation>
47
43
  <references>
48
44
  <see type="valdocumentation:Introduction" relation="SeeAlso" />
49
45
  </references>
50
-
51
- </block>
46
+ </valdocumentation:ScopeExclusions>
@@ -1,12 +1,6 @@
1
- <!--
2
- Validator Documentation — ValidationPipeline
3
- FQN: org.blockml.bml.compiler.validator.documentation.ValidationPipeline
4
- -->
5
- <block
6
- xmlns="http://blockml.org/bml"
7
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8
- xsi:schemaLocation="http://blockml.org/bml https://blockml.org/schemas/bml.xsd
9
- "
1
+ <!--Validator Documentation — ValidationPipeline
2
+ FQN: org.blockml.bml.compiler.validator.documentation.ValidationPipeline-->
3
+ <valdocumentation:ValidationPipeline xmlns="http://blockml.org/bml"
10
4
  xmlns:blockml="org.blockml.bml"
11
5
  xmlns:bom="org.blockml.bml.bom"
12
6
  xmlns:bomapi="org.blockml.bml.bom.api"
@@ -23,13 +17,15 @@
23
17
  xmlns:valdocumentation="org.blockml.bml.compiler.validator.documentation"
24
18
  xmlns:doc="org.blockml.bml.documentation">
25
19
 
26
- <name>ValidationPipeline</name>
27
- <type>valdocumentation:ValidationPipeline</type>
28
- <baseType>core:Documentation</baseType>
29
- <is>validate() orchestration steps</is>
30
-
31
- <documentation>validate(document, options?) pipeline (packages/validator/src/validate.ts):
32
-
20
+ <baseType>
21
+ core:Documentation
22
+ </baseType>
23
+ <is>
24
+ validate() orchestration steps
25
+ </is>
26
+ <documentation>
27
+ validate(document, options?) pipeline (packages/validator/src/validate.ts):
28
+
33
29
  1. Resolve TypeRegistry — options.typeRegistry if instanceof TypeRegistry,
34
30
  else bootstrapTypeRegistry({ paths, libraryPaths, rootDir })
35
31
  2. forkBom(document) → pragmaticModel (structuredClone working copy)
@@ -45,17 +41,16 @@
45
41
  12. validateStyle(pragmaticModel) → append warning/recommendation diagnostics
46
42
  13. success = no diagnostic with severity === "error"
47
43
  14. Return ValidateResult { pragmaticModel?, diagnostics, success }
48
-
44
+
49
45
  When continueOnError === false and success === false, pragmaticModel is omitted
50
46
  from the result (early return with diagnostics only).
51
-
47
+
52
48
  Out of scope in this pipeline: SCAD/MachineBlocks Stage-3 render validation;
53
- MemberGroups axis constraints (MB-only).</documentation>
54
-
49
+ MemberGroups axis constraints (MB-only).
50
+ </documentation>
55
51
  <references>
56
52
  <see type="valdocumentation:PublicApi" relation="ReadNext" />
57
53
  <see type="valcap:Validate" relation="Defines" />
58
54
  <see type="valcap:ValidateStyle" relation="SeeAlso" />
59
55
  </references>
60
-
61
- </block>
56
+ </valdocumentation:ValidationPipeline>
@@ -1,12 +1,6 @@
1
- <!--
2
- Validator Documentation — ValidityContract
3
- FQN: org.blockml.bml.compiler.validator.documentation.ValidityContract
4
- -->
5
- <block
6
- xmlns="http://blockml.org/bml"
7
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8
- xsi:schemaLocation="http://blockml.org/bml https://blockml.org/schemas/bml.xsd
9
- "
1
+ <!--Validator Documentation — ValidityContract
2
+ FQN: org.blockml.bml.compiler.validator.documentation.ValidityContract-->
3
+ <valdocumentation:ValidityContract xmlns="http://blockml.org/bml"
10
4
  xmlns:blockml="org.blockml.bml"
11
5
  xmlns:bom="org.blockml.bml.bom"
12
6
  xmlns:bomapi="org.blockml.bml.bom.api"
@@ -24,33 +18,34 @@
24
18
  xmlns:pardocumentation="org.blockml.bml.compiler.parser.documentation"
25
19
  xmlns:doc="org.blockml.bml.documentation">
26
20
 
27
- <name>ValidityContract</name>
28
- <type>valdocumentation:ValidityContract</type>
29
- <baseType>core:Documentation</baseType>
30
- <is>What counts as valid BlockML without XSD</is>
31
-
32
- <documentation>valid BlockML = well-formed XML + valid BML structure + valid BML semantics.
33
-
21
+ <baseType>
22
+ core:Documentation
23
+ </baseType>
24
+ <is>
25
+ What counts as valid BlockML without XSD
26
+ </is>
27
+ <documentation>
28
+ valid BlockML = well-formed XML + valid BML structure + valid BML semantics.
29
+
34
30
  CLI blockml validate and LSP analyzeDocument consume the same parse + validate engine.
35
31
  Generated XSD is a non-authoritative render-target projection and is not consulted.
36
-
32
+
37
33
  Severity: error = not valid BlockML; warning = valid but problematic (deprecation
38
34
  or mechanical style); recommendation = quality improvement; info = hint.
39
35
  Unknown element, attribute, member, type, block, or missing library is error.
40
-
36
+
41
37
  Semantic checks (this package / framework): every type FQN must resolve in the
42
38
  TypeRegistry or be a well-known primitive; instance typeFqn and memberValues keys
43
39
  must match effective members. Unresolved references are errors. A missing library
44
40
  is BML_LIBRARY_RESOLVE_ERROR — analogous to a Java class without its Maven artifact.
45
-
41
+
46
42
  Structural/semantic errors are node-local: they set success=false but keep the BOM
47
43
  (preserve-on-error). XML syntax errors may yield document null.
48
-
49
- Unknown instance members stay in memberValues plus BML_UNKNOWN_PROPERTY error.</documentation>
50
-
44
+
45
+ Unknown instance members stay in memberValues plus BML_UNKNOWN_PROPERTY error.
46
+ </documentation>
51
47
  <references>
52
48
  <see type="pardocumentation:StructuralGrammar" relation="SeeAlso" />
53
49
  <see type="valdocumentation:ValidationPipeline" relation="ReadNext" />
54
50
  </references>
55
-
56
- </block>
51
+ </valdocumentation:ValidityContract>
@@ -1,12 +1,6 @@
1
- <!--
2
- Validator Style Check — PreferCDataWhenNeedsEscape
3
- FQN: org.blockml.bml.compiler.validator.style.PreferCDataWhenNeedsEscape
4
- -->
5
- <block
6
- xmlns="http://blockml.org/bml"
7
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8
- xsi:schemaLocation="http://blockml.org/bml https://blockml.org/schemas/bml.xsd
9
- "
1
+ <!--Validator Style Check — PreferCDataWhenNeedsEscape
2
+ FQN: org.blockml.bml.compiler.validator.style.PreferCDataWhenNeedsEscape-->
3
+ <valstyle:PreferCDataWhenNeedsEscape xmlns="http://blockml.org/bml"
10
4
  xmlns:blockml="org.blockml.bml"
11
5
  xmlns:core="org.blockml.bml.core"
12
6
  xmlns:def="org.blockml.bml.definition"
@@ -14,14 +8,16 @@
14
8
  xmlns:validator="org.blockml.bml.compiler.validator"
15
9
  xmlns:valstyle="org.blockml.bml.compiler.validator.style">
16
10
 
17
- <name>PreferCDataWhenNeedsEscape</name>
18
- <type>valstyle:PreferCDataWhenNeedsEscape</type>
19
- <baseType>valstyle:StyleCheck</baseType>
20
- <is>Recommend CDATA when documentation text contains and or less-than</is>
21
-
22
- <documentation><![CDATA[
11
+ <baseType>
12
+ valstyle:StyleCheck
13
+ </baseType>
14
+ <is>
15
+ Recommend CDATA when documentation text contains and or less-than
16
+ </is>
17
+ <documentation>
18
+ <![CDATA[
23
19
  Matches block-level documentation prose whose text contains & or <
24
20
  and authoredCharacterDataForm is not cdata.
25
- ]]></documentation>
26
-
27
- </block>
21
+ ]]>
22
+ </documentation>
23
+ </valstyle:PreferCDataWhenNeedsEscape>
@@ -1,12 +1,6 @@
1
- <!--
2
- Validator Style Check — PreferEmptyElementSelfClosing
3
- FQN: org.blockml.bml.compiler.validator.style.PreferEmptyElementSelfClosing
4
- -->
5
- <block
6
- xmlns="http://blockml.org/bml"
7
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8
- xsi:schemaLocation="http://blockml.org/bml https://blockml.org/schemas/bml.xsd
9
- "
1
+ <!--Validator Style Check — PreferEmptyElementSelfClosing
2
+ FQN: org.blockml.bml.compiler.validator.style.PreferEmptyElementSelfClosing-->
3
+ <valstyle:PreferEmptyElementSelfClosing xmlns="http://blockml.org/bml"
10
4
  xmlns:blockml="org.blockml.bml"
11
5
  xmlns:core="org.blockml.bml.core"
12
6
  xmlns:def="org.blockml.bml.definition"
@@ -14,12 +8,14 @@
14
8
  xmlns:validator="org.blockml.bml.compiler.validator"
15
9
  xmlns:valstyle="org.blockml.bml.compiler.validator.style">
16
10
 
17
- <name>PreferEmptyElementSelfClosing</name>
18
- <type>valstyle:PreferEmptyElementSelfClosing</type>
19
- <baseType>valstyle:StyleCheck</baseType>
20
- <is>Warn when an empty see reference is authored as a paired tag</is>
21
-
22
- <documentation>Matches DocumentationReference with empty context and authoredEmptyElementForm paired
23
- (see open-close with no body). Preferred form is self-closing.</documentation>
24
-
25
- </block>
11
+ <baseType>
12
+ valstyle:StyleCheck
13
+ </baseType>
14
+ <is>
15
+ Warn when an empty see reference is authored as a paired tag
16
+ </is>
17
+ <documentation>
18
+ Matches DocumentationReference with empty context and authoredEmptyElementForm paired
19
+ (see open-close with no body). Preferred form is self-closing.
20
+ </documentation>
21
+ </valstyle:PreferEmptyElementSelfClosing>
@@ -1,12 +1,6 @@
1
- <!--
2
- Validator Style Check — PreferMarkdownStructure
3
- FQN: org.blockml.bml.compiler.validator.style.PreferMarkdownStructure
4
- -->
5
- <block
6
- xmlns="http://blockml.org/bml"
7
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8
- xsi:schemaLocation="http://blockml.org/bml https://blockml.org/schemas/bml.xsd
9
- "
1
+ <!--Validator Style Check — PreferMarkdownStructure
2
+ FQN: org.blockml.bml.compiler.validator.style.PreferMarkdownStructure-->
3
+ <valstyle:PreferMarkdownStructure xmlns="http://blockml.org/bml"
10
4
  xmlns:blockml="org.blockml.bml"
11
5
  xmlns:core="org.blockml.bml.core"
12
6
  xmlns:def="org.blockml.bml.definition"
@@ -14,12 +8,14 @@
14
8
  xmlns:validator="org.blockml.bml.compiler.validator"
15
9
  xmlns:valstyle="org.blockml.bml.compiler.validator.style">
16
10
 
17
- <name>PreferMarkdownStructure</name>
18
- <type>valstyle:PreferMarkdownStructure</type>
19
- <baseType>valstyle:StyleCheck</baseType>
20
- <is>Recommend markdown structure for long block documentation</is>
21
-
22
- <documentation>Matches block-level documentation longer than 280 characters with no blank
23
- line, heading, or list marker. Short member documentation is out of scope.</documentation>
24
-
25
- </block>
11
+ <baseType>
12
+ valstyle:StyleCheck
13
+ </baseType>
14
+ <is>
15
+ Recommend markdown structure for long block documentation
16
+ </is>
17
+ <documentation>
18
+ Matches block-level documentation longer than 280 characters with no blank
19
+ line, heading, or list marker. Short member documentation is out of scope.
20
+ </documentation>
21
+ </valstyle:PreferMarkdownStructure>
@@ -0,0 +1,15 @@
1
+ <!--
2
+ Validator Style Check — PreferOmitRedundantName
3
+ FQN: org.blockml.bml.compiler.validator.style.PreferOmitRedundantName
4
+ -->
5
+ <style:PreferOmitRedundantName
6
+ xmlns="http://blockml.org/bml"
7
+ xmlns:style="org.blockml.bml.compiler.validator.style">
8
+
9
+ <is>Warn when a preferred-form Block still declares a name child</is>
10
+
11
+ <documentation>Matches any preferred-form definition (root, Sub-Block, or embed)
12
+ that still authors a child name element. The tag already supplies the
13
+ name (doc:DocumentFormat).</documentation>
14
+
15
+ </style:PreferOmitRedundantName>
@@ -0,0 +1,15 @@
1
+ <!--
2
+ Validator Style Check — PreferOmitRedundantType
3
+ FQN: org.blockml.bml.compiler.validator.style.PreferOmitRedundantType
4
+ -->
5
+ <style:PreferOmitRedundantType
6
+ xmlns="http://blockml.org/bml"
7
+ xmlns:style="org.blockml.bml.compiler.validator.style">
8
+
9
+ <is>Warn when a preferred-form Block still declares a type child</is>
10
+
11
+ <documentation>Matches any preferred-form definition (root, Sub-Block, or embed)
12
+ that still authors a child type element. The tag already supplies the
13
+ type, or the Sub-Block type is derived (doc:DocumentFormat).</documentation>
14
+
15
+ </style:PreferOmitRedundantType>
@@ -0,0 +1,15 @@
1
+ <!--
2
+ Validator Style Check — PreferTypeAsTag
3
+ FQN: org.blockml.bml.compiler.validator.style.PreferTypeAsTag
4
+ -->
5
+ <style:PreferTypeAsTag
6
+ xmlns="http://blockml.org/bml"
7
+ xmlns:style="org.blockml.bml.compiler.validator.style">
8
+
9
+ <is>Warn when a definition still uses the legacy block wrapper</is>
10
+
11
+ <documentation>Matches a BlockDefinition whose wrapperForm is block — the legacy
12
+ definition wrapper. Preferred form uses the type (root / embed) or name
13
+ (Sub-Block) as the element tag (doc:DocumentFormat).</documentation>
14
+
15
+ </style:PreferTypeAsTag>
@@ -1,12 +1,6 @@
1
- <!--
2
- Validator Style — StyleCheck
3
- FQN: org.blockml.bml.compiler.validator.style.StyleCheck
4
- -->
5
- <block
6
- xmlns="http://blockml.org/bml"
7
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8
- xsi:schemaLocation="http://blockml.org/bml https://blockml.org/schemas/bml.xsd
9
- "
1
+ <!--Validator Style — StyleCheck
2
+ FQN: org.blockml.bml.compiler.validator.style.StyleCheck-->
3
+ <valstyle:StyleCheck xmlns="http://blockml.org/bml"
10
4
  xmlns:blockml="org.blockml.bml"
11
5
  xmlns:core="org.blockml.bml.core"
12
6
  xmlns:def="org.blockml.bml.definition"
@@ -14,14 +8,17 @@
14
8
  xmlns:validator="org.blockml.bml.compiler.validator"
15
9
  xmlns:valstyle="org.blockml.bml.compiler.validator.style">
16
10
 
17
- <name>StyleCheck</name>
18
- <type>valstyle:StyleCheck</type>
19
- <baseType>validator:ValidatorType</baseType>
20
- <is>Abstract marker for a style-check interpreter kind</is>
21
-
22
- <documentation>Concrete check types bind to a TypeScript interpreter in validateStyle.
23
- Unknown check types emit BML_STYLE_UNKNOWN_CHECK (info) and are skipped.</documentation>
24
-
25
- <abstract>true</abstract>
26
-
27
- </block>
11
+ <baseType>
12
+ validator:ValidatorType
13
+ </baseType>
14
+ <is>
15
+ Abstract marker for a style-check interpreter kind
16
+ </is>
17
+ <documentation>
18
+ Concrete check types bind to a TypeScript interpreter in validateStyle.
19
+ Unknown check types emit BML_STYLE_UNKNOWN_CHECK (info) and are skipped.
20
+ </documentation>
21
+ <abstract>
22
+ true
23
+ </abstract>
24
+ </valstyle:StyleCheck>
@@ -1,12 +1,6 @@
1
- <!--
2
- Validator Style — StyleRule
3
- FQN: org.blockml.bml.compiler.validator.style.StyleRule
4
- -->
5
- <block
6
- xmlns="http://blockml.org/bml"
7
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8
- xsi:schemaLocation="http://blockml.org/bml https://blockml.org/schemas/bml.xsd
9
- "
1
+ <!--Validator Style — StyleRule
2
+ FQN: org.blockml.bml.compiler.validator.style.StyleRule-->
3
+ <valstyle:StyleRule xmlns="http://blockml.org/bml"
10
4
  xmlns:blockml="org.blockml.bml"
11
5
  xmlns:bom="org.blockml.bml.bom"
12
6
  xmlns:bomcommon="org.blockml.bml.bom.common"
@@ -17,37 +11,47 @@
17
11
  xmlns:valstyle="org.blockml.bml.compiler.validator.style"
18
12
  xmlns:valdocumentation="org.blockml.bml.compiler.validator.documentation">
19
13
 
20
- <name>StyleRule</name>
21
- <type>valstyle:StyleRule</type>
22
- <baseType>validator:ValidatorType</baseType>
23
- <is>Catalog entry for a BML authoring quality rule</is>
24
-
25
- <documentation>SSOT for one style check. Concrete rules extend this type. validateStyle loads
14
+ <baseType>
15
+ validator:ValidatorType
16
+ </baseType>
17
+ <is>
18
+ Catalog entry for a BML authoring quality rule
19
+ </is>
20
+ <documentation>
21
+ SSOT for one style check. Concrete rules extend this type. validateStyle loads
26
22
  rule documents from this package blocks/ and dispatches on check type FQN.
27
- Warnings and recommendations never set ValidateResult.success to false.</documentation>
28
-
23
+ Warnings and recommendations never set ValidateResult.success to false.
24
+ </documentation>
29
25
  <properties>
30
26
  <code type="type:Text">
31
- <documentation>Diagnostic code, e.g. BML_STYLE_PREFER_CDATA. (required)</documentation>
27
+ <documentation>
28
+ Diagnostic code, e.g. BML_STYLE_PREFER_CDATA. (required)
29
+ </documentation>
32
30
  </code>
33
31
  <severity type="bomcommon:DiagnosticSeverity">
34
- <documentation>warning or recommendation for v1 style rules. (required)</documentation>
32
+ <documentation>
33
+ warning or recommendation for v1 style rules. (required)
34
+ </documentation>
35
35
  </severity>
36
36
  <appliesTo type="type:Text">
37
- <documentation>Human-readable target, e.g. block documentation. (required)</documentation>
37
+ <documentation>
38
+ Human-readable target, e.g. block documentation. (required)
39
+ </documentation>
38
40
  </appliesTo>
39
41
  <message type="type:Text">
40
- <documentation>Diagnostic message emitted on match. (required)</documentation>
42
+ <documentation>
43
+ Diagnostic message emitted on match. (required)
44
+ </documentation>
41
45
  </message>
42
46
  </properties>
43
-
44
47
  <aggregations>
45
48
  <check>
46
- <documentation>StyleCheck subtype that selects the TypeScript interpreter. (required)</documentation>
49
+ <documentation>
50
+ StyleCheck subtype that selects the TypeScript interpreter. (required)
51
+ </documentation>
47
52
  <composition>
48
53
  <valstyle:StyleCheck />
49
54
  </composition>
50
55
  </check>
51
56
  </aggregations>
52
-
53
- </block>
57
+ </valstyle:StyleRule>