Hi everyone,

I would like to suggest that we introduce a code formatter in Oak. Having a 
formatter will make the code easier to read and keep the whole codebase more 
maintainable. Especially for new people.

I'm not picky about which particular formatter we use — whether it's Google's 
java-format, spotless, or whatever. I’m not particularly picky about one 
particular, just that there is one. Most, if not all, major open-source 
projects enforce a strict code-style for a good reason. I think we should do 
the same.

To address concerns about polluting the git blame history, we can use GitHub's 
feature to ignore specific commits in the blame view: 
https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view.
 This way, we can exclude the formatting commits and keep the functional 
changes clear. That also means that if you open IntelliJ (or any other IDE), 
the blame will not be polluted.

A quick discussion here: https://github.com/apache/jackrabbit-oak/pull/1476 
shows me that there are some concerns about diffing with other branches etc. 
Those are pretty easily mitigated as git offers various ways to ignore 
whitespace / end of line differences.

Let me know what you think.


Best,
Steffen

Reply via email to