Skip to content

Indention of function declaration and closing braces - #260

Merged
lorenzwalthert merged 2 commits into
r-lib:masterfrom
lorenzwalthert:master
Oct 25, 2017
Merged

lorenzwalthert merged 2 commits into
r-lib:masterfrom
lorenzwalthert:master

Conversation

@lorenzwalthert

@lorenzwalthert lorenzwalthert commented Oct 25, 2017 •

Copy link
Copy Markdown
Collaborator

Closes #253. Moving the closing brace all the way to the left if it can't be moved one line up seems a fairly rare case and it can't be implemented easily because the most left expression is not in the same nest when the indention is referenced.
I.e. this

a <- function(x,
              y #
            )

Remains as is and does not become

a <- function(x,
              y #
)

Because of the reference issue and also not

a <- function(x,
              y #
              )

Because of the brace unindention mechanism that applies here. I think we can leave that as is for now since it should be fairly rare.

@krlmlr krlmlr 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.

Thanks, looks good.


a <- function(x, #
y #
) {

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.

I think we can still add a FIXME here, because this isn't what we'd truly like to see.

@lorenzwalthert
lorenzwalthert merged commit aaefd79 into r-lib:master Oct 25, 2017
krlmlr added a commit that referenced this pull request Nov 27, 2017
- Adapt documentation (#290).
- Add roundtrip (#287).
- Fix AppVeyor builds.
- Fix token insertion / comment interaction (#279).
- Clarify labelling strategy (#285).
- Fixing and extending Rstudioaddins (#283).
- Fix eq assign parsing (#276).
- style_files -> vectorized style_file (#273).
- Refactoring (#270).
- Fix CI (#275).
- Fix covr (#274).
- Renaming files (#271).
- Handle styling of an unsaved active file (#243).
- Test R 3.1 and R 3.2 (#249).
- Allow empty {} without line break (#261).
- Wrap expr in expr before enclosing with curly braces (#263).
- Avoid checking for hard-coded dot (#262).
- Account for dependency renaming (utf8 changed to enc) (#264).
- Indention of function declaration and closing braces (#260).
- Only remove line break before closing with strict option (#252).
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.

2 participants