File: formatting.txt

package info (click to toggle)
lucene9 9.10.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 114,036 kB
  • sloc: java: 775,336; python: 6,157; xml: 1,464; perl: 448; sh: 353; makefile: 11
file content (20 lines) | stat: -rw-r--r-- 790 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Code formatting
===============

Starting with (LUCENE-9564) Java code is enforced to comply with
google-java-format conventions. In theory you shouldn't worry about
what the convention actually looks like - write the code in any way
you like and then run:

./gradlew tidy

prior to running your regular precommit checks. This will reformat
your code so that it complies with the convention and passes gradle
'check' task.

IMPORTANT: There is *no* way to mark sections of the code as excluded
from formatting. This is by design and cannot be altered. In vast
majority of cases the formatter will do a great job of cleaning up the
code. Occasionally you may want to rewrite the code (introduce a local
variable or reshape code paths) so that it's easier to read after
automatic formatting.