truthencode / ddo-calc

DDO Calculations, Planner and Plotting
Apache License 2.0
0 stars 0 forks source link

Prettier breaks Concordion HTML Templates which then fails CI Tests #88

Open adarro opened 1 year ago

adarro commented 1 year ago

Example failing build Circle CI build Formatting via Trunk delegates HTML linting / Formatting to Prettier. Prettier then automatically lowercases the DOCTYPE declaration in HTML templates used by Concordion. Concordion then fails with an initialization error when executing the template. (error similar to https://github.com/concordion/concordion/issues/15) Prettier issues: #https://github.com/prettier/prettier/pull/7391 and https://github.com/prettier/prettier/issues/6502 as it expects an Uppercase DOCTYPE.

Fixes:

edit: (clarification per @eligrey which better exemplifies the issue.) ~~The official stance is that DOCTYPE in this context should be case-insensitive. However, each tool explicitly utilizes a different option.~~

The official HTML standard specifies that DOCTYPE is case-insensitive Prettier, as an opinionated formatter changed behavior to force lower-case (which is valid in HTML context) (X)HTML specifications however, need to additionally comply to XML DOCTYPE standards where DOCTYPE is a case-sensitive ID.

Current work-around: Trunk check / fmt should only affect new and modified code, so once it's manually committed, it shouldn't break.
Forgetting to manually implement the work-around simply results in wasted cycles and an assumption the less-than-obvious stack-trace will trigger recollection of the needed fix.

eligrey commented 1 year ago

The official stance is that DOCTYPE in this context should be case-insensitive

It appears that you are using an XML context, and DOCTYPE is case sensitive in that context.