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

Issues with Spring Framework code format conventions #82

Closed
stepio opened this issue May 15, 2016 · 5 comments
Closed

Issues with Spring Framework code format conventions #82

stepio opened this issue May 15, 2016 · 5 comments

Comments

@stepio
Copy link
Contributor

stepio commented May 15, 2016

While working on pull request I've spotted several issues with formatting:

  1. File "eclipse-code-formatter.xml" (which is mentioned in Code Conventions section of Contributing reference) is missing at the root of the project - took the same file from spring-ampq project. Maybe a good way to fix this would be just adding a link to this file in another mature project - no fun in copying the same file from project to project.
  2. Any hints how to configure same formatting for Idea are appreciated, especially if it's possible to do this on the project level (not globally). Yes, sorry - I prefer spaces, so I'm not ready to switch to tabs globally.
  3. Current set of formatting options also changes the license header (which I took from one of the existing classes), which is not cool. Same issue with my comments - I wrote several lists of key points, which got broken after reformatting.
@artembilan
Copy link
Member

Hello, @stepio !

First of all thank you for the interest to the project and your valuable feedback!
And the contribution, of course.

Well, we don't see a big problem to let you write the code as you can with your existing IDE setting and reformat it properly during merge.

Just the problem that we have never thought to have something automatic in the project to let any community contributors just to switch between different settings from project to project.
We fought some time in the past to come up with the same setting between STS (@garyrussell uses it) and IDEA (me). But everything has been done manually, so as we didn't have such a settings config before, we don't have it even right now.

Sorry for the confuse for that eclipse-code-formatter.xml in the Contribution Guideline, but @garyrussell just said me that he isn't aware about it. So, that part for the setting must be fixed somehow. Here and in the Spring AMQP project as well.

In other places like Spring Integration we point to some setting configs in the Spring Framework project: https://github.com/spring-projects/spring-integration/wiki/Spring-Integration-Framework-Code-Style. But to be honest, they doesn't reflect our formatting requirements anyway. We still need to fix some settings manually.

We can try to find some in our team who is good with the subject, but don't forget that contribution is always welcome. Doesn't matter which one, but that is good to have any of them. Maybe with your contribution we will study anything new 😉

Our apologies for the inconvenience one more time, but as I said above,you feel free to push code as you'd like: we will reformat it on the merge. And yeah... In this case you won't be able to run check task, because the wrong formatting doesn't meet them.

@artembilan artembilan added this to the Waiting For Triage milestone May 17, 2016
@stepio
Copy link
Contributor Author

stepio commented Jun 27, 2016

Hi again!

First of all I've got your idea that formatting is a known issue and that it's not a blocker for PRs, so no complains from my side, just FYI.

I've tried to import Spring formatting rules to IDEA, just to start with something. Used the proposed wiki article from Spring Integration:
https://github.com/spring-projects/spring-integration/wiki/Spring-Integration-Framework-Code-Style
The article refers to the next sets of rules:
https://github.com/spring-projects/spring-framework/tree/master/src/idea
https://github.com/spring-projects/spring-framework/tree/master/src/eclipse

However using IDEA v.14.1.7 (on Mac OS X 10.11.5) I did not manage to import any of them:

  1. Preferences... -> Editor -> Code Style -> Java
  2. Here I see the configured set of rules and click "Mange..."
  3. In the next screen I click "Import..." and don't see the appropriate option to import any of the available file.

Am I doing something wrong? If not, maybe you'll at least share somehow your own config?

@artembilan
Copy link
Member

Hello, @stepio !

How about to try this way of import that spring-framework.xml ?

idea formatting

@stepio
Copy link
Contributor Author

stepio commented Jun 29, 2016

Unfortunately such an option is not available in my version:
screenshot 2016-06-29 12 11 46

I use IDEA v.14.1.7 on Mac OS X 10.11.5

@garyrussell
Copy link
Contributor

Closing due to inactivity; please open a new issue if you are still having problems.

@artembilan artembilan removed this from the Waiting For Triage milestone Dec 7, 2023
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

No branches or pull requests

3 participants