The previous validation code was taking about 3 minutes when running on
all rules, which is the case when modifying anything outside rules/,
including shared_content/.
The runtime was marginal when only the content specific to one rule was
modified, e.g. only rules/S100/cfamily/rule.adoc is modified.
The new validation code always takes about 30 seconds on the CI. This is
a slight increase for small PR but a large reduction for PR affecting
the whole system.
Furthermore, the new approach validates includes and cross-references
properly. An issue is now raised when:
* The last include to shared_content/lang/foo.adoc is removed.
* A shared_content doc includes a file from another rule, e.g.
rules/S100/lang/rule.adoc includes shared_content/lang/foo.adoc,
which includes rules/S200/bar.adoc.
This is achieved with proper Asciidoc extensions written in Ruby.
See https://docs.asciidoctor.org/asciidoctor/latest/extensions/