Fix trailing parenthesis + add test#2176
Conversation
|
Thanks for your pull request, @wilzbach! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
2ce4888 to
d8b3d99
Compare
|
Looks like .verbatim files need to be excluded from the trailing parenthesis check. .tex too, unless that one's actually a bug. |
posix.mak
Outdated
| @echo "Fixup HTML dos line endings" | ||
| @dos2unix -q $$(find $W -type f -name "*.html") | ||
| @echo "Searching for trailing parenthesis" | ||
| @grep -UIlr $$'\x0D' web/spec/lex.html . --exclude-dir=".git" --exclude-dir=".generated" ; test $$? -eq 1 |
d8b3d99 to
1da8499
Compare
|
CC @CyberShadow (or others) I accidentally broke (https://dlang.org/foundation/contributors.html). This PR fixes this and prevents such tricky regressions in the future, so maybe we could give it some priority? Thanks! Ehm okay I was tired of fighting against the tricky problems of Here's why D rocks - instead of a tricky regex that might not trigger because Windows line endings or what not, D does what you expect it to do (and defined in the tests). .generated/stable_dmd-2.077.1/dmd2/linux/bin64/rdmd --compiler=.generated/stable_dmd-2.077.1/dmd2/linux/bin64/dmd -conf=.generated/stable_dmd-2.077.1/dmd2/linux/bin64/dmd.conf -unittest check_ddoc.d $(find /home/seb/dlang/dlang.org/web -type f -name "*.html" -not -path "/home/seb/dlang/dlang.org/web/phobos/*") ; test $? -eq 1
/home/seb/dlang/dlang.org/web/foundation/contributors.html:12: [UNDEFINED MACRO] <title>Contributors (<!--UNDEFINED MACRO: "NR_D_CONTRIBUTORS"-->) - D Programming Language</title>
/home/seb/dlang/dlang.org/web/foundation/contributors.html:30: [UNDEFINED MACRO] <body id='Contributors (<!--UNDEFINED MACRO: "NR_D_CONTRIBUTORS"-->)' class='doc'>
/home/seb/dlang/dlang.org/web/foundation/contributors.html:103: [UNDEFINED MACRO] <div id="tools"><div > <div class="tip smallprint"> <a href="https://issues.dlang.org/enter_bug.cgi?bug_file_loc=http%3A%2F%2Fdlang.org/&bug_severity=enhancement&component=dlang.org&op_sys=All&priority=P3&product=D&rep_platform=All&short_desc=%5BContributors (<!--UNDEFINED MACRO: "NR_D_CONTRIBUTORS"-->)%5D&version=D2">Report a bug</a>
/home/seb/dlang/dlang.org/web/foundation/contributors.html:115: [UNDEFINED MACRO] <h1>Contributors (<!--UNDEFINED MACRO: "NR_D_CONTRIBUTORS"-->)</h1>
/home/seb/dlang/dlang.org/web/foundation/contributors.html:135: [UNDEFINED MACRO] <!--UNDEFINED MACRO: "D_CONTRIBUTORS"-->
/home/seb/dlang/dlang.org/web/sitemap.html:225: [UNDEFINED MACRO] <a href="foundation/contributors.html">Contributors (<!--UNDEFINED MACRO: "NR_D_CONTRIBUTORS"-->)</a><br>
6 errors found. Exiting. |
1da8499 to
d100a92
Compare
DAutoTest should fail when a trailing parenthesis is found.
Luckily, Ddoc is dump enough to just put them in an empty line with
$.Note that this requires all files to use unix file endings.
There was one violation which I fixed and added a test for the future.