Skip to content

Brace symmetry and spaces around ^ - #46

Merged
hadley merged 3 commits into
tidyverse:masterfrom
krlmlr:patch-1
Dec 30, 2017
Merged

hadley merged 3 commits into
tidyverse:masterfrom
krlmlr:patch-1

Conversation

@krlmlr

@krlmlr krlmlr commented Oct 31, 2017 •

Copy link
Copy Markdown
Member

Reference: r-lib/styler#254 (comment)

CC @lorenzwalthert.

@hadley: Some function calls with blocks aren't formatted correctly in styler, it would help if we could formalize the rules here. Do we need more examples?

@hadley

hadley commented Oct 31, 2017

Copy link
Copy Markdown
Member

I feel like there's probably a better way to formalise this rule, but I can't see how to express it clearly. It's more like matching (symmetrically) the pattern of the opening braces.

@krlmlr

krlmlr commented Dec 30, 2017

Copy link
Copy Markdown
Member Author

I have also edited the part where operator spacing is discussed, following https://github.com/tidyverse/dplyr/pull/3261/files#r158605017. CC @lionel- @lorenzwalthert @batpigandme.

@krlmlr krlmlr changed the title Discuss free-standing blocks Brace symmetry and spaces around ^ Dec 30, 2017
@hadley
hadley merged commit bed5e09 into tidyverse:master Dec 30, 2017
@lorenzwalthert

Copy link
Copy Markdown
Contributor

@krlmlr do we need to adapt styler defaults for math token spacing? Also, maybe we can explicitly add / and * in the examples above just to be explicit. Should there be a space around them or not?

@krlmlr
krlmlr deleted the patch-1 branch December 30, 2017 19:26
@krlmlr

krlmlr commented Dec 30, 2017

Copy link
Copy Markdown
Member Author

@lorenzwalthert: There is an example for / and an explicit suggestion to use parentheses if in doubt, feels sufficient to me. Working on updating styler.

@lorenzwalthert

lorenzwalthert commented Dec 30, 2017 •

Copy link
Copy Markdown
Contributor

Ok, I meant in the floating text enumeration. But probably you are right and it's sufficient.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants