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

Generate eclipse project settings from gradle [SPR-9518] #14152

Closed
spring-projects-issues opened this issue Jun 19, 2012 · 4 comments
Closed

Generate eclipse project settings from gradle [SPR-9518] #14152

spring-projects-issues opened this issue Jun 19, 2012 · 4 comments
Labels
status: declined type: enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jun 19, 2012

Phil Webb opened SPR-9518 and commented

Following the migration to Gradle, eclipse source formatter settings are no longer contained in the git repository.

Whilst the eclipse settings cannot fully match the Spring coding style guidelines they often provide a good starting point and help to catch basic errors such as using spaces instead of tabs.


Affects: 3.2 M1

Referenced from: commits 68970b7, 2db7a12

1 votes, 3 watchers

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jun 19, 2012

Phil Webb commented

#98

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jun 20, 2012

Chris Beams commented

Thanks, Phil. I'll take a look at this and consider merging it. It's probably reasonable on the basis that these settings are closer to our actual formatting conventions than the default Eclipse settings are. However, it's important that this change isn't construed as an endorsement for hitting CTRL-SHIFT-F liberally in Spring Framework sources prior to submitting a pull request. For those that wish to use automated formatting, it should be only on the code blocks being added or changed for the issue at hand, and then still looked over manually to ensure that it actually follows conventions, which can be pretty nuanced.

The main point is that I don't want to see pull requests coming in with a bunch of unrelated formatting changes because the submitter got a false sense of confidence from these formatter settings being present.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jun 20, 2012

Sam Brannen commented

For those that wish to use automated formatting, it should be only on the code blocks being added or changed for the issue at hand

FYI: under Java / Editor / Save Actions, if you check "Format source code", you can then select the "Format edited lines" radio button instead of "Format all lines". This applies to the entire workspace. I haven't looked at the settings in the pull request, but perhaps there's an option to configure this for the individual projects as well.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jun 20, 2012

Phil Webb commented

The pull request enables project specific code formatting but does not enable any save actions. My aim was to try and make it easier for developers to make use of eclipse features without encouraging them to destroy the existing source formatting. This has mainly been driven from my experiences looking at #14067.

Perhaps the WIKI needs some updating to make it clear what options should not be used.

Things that work with the patch applied :

  • New lines of code will not be formatted automatically but subtleties such as hitting tab and not getting spaces will work.
  • A block of text can be highlighted and CTRL-F will provide a close approximation to Spring formatting.
  • Code cleanup can be applied to ensure private members are final, access is qualified with 'this', unused imports are removed and trailing spaces are trimmed.

Things that do not work (with or without the patch) :

  • Organize Imports will never match the Spring style.
  • Format source code (on the entire file) will always cause too much change.

I think that developers liberally hitting CTRL-F in eclipse is a problem that you will have with or without this patch and can only really be solved by clear submission guidelines.

@spring-projects-issues spring-projects-issues added status: declined type: enhancement labels Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined type: enhancement
Projects
None yet
Development

No branches or pull requests

1 participant