Repository navigation
Conversation
|
I received clarification on conflicting direction from the secretariat. The maximum total clause depth is 5 (1.2.3.4.5), not 5 subdivisions. I have updated the PR in 7c88604 |
6c69669 to
ce060f4
Compare
Ecma house style is a ToC 3 deep and max clauses 6, but there may be scenarios where a TC wants to generate a draft with fewer or more in the context of their specific standard
Ecma house style is a ToC 3 deep and max clauses 6, but there may be scenarios where a TC wants to generate a draft with fewer or more in the context of their specific standard
thanks Michael Co-authored-by: Michael Ficarra <github@michael.ficarra.me>
gibson042
left a comment
There was a problem hiding this comment.
Is it intentional to introduce errors when building the ECMA-262 draft?
| // Ecma house style calls for a maximum of 5 clause levels | ||
| const MAX_LEVELS = spec.opts.maxClauseDepth ? spec.opts.maxClauseDepth || Infinity : 5; |
There was a problem hiding this comment.
Defaulting to 5 results in errors when building ECMA-262... I'd rather keep the infinite default and encode this default in build scripts.
| // Ecma house style calls for a maximum of 5 clause levels | |
| const MAX_LEVELS = spec.opts.maxClauseDepth ? spec.opts.maxClauseDepth || Infinity : 5; | |
| const MAX_LEVELS = spec.opts.maxClauseDepth || Infinity; |
| type: Number, | ||
| description: | ||
| 'The maximum nesting depth for clauses; exceeding this will cause a warning. Defaults to no limit.', | ||
| 'The maximum nesting depth for clauses; exceeding this will cause a warning. Defaults to five (per Ecma house style.)', |
There was a problem hiding this comment.
| 'The maximum nesting depth for clauses; exceeding this will cause a warning. Defaults to five (per Ecma house style.)', | |
| 'The maximum nesting depth for clauses; exceeding this will cause a warning. Defaults to no limit; Ecma house style is 5.', |
| if (args['max-clause-depth']) { | ||
| opts.maxClauseDepth = args['max-clause-depth']; | ||
| } | ||
| if (args['printed-toc-depth']) { |
There was a problem hiding this comment.
CLI --max-clause-depth=0 results in args['printed-toc-depth'] being the number 0, which is falsy but presumably should still be propagated.
| if (args['printed-toc-depth']) { | |
| if (args['printed-toc-depth'] != null) { |
There was a problem hiding this comment.
Should it just be required to be positive if provided?
There was a problem hiding this comment.
It could be, but I find your argument for interpreting --max-clause-depth=0 as "no limit" to be persuasive.
@gibson042 Yes and no. Ecma house style limits clause depth to 5. ECMA-262's clauses exceed that. It's fine, in that we'll leave ECMA-262 specifically like that after 17 editions. spec.html can add As far as defaults go, I'm a fan of 0 == Infinity, unset == 5 for clause depth, unset == 3 for ToC depth. Also < 0 setting for ToC just omits it altogether. |
gibson042
left a comment
There was a problem hiding this comment.
[ECMA-262] spec.html can add
maxClauseDepth: 6(or evenmaxClauseDepth: 0, but I have a strong preference for the former) to its metadata. But any other standards that TC39 publishes which don't already have the legacy baggage should stick to the house style, and ECMA-262 should avoid subclauses any deeper than it already has.
Thanks, that clarifies expectations for how to continue running ecmarkup with --strict in ECMA-262.
This PR looks fine to me after fixing cli.ts.
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
Ecma house style is a ToC 3 deep and max clauses 6, but there may be scenarios where a TC wants to generate a draft with fewer or more in the context of their specific standard