Skip to content

Add consistency to parameter lists formatting #1952

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

Merged
merged 3 commits into from
May 18, 2021
Merged

Add consistency to parameter lists formatting #1952

merged 3 commits into from
May 18, 2021

Conversation

arbitrary-dev
Copy link
Contributor

@arbitrary-dev arbitrary-dev commented Mar 7, 2021

To make it consistent with argument list formatting of Classes.

Previously: #1805

Alternative offered, please review once again @SethTisue

@SethTisue
Copy link
Member

Is there evidence that this style is considered standard? Is it widely used?

@arbitrary-dev
Copy link
Contributor Author

arbitrary-dev commented Mar 10, 2021

As I already mentioned in this comment, this change is only to bring consistency in the current scala docs, because in "Classes" this particular formatting is already used for long argument lists, but in this place formatting is different.

Is there evidence that this style is considered standard?

Not that I know.

Is it widely used?

I see more of these:

def method(with: Very, long: Long)(
  parameter: List[]): Unit = …

…rather than parentheses alignment, which I only observed in C world.

Also this one is from scalatest:
https://github.com/scalatest/scalatest/blob/3.2.x-new/jvm/core/src/main/scala/org/scalatest/Engine.scala#L125

Overall, I'm not insisting. Could be just a proposal, an alternative, I preserved parentheses alignment case in the docs.

Me personally find this one more pleasing than others and it also facilitates having cleaner git diffs in refactorings, when parameters are each on their own lines without any parentheses. Plus reading vertically is way easier than finding parameters in horizontal plane, especially for people using terminals with short width.

@SethTisue
Copy link
Member

SethTisue commented Mar 10, 2021

Could be just a proposal, an alternative

Yeah. I think I would prefer wording such as: "Several different styles are in use, here's possibility 1, here's possibility 2, other styles may exist," something like that. I'm not quite comfortable with how the current wording seems to suggest that your preferred style is the most preferred style.

With that adjustment, I think this would be ready for merge.

@arbitrary-dev
Copy link
Contributor Author

Updated, please check.

Base automatically changed from master to main March 23, 2021 13:44
@SethTisue SethTisue merged commit 8e9e39f into scala:main May 18, 2021
@SethTisue
Copy link
Member

thank you!

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