1
0
mirror of https://github.com/google/nomulus synced 2025-12-23 06:15:42 +00:00

Update google-java-format (#2570)

Also converted regex strings in the Python script to raw strings as
future Python versions will start to reject them.

See: https://docs.python.org/3/whatsnew/3.12.html#other-language-changes
This commit is contained in:
Lai Jiang
2024-09-26 10:49:38 -04:00
committed by GitHub
parent a22a38527b
commit c0490f7777
3 changed files with 3 additions and 3 deletions

View File

@@ -63,7 +63,7 @@ def main():
lines_by_file = {} lines_by_file = {}
for line in sys.stdin: for line in sys.stdin:
match = re.search('^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line) match = re.search(r"^\+\+\+\ (.*?/){%s}(\S*)" % args.p, line)
if match: if match:
filename = match.group(2) filename = match.group(2)
if filename is None: if filename is None:
@@ -76,7 +76,7 @@ def main():
if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE): if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE):
continue continue
match = re.search('^@@.*\+(\d+)(,(\d+))?', line) match = re.search(r"^@@.*\+(\d+)(,(\d+))?", line)
if match: if match:
start_line = int(match.group(1)) start_line = int(match.group(1))
line_count = 1 line_count = 1

View File

@@ -40,7 +40,7 @@ where:
show show the effect of the formatting as unified diff" show show the effect of the formatting as unified diff"
SCRIPT_DIR="$(realpath $(dirname $0))" SCRIPT_DIR="$(realpath $(dirname $0))"
JAR_NAME="google-java-format-1.19.2-all-deps.jar" JAR_NAME="google-java-format-1.23.0-all-deps.jar"
# Make sure we have a valid python interpreter. # Make sure we have a valid python interpreter.
if [ -z "$PYTHON" ]; then if [ -z "$PYTHON" ]; then