diff --git a/.yapfignore b/.yapfignore new file mode 100644 index 00000000000..98f874a5f9b --- /dev/null +++ b/.yapfignore @@ -0,0 +1,3 @@ +runtime/3rdparty/**/* +tests/nnapi/nnapi_test_generator/**/* +tests/nnapi/specs/**/* diff --git a/compiler/ann-api/include/.FORMATDENY b/compiler/ann-api/include/.FORMATDENY deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/compiler/ann-api/include/.clang-format b/compiler/ann-api/include/.clang-format new file mode 100644 index 00000000000..e3845288a2a --- /dev/null +++ b/compiler/ann-api/include/.clang-format @@ -0,0 +1 @@ +DisableFormat: true diff --git a/compiler/ann-ref/.FORMATDENY b/compiler/ann-ref/.FORMATDENY deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/compiler/ann-ref/.clang-format b/compiler/ann-ref/.clang-format new file mode 100644 index 00000000000..e3845288a2a --- /dev/null +++ b/compiler/ann-ref/.clang-format @@ -0,0 +1 @@ +DisableFormat: true diff --git a/infra/command/format b/infra/command/format index 7255360ff13..2e8338cf486 100644 --- a/infra/command/format +++ b/infra/command/format @@ -3,7 +3,6 @@ INVALID_EXIT=0 FILES_TO_CHECK=() DIRECTORIES_TO_BE_TESTED=() -DIRECTORIES_NOT_TO_BE_TESTED=() DEFAULT_CLANG_VERSION="16" CLANG_FORMAT_CANDIDATE=clang-format-$DEFAULT_CLANG_VERSION PATCH_FILE=format.patch @@ -124,16 +123,9 @@ function check_cpp_files() { # Check c++ files: replace ' ' with newline, check with grep FILES_TO_CHECK_CPP=`echo "$FILES_TO_CHECK" | tr ' ' '\n' | egrep '((\.c[cl]?)|(\.cpp)|(\.h(pp)?))$'` - # Manually ignore style checking - FILES_TO_CHECK_CPP=`echo "$FILES_TO_CHECK_CPP" | egrep -v '((/NeuralNetworks\.h)|(/NeuralNetworksExtensions\.h))$'` # Transform to array FILES_TO_CHECK_CPP=($FILES_TO_CHECK_CPP) - # Skip by '.FORMATDENY' file - for s in ${DIRECTORIES_NOT_TO_BE_TESTED[@]}; do - FILES_TO_CHECK_CPP=(${FILES_TO_CHECK_CPP[*]/$s*/}) - done - if [[ ${#FILES_TO_CHECK_CPP} -ne 0 ]]; then ${CLANG_FORMAT} -i ${FILES_TO_CHECK_CPP[@]} EXIT_CODE=$? @@ -166,11 +158,6 @@ function check_python_files() { # Exceptional case: fm-equalize doesn't have '.py' extension. FILES_TO_CHECK_PYTHON+=(`echo "$FILES_TO_CHECK" | tr ' ' '\n' | egrep '^compiler/fm-equalize/fm-equalize$'`) - for s in ${DIRECTORIES_NOT_TO_BE_TESTED[@]}; do - skip=${s#'.'/}/ - FILES_TO_CHECK_PYTHON=(${FILES_TO_CHECK_PYTHON[*]/$skip*/}) - done - if [[ ${#FILES_TO_CHECK_PYTHON} -ne 0 ]]; then yapf -i ${FILES_TO_CHECK_PYTHON[@]} EXIT_CODE=$? @@ -215,10 +202,6 @@ if [[ "${CHECK_DIFF_ONLY}" = "1" ]]; then fi fi -for DIR_NOT_TO_BE_TESTED in $(git ls-files -co --exclude-standard '*/.FORMATDENY'); do - DIRECTORIES_NOT_TO_BE_TESTED+=($(dirname "${DIR_NOT_TO_BE_TESTED}")) -done - check_newline check_permission check_cpp_files diff --git a/infra/nnfw/command/copyright-check b/infra/nnfw/command/copyright-check index b5e133f8275..2da4c8d8ed3 100644 --- a/infra/nnfw/command/copyright-check +++ b/infra/nnfw/command/copyright-check @@ -9,11 +9,6 @@ check_copyright() { FILES_TO_CHECK=$(git ls-files -c --exclude-standard) FILES_TO_CHECK_COPYRIGHTS=() for f in ${FILES_TO_CHECK[@]}; do - # Manually ignore checking - if [[ ${f} == +(*/NeuralNetworks.h|*/NeuralNetworksExtensions.h) ]]; then - continue - fi - # File extension to check if [[ ${f} == +(*.h|*.hpp|*.cpp|*.cc|*.c|*.cl) ]]; then FILES_TO_CHECK_COPYRIGHTS+=("${f}") @@ -36,12 +31,13 @@ check_copyright() { fi } -DIRECTORIES_NOT_TO_BE_TESTED=() - -for DIR_NOT_TO_BE_TESTED in $(git ls-files -co --exclude-standard '*/.FORMATDENY'); do - DIRECTORIES_NOT_TO_BE_TESTED+=("$DIR_NOT_TO_BE_TESTED") - DIRECTORIES_NOT_TO_BE_TESTED+=($(dirname "${DIR_NOT_TO_BE_TESTED}")) -done +# Manually ignore checking - 3rd party, generated files +DIRECTORIES_NOT_TO_BE_TESTED=( + compiler/ann-api + onert-micro/externals + runtime/3rdparty + tests/nnapi +) check_copyright $DIRECTORIES_NOT_TO_BE_TESTED diff --git a/onert-micro/externals/.FORMATDENY b/onert-micro/externals/.FORMATDENY deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/onert-micro/externals/.clang-format b/onert-micro/externals/.clang-format new file mode 100644 index 00000000000..e3845288a2a --- /dev/null +++ b/onert-micro/externals/.clang-format @@ -0,0 +1 @@ +DisableFormat: true diff --git a/runtime/3rdparty/.FORMATDENY b/runtime/3rdparty/.FORMATDENY deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/runtime/3rdparty/.clang-format b/runtime/3rdparty/.clang-format new file mode 100644 index 00000000000..e3845288a2a --- /dev/null +++ b/runtime/3rdparty/.clang-format @@ -0,0 +1 @@ +DisableFormat: true diff --git a/tests/nnapi/bridge/include/.clang-format b/tests/nnapi/bridge/include/.clang-format new file mode 100644 index 00000000000..e3845288a2a --- /dev/null +++ b/tests/nnapi/bridge/include/.clang-format @@ -0,0 +1 @@ +DisableFormat: true diff --git a/tests/nnapi/src/.FORMATDENY b/tests/nnapi/src/.FORMATDENY deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tests/nnapi/src/.clang-format b/tests/nnapi/src/.clang-format new file mode 100644 index 00000000000..e3845288a2a --- /dev/null +++ b/tests/nnapi/src/.clang-format @@ -0,0 +1 @@ +DisableFormat: true