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?

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

Back to the top