Skip to content

Commit

Permalink
Draft: [infra] Remove .FORMATDENY file
Browse files Browse the repository at this point in the history
This commit removes .FORMATDENY file.
It uses .yapfignore file to ignore yapf formatting and DisableFormat option  for clang-format formatting.

ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]>
  • Loading branch information
hseok-oh committed Jan 15, 2025
1 parent 55ebd1b commit d011f4b
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .yapfignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
runtime/3rdparty/**/*
tests/nnapi/nnapi_test_generator/**/*
tests/nnapi/specs/**/*
Empty file.
1 change: 1 addition & 0 deletions compiler/ann-api/include/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DisableFormat: true
Empty file removed compiler/ann-ref/.FORMATDENY
Empty file.
1 change: 1 addition & 0 deletions compiler/ann-ref/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DisableFormat: true
17 changes: 0 additions & 17 deletions infra/command/format
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=$?
Expand Down Expand Up @@ -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=$?
Expand Down Expand Up @@ -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
Expand Down
Empty file removed onert-micro/externals/.FORMATDENY
Empty file.
1 change: 1 addition & 0 deletions onert-micro/externals/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DisableFormat: true
Empty file removed runtime/3rdparty/.FORMATDENY
Empty file.
1 change: 1 addition & 0 deletions runtime/3rdparty/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DisableFormat: true
1 change: 1 addition & 0 deletions tests/nnapi/bridge/include/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DisableFormat: true
Empty file removed tests/nnapi/src/.FORMATDENY
Empty file.
1 change: 1 addition & 0 deletions tests/nnapi/src/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DisableFormat: true

0 comments on commit d011f4b

Please sign in to comment.