Skip to content
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

Single indent the long "flat" form of function definitions #24

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

DavisVaughan
Copy link
Collaborator

Closes #20

Aligns with tidyverse/style#223

Screen.Recording.2024-10-01.at.3.18.05.PM.mov

Also added a NEWS file


Note that there is currently an existing bug in codegrip when there is a function argument that is a call spanning multiple lines. Even if it starts with the right indentation we can't roundtrip it. It is unrelated to this PR (I think) but I wanted to call it out since you will see it in the snapshots.

Before this PR:

Screen.Recording.2024-10-01.at.3.14.34.PM.mov

After this PR:

Screen.Recording.2024-10-01.at.3.13.29.PM.mov

@@ -14,7 +14,7 @@ codegrip provides [RStudio addins](http://rstudio.github.io/rstudioaddins/) and

<img src="man/figures/README/reshape-call.svg"/>

Note that for function definitions, `addin_reshape` cycles through two different long shapes. The traditional L form uses more horizontal space whereas the flat form uses less horizontal space and the arguments are always aligned at double indent:
Note that for function definitions, `addin_reshape` cycles through two different long shapes. The traditional L form uses more horizontal space whereas the flat form uses less horizontal space and the arguments are always aligned at single indent:

<img src="man/figures/README/reshape-def.svg"/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@lionel- we will need you to regenerate this svg video thing


* The long "flat" form for function definitions now aligns arguments using a
single indent rather than a double indent, which follows the
[tidyverse style guide](https://style.tidyverse.org/functions.html#long-lines-1)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, itll reflect this after tidyverse/style#223 is merged

@DavisVaughan DavisVaughan merged commit a8c298b into lionel-:main Oct 3, 2024
@DavisVaughan DavisVaughan deleted the feature/single-indent-ftw branch October 3, 2024 13:13
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.

Don't double indent function signature arguments
2 participants