summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurimas Liutikas <aurimas@google.com>2017-12-12 09:47:00 -0800
committerAurimas Liutikas <aurimas@google.com>2017-12-12 09:47:00 -0800
commita6100281b01aaa767bbe56d9c6965036481602b8 (patch)
tree3a98655508ae1d8c4e42640878d69d21fbe571c0
parent30ef8f6084b137fcbbd75e4916d60f9d5fd84021 (diff)
downloadplatform_prebuilts_ktlint-a6100281b01aaa767bbe56d9c6965036481602b8.tar.gz
platform_prebuilts_ktlint-a6100281b01aaa767bbe56d9c6965036481602b8.tar.bz2
platform_prebuilts_ktlint-a6100281b01aaa767bbe56d9c6965036481602b8.zip
Allow calling ktlint.py without any files.
This is needed to support repo upload when the only change is deleted files and thus passed in list of files is empty. Test: local repo upload Change-Id: Ie2e36b29a67824cd1aced2e56d7fca3eec6a30bc
-rwxr-xr-xktlint.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ktlint.py b/ktlint.py
index c78b6a9..fa9ea0e 100755
--- a/ktlint.py
+++ b/ktlint.py
@@ -30,7 +30,7 @@ KTLINT_JAR = os.path.join(MAIN_DIRECTORY, 'ktlint-android-all.jar')
def main(args=None):
parser = argparse.ArgumentParser()
- parser.add_argument('--file', '-f', nargs='+')
+ parser.add_argument('--file', '-f', nargs='*')
args = parser.parse_args()
kotlin_files = [f for f in args.file if f.endswith('.kt')]
if not kotlin_files: