Skip to content

Commit 8309e08

Browse files
bendowskicushon
authored andcommitted
Support --aosp flag in google-java-format-diff.py (#53)
If called with --aosp, pass the flag to the google-java-format binary.
1 parent 05a7ea5 commit 8309e08

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

scripts/google-java-format-diff.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ def main():
5151
'(case insensitive, overridden by -regex)')
5252
parser.add_argument('-v', '--verbose', action='store_true',
5353
help='be more verbose, ineffective without -i')
54+
parser.add_argument('-a', '--aosp', action='store_true',
55+
help='use AOSP style instead of Google Style (4-space indentation)')
5456
args = parser.parse_args()
5557

5658
# Extract changed lines for each file.
@@ -90,6 +92,8 @@ def main():
9092
command = [binary]
9193
if args.i:
9294
command.append('-i')
95+
if args.aosp:
96+
command.append('--aosp')
9397
command.extend(lines)
9498
command.append(filename)
9599
p = subprocess.Popen(command, stdout=subprocess.PIPE,

0 commit comments

Comments
 (0)