Skip to content

Comments

Fix trailing parenthesis + add test#2176

Merged
dlang-bot merged 1 commit intodlang:masterfrom
wilzbach:trailing-parentheses
Feb 10, 2018
Merged

Fix trailing parenthesis + add test#2176
dlang-bot merged 1 commit intodlang:masterfrom
wilzbach:trailing-parentheses

Conversation

@wilzbach
Copy link
Contributor

@wilzbach wilzbach commented Feb 5, 2018

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.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

@wilzbach wilzbach mentioned this pull request Feb 5, 2018
2 tasks
@wilzbach wilzbach force-pushed the trailing-parentheses branch 3 times, most recently from 2ce4888 to d8b3d99 Compare February 6, 2018 15:05
@CyberShadow
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why -l?

@wilzbach wilzbach force-pushed the trailing-parentheses branch from d8b3d99 to 1da8499 Compare February 10, 2018 15:32
@wilzbach
Copy link
Contributor Author

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 grep and its silent failures and decided the only proper way to do sanity checking is in D.

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).
Here's the output before the fixes:

.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/&amp;bug_severity=enhancement&amp;component=dlang.org&amp;op_sys=All&amp;priority=P3&amp;product=D&amp;rep_platform=All&amp;short_desc=%5BContributors (<!--UNDEFINED MACRO: "NR_D_CONTRIBUTORS"-->)%5D&amp;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.

@wilzbach wilzbach force-pushed the trailing-parentheses branch from 1da8499 to d100a92 Compare February 10, 2018 15:50
@dlang-bot dlang-bot merged commit b2bf305 into dlang:master Feb 10, 2018
@wilzbach wilzbach deleted the trailing-parentheses branch July 18, 2018 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants