xref: /Lucene/help/formatting.txt (revision c94b035df86f4fc1f8c6a0340c8bbf02b7af8ef0)
1Code formatting
2===============
3
4Starting with (LUCENE-9564) Java code is enforced to comply with
5google-java-format conventions. In theory you shouldn't worry about
6what the convention actually looks like - write the code in any way
7you like and then run:
8
9./gradlew tidy
10
11prior to running your regular precommit checks. This will reformat
12your code so that it complies with the convention and passes gradle
13'check' task.
14
15IMPORTANT: There is *no* way to mark sections of the code as excluded
16from formatting. This is by design and cannot be altered. In vast
17majority of cases the formatter will do a great job of cleaning up the
18code. Occasionally you may want to rewrite the code (introduce a local
19variable orreshape code paths) so that it's easier to read after
20automatic formatting.
21