-
Notifications
You must be signed in to change notification settings - Fork 50
Introduce purs-tidy formatter #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/Text/Parsing/Parser/Token.purs
Outdated
@@ -77,52 +76,66 @@ type LanguageDef = GenLanguageDef String Identity | |||
-- | features of the "Text.Parsec.Token" module. The module `Text.Parsec.Language` | |||
-- | contains some default definitions. | |||
newtype GenLanguageDef s m | |||
= LanguageDef { | |||
= LanguageDef |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@natefaubion This one is a bit weird; ideally, the commas would be lined up with the values in the record themselves, though I understand that the original formatting with trailing commas is the cause of the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatter doesn’t relocate comments to other tokens. In fact, it tried to preserve it as much as possible. That’s why it keeps the newline after the comma, so that the comment is preserved as a leading comment on that token, and not relocated to a trailing comment on the comma.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a rough diff in the Token.purs
file. LGTM AFAICT.
|
||
-- | Describes the end of a block comment. Use the empty string if the | ||
-- | language doesn't support block comments. For example `*/`. | ||
, commentEnd :: String |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@natefaubion It'd be nice if the comments could align with the identifier, not the comma -- thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments align to the token they are attached to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to the comma, will these constructors have documentation once docs are pushed to Pursuit?
Description of the change
Introduces the
purs-tidy
formatter. This formatter is a lightly opinionated tool we use to maintain a consistent style in the contrib libraries.We ordinarily restrict to tools provided by the
core
orcontrib
projects. This tool is not, but it was developed and is maintained by core team members, and because it's a formatter it can't block maintenance or release of this library even in the event something goes catastrophically wrong with it.Checklist: