Skip to content

Change line length to 120 chars #100

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

Closed
spencergibb opened this issue Apr 12, 2019 · 12 comments
Closed

Change line length to 120 chars #100

spencergibb opened this issue Apr 12, 2019 · 12 comments

Comments

@spencergibb
Copy link

spencergibb commented Apr 12, 2019

It would be nice to have an option to set line length, say to 120

@philwebb
Copy link
Contributor

I'm really not keen to add too many configuration options, it undermines the point of the project. If the current wrap length really isn't suitable then perhaps we should reconsider it across the board and all move to 120 chars.

@spencergibb
Copy link
Author

Are there options?

We, as a team (Spring Cloud Core), want to use this (and are currently using it) and have a line length > 90.

@philwebb
Copy link
Contributor

Currently pretty much nothing is configurable with the formatter. That was an intentional decision because I want to bring consistency to all the projects that use it. If we start adding flags for various options it undermines the point a little.

Line wrapping seems to be a contentious issue. I took the lead from https://github.com/spring-projects/spring-framework/wiki/Code-Style#line-wrapping and kept the limit small.

I personally quite like the smaller line length, but I'm not against changing it we can somehow manage to reach agreement that 120 is better than the current size.

@spencergibb
Copy link
Author

I doubt there will ever be consensus. I guess we can always fork.

@philwebb
Copy link
Contributor

I'd rather add an option than fork. I'm just not sure where it can go. We've got a copyright header year that is configurable so I guess it could go next to that. It'll be a bit clunky.

@philwebb
Copy link
Contributor

Rather than make the limit totally configurable I'd be tempted to just support default and wide as options.

@spencergibb
Copy link
Author

Yeah, that would probably be fine

@philwebb
Copy link
Contributor

I've spend a couple of days on this (https://github.com/philwebb/spring-javaformat/tree/gh-100). It turns out making the length change is easy, adding build plugin configuration isn't too bad but getting the IDE's to find that value is very difficult.

We've discussed line length again on the Boot call and we think the best option is just to make 120 the default (if it means more people will adopt the formatter). We'll probably keep javadoc at 90.

@philwebb philwebb changed the title Option to set line length Change line length to 120 chars Apr 25, 2019
@philwebb philwebb added this to the 0.0.10 milestone Apr 25, 2019
@nasreddineskandrani
Copy link

nasreddineskandrani commented Jul 18, 2019

Hi people! \(^^)/
Some dev's are using other values and have to create a custom formatter on top of yours to be able to edit line length which is in my opinion a sign of "something is wrong with your decision".

Working with prettier for a decade and his popularity is so huge in Front End => nobody has ever complained about having this option configurable in my teams...

I really really really suggest to reconsider your opinion on not making this option editable for spring projects... It's just opinions... let people free : )

Thank you! Thank you! Thank you!

@philwebb
Copy link
Contributor

@nasreddineskandrani I really would have liked to made this one specific thing an option, but after a couple of days trying it just ended up consuming too much time. It's hard to find enough hours in the day to do all the things :(

@nasreddineskandrani
Copy link

nasreddineskandrani commented Jul 18, 2019

From my participation in the open source world, i see often "help wanted" or "Accepting PRs" tags in github issues.
examples:
"Accepting PRs" => ngrx/platform#2016
"help wanted" => angular/components#15989

Which means if someone is open to do it he can open a PR so you'll out source the job and you can then only review the work as core members which is less time consuming and interesting at the same time.

If it's a matter of availibility your side:
An idea -> Can we tag this issue as 'Accepting PRs' for example? so someone may try to help with it. I can't promess i will do it but i am sure someone will try it if he really wants the feature (people are amazing).

Thank's again for the quick answer.

@philwebb
Copy link
Contributor

@nasreddineskandrani Sure, feel free to open another issue (since the 120 change is done) and I'll tag it.

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

No branches or pull requests

4 participants