Skip to content

Commit 7af0e52

Browse files
authored
[infra] Enable pre-commit shebang check (#16415)
This commit updates pre-commit configuration to enable shebang checking. ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
1 parent 1a95d8c commit 7af0e52

File tree

10 files changed

+25
-2
lines changed

10 files changed

+25
-2
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@ repos:
1010
exclude: \.(svg)$
1111
- name: 'Check trailing whitespace'
1212
id: trailing-whitespace
13-
# TODO add shebang to all excutable python/shell scripts
1413
- name: 'Check executable files'
1514
id: check-executables-have-shebangs
16-
exclude: \.(py|sh)$
15+
exclude:
16+
(?x)^(
17+
.*/__init__.py$|
18+
compiler/nnc/utils/.*\.py$|
19+
runtime/tests/scripts/models/.*/config\.sh$|
20+
res/TensorFlowTests/.*\.py$
21+
)
1722

1823
- repo: https://github.com/rhysd/actionlint
1924
rev: 'v1.7.9'

runtime/compute/ARMComputeEx/resolve_includes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
# Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

runtime/tests/nnapi/nnapi_test_generator/android-10/dynamic_tensor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
#
24
# Copyright (C) 2018 The Android Open Source Project
35
# Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved

runtime/tests/nnapi/specs/generate_vts_test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env bash
2+
13
#
24
# Copyright (C) 2017 The Android Open Source Project
35
#

tools/pbfile_tool/convert_ckpt_to_pb.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
# Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

tools/pbfile_tool/convert_pb_to_pbtxt.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
# Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

tools/pbfile_tool/extract_subgraph.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import tensorflow as tf
24

35
import argparse

tools/tensorflow_model_freezer/base_freezer.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
# Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

tools/tensorflow_model_freezer/model_freezer_util.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
# Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
24
#
35
# Licensed under the Apache License, Version 2.0 (the "License");

tools/tflkit/summarize_pb.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import argparse
24
import os
35
import subprocess

0 commit comments

Comments
 (0)