Skip to content

Improve Phobos style guide#1422

Merged
schuetzm merged 1 commit intodlang:masterfrom
wilzbach:improve_style_guide
Jul 28, 2016
Merged

Improve Phobos style guide#1422
schuetzm merged 1 commit intodlang:masterfrom
wilzbach:improve_style_guide

Conversation

@wilzbach
Copy link
Contributor

@wilzbach wilzbach commented Jul 9, 2016

Based on the discussion at #4585, here a couple of items that are part of the "unofficial" Phobos style guide, but probably should be documented.

CC @DmitryOlshansky

@DmitryOlshansky
Copy link
Member

LGTM

@PetarKirov
Copy link
Member

LGTM too

dstyle.dd Outdated
$(LI Selective imports should have a space before and after the colon (`:`) like
`import std.range : zip`)
$(LI Local, selective imports should be preferred over global imports)
$(LI In $(I non-templated) functions should be annotated with matching attributes (`@nogc`, `@safe`, `pure`, `nothrow`))
Copy link
Member

Choose a reason for hiding this comment

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

In non-templated functions, WHAT should be annotated? Did you mean to not add "In"?

@wilzbach wilzbach force-pushed the improve_style_guide branch from c137875 to a13bb50 Compare July 9, 2016 23:03
@wilzbach
Copy link
Contributor Author

wilzbach commented Jul 9, 2016

@CyberShadow I tried to address your comments. Overall I think that some of these points don't only apply for Phobos, but are part of the "D Style" in general, e.g. local selective imports or the section about attributes).

@Hackerpilot
Copy link
Contributor

@wilzbach
Copy link
Contributor Author

Does this need approval from W/A?

(It's blocking dlang/phobos#4585 a bit)

@wilzbach
Copy link
Contributor Author

Ping - it's still blocking dlang/phobos#4585 ;-)

@schuetzm
Copy link
Contributor

Nobody objected, and I see nothing controversial. Merging...

@schuetzm schuetzm merged commit 8f3b976 into dlang:master Jul 28, 2016
@wilzbach wilzbach deleted the improve_style_guide branch December 18, 2017 06:01
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.

6 participants