Skip to content

Fix long lines in Phobos#5500

Merged
dlang-bot merged 2 commits into
dlang:masterfrom
wilzbach:fix-longline
Jun 21, 2017
Merged

Fix long lines in Phobos#5500
dlang-bot merged 2 commits into
dlang:masterfrom
wilzbach:fix-longline

Conversation

@wilzbach

Copy link
Copy Markdown
Contributor

The Dscanner check for long lines turned out to be erroneous (see e.g. dlang-community/D-Scanner#465 or dlang-community/D-Scanner#440)

Hence, some bits of Phobos kept hidden.

Unfortunately I don't know a good way to deal with std/datetime/timezone.d (the parser expects every item to be on a single line), but in the worst case we can now (#5495) always do -std.datetime.timezone

Any ideas @jmdavis?

@wilzbach

Copy link
Copy Markdown
Contributor Author

Hmm I realized that merging the fix into the phobos branch at Dscanner without ensuring that Phobos works the the fixed long line check, wasn't a good idea as by checking out a branch instead of a version/commit, the latest checkout will always be propagated to all CircleCI builds here and lead to unrelated failures (the circle.sh script merges the PR branch into upstream/master at the beginning).
Hence, I excluded std.datetime.timezone for now and changed the Makefile to checkout a specific Dscanner commit, so that we can quickly move ahead here.

@jmdavis for reference, the diff was:

diff --git a/std/datetime/timezone.d b/std/datetime/timezone.d
index 0b3bfa74e..29b3fd5f7 100644
--- a/std/datetime/timezone.d
+++ b/std/datetime/timezone.d
@@ -3485,7 +3485,8 @@ For terms of use, see http://www.unicode.org/copyright.html
 
             <!-- (UTC-09:00) Alaska -->
             <mapZone other="Alaskan Standard Time" territory="001" type="America/Anchorage"/>
-            <mapZone other="Alaskan Standard Time" territory="US" type="America/Anchorage America/Juneau America/Nome America/Sitka America/Yakutat"/>
+            <mapZone other="Alaskan Standard Time" territory="US"
+                type="America/Anchorage America/Juneau America/Nome America/Sitka America/Yakutat"/>
         </mapTimezones>
     </windowsZones>
 </supplementalData>`;

@wilzbach wilzbach added the Review:Trivial typos, formatting, comments label Jun 21, 2017
@CyberShadow

Copy link
Copy Markdown
Member

changed the Makefile to checkout a specific Dscanner commit

Tags would be a bit nicer.

Unfortunately I don't know a good way to deal with std/datetime/timezone.d

Well, you could just update the example and the unit test. That particular line seems to be there to test splitting multiple entries by space, so you can pick any other line from the file it was reduced from that has multiple entries but is under the line length limit.

Though, I think the line length checks should only apply to code that CAN be reasonably split into multiple lines, which doesn't apply to WYSIWYG string literals.

@CyberShadow CyberShadow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Going to merge this as I understand it unbreaks CircleCI.

@wilzbach
wilzbach deleted the fix-longline branch June 21, 2017 10:50
@wilzbach

Copy link
Copy Markdown
Contributor Author

Tags would be a bit nicer.

Tags will be visible for the entire Dscanner repo, so I guess I would then get complaints from other people about tags not being nice ;-)
I hope that maintaining the phobos branch is only a temporary solution anyways and that my changes make it to master.

Well, you could just update the example and the unit test. That particular line seems to be there to test splitting multiple entries by space, so you can pick any other line from the file it was reduced from that has multiple entries but is under the line length limit.

Hehe, I have the philosophy: "One shall never touch existing tests!"

Though, I think the line length checks should only apply to code that CAN be reasonably split into multiple lines, which doesn't apply to WYSIWYG string literals.

Not sure about this, but that's a discussion for a different day ...
Feel free to open an issue at Dscanner if you feel strongly about this.

Going to merge this as I understand it unbreaks CircleCI.

Yes. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merge:auto-merge Review:Trivial typos, formatting, comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants