Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jakartaee-tck-dev] auto code style?


Thanks for the answers.
Please note I didn't mention automatic code changes (because I don't like it too :) )
My preference is to have only check bind to the default maven lifecycle. (at least in CI by using a profile so any PR not respecting the format will not be merged)
Or activated per default but if you don't like you can disable it locally with a profile even if using mvn spotless:apply is very cheap to run even if you are developing something.
I have created a draft PR for master here https://github.com/jakartaee/platform-tck/pull/1150
There is now a very basic pom pom-spotless.xml
I simply applied the format using mvn spotless:apply -f pom-spotless.xml
The current format is simply palantir which is very similar to what has been done in servlet api.
I haven't yet configured the import order, license header etc...
Maybe we must agree first on the style format (which is usually the most complicated part :))
Perso I don't really have big preference (except I definitely don;t like the Google format)


cheers
Olivier

On Wed, Nov 23, 2022 at 7:15 PM Darran Lofthouse <darran.lofthouse@xxxxxxxxx> wrote:
I am also not a big fan of the automatic code formatting, when I am close to completing changes my cycle is closer to:

1. Code
2. Commit
3. Build and Test
4. Push and PR

I iterate on the first three as I finish off a change, I have been caught in the past where a build step is making code changes which are now not in the commit.  The reason I got into this testing was so that what I was building and testing represented the changes I was proposing.

Projects however that check the formatting would be detected in the build step.

On Tue, Nov 22, 2022 at 4:49 PM David Matejcek <david.matejcek@xxxxxxxxxxx> wrote:
First thing I usually do on every project is running my bash script which replaces tabs with spaces in selected file types and trims trailing spaces. It makes a huge difference to GIT and potential conflicts.
Also if there's a development in more parallel branches, it can be executed in all of them independently, BUT it is not possible to do cherrypicks from the history any more.... It is, but you have to fix conflicts.
I am not a fan of automatic formatting, but in the case of the TCK everything is better than the current state.

Maybe instead of discussion we can prepare some "prototype" first and then discuss if it is what we want.
Servlet looks quite well (except wildchar imports and public methods in interfaces): https://github.com/jakartaee/servlet/blob/master/api/src/main/java/jakarta/servlet/http/HttpServlet.java

David.

On 22. 11. 22 16:00, Scott Marlow wrote:


On 11/21/22 7:24 PM, Olivier Lamy wrote:


On Tue, Nov 22, 2022 at 9:57 AM arjan tijms <arjan.tijms@xxxxxxxxx> wrote:
Hi,

On Tue, Nov 22, 2022 at 12:43 AM Olivier Lamy <olamy@xxxxxxxxxxx> wrote:
What about using some tool such as spotless [1] which can apply formatting automatically and so we don't have to worry about this while changing the code?

How would we run spotless tool against the master branch?  I see something called sbt on https://github.com/moznion/sbt-spotless, is that the command line version of spotless tool that might work against master branch?



Thanks for the pointer!
It would be good to use similar tools.
well I'm not familiar with eclipse format but there is not much standard in this area. 
I can probably use the Intellij plugin which can read eclipse xml formatter.
But anyway it's a false problem as it's a maven plugin.

Maybe we could use it to reformat master branch of TCK?

I'm not against using a source formatter but I think more discussion is needed as to which format options to use. 

Scott




 

Kind Regards,
Arjan Tijms
 
_______________________________________________
jakartaee-tck-dev mailing list
jakartaee-tck-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartaee-tck-dev


--
Olivier

_______________________________________________
jakartaee-tck-dev mailing list
jakartaee-tck-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartaee-tck-dev

_______________________________________________
jakartaee-tck-dev mailing list
jakartaee-tck-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartaee-tck-dev


-- 
David Matejcek | OmniFish
david.matejcek@xxxxxxxxxxx | +420 777 601 682
_______________________________________________
jakartaee-tck-dev mailing list
jakartaee-tck-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartaee-tck-dev
_______________________________________________
jakartaee-tck-dev mailing list
jakartaee-tck-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jakartaee-tck-dev


--
Olivier

Back to the top