From 7ff41e406beb265e7d2782f52c06cf32977e5bbd Mon Sep 17 00:00:00 2001 From: "Michael (XIAO Xufeng)" Date: Mon, 26 Apr 2021 15:46:44 +0800 Subject: [PATCH 1/2] ci: fix check_executables issue on Windows --- tools/ci/idf_ci_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci/idf_ci_utils.py b/tools/ci/idf_ci_utils.py index ee92b5db0d..c307af765f 100644 --- a/tools/ci/idf_ci_utils.py +++ b/tools/ci/idf_ci_utils.py @@ -55,8 +55,8 @@ def _check_git_filemode(full_path): # type: (str) -> bool mode = stdout.split(' ', 1)[0] # e.g. 100644 for a rw-r--r-- if any([int(i, 8) & 1 for i in mode[-3:]]): - return False - return True + return True + return False def is_executable(full_path): # type: (str) -> bool From 4919358d6bb819492b1d873af4325a918cc09079 Mon Sep 17 00:00:00 2001 From: "Michael (XIAO Xufeng)" Date: Mon, 26 Apr 2021 15:58:03 +0800 Subject: [PATCH 2/2] ci: put file sorter to the end of the pre-commit checking So that the sorter will be done at the end of the checking flow, we don't need to run pre-commit hooks again if another hook also take effect. --- .pre-commit-config.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cb6b1cee62..6bd069fa18 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,8 +22,6 @@ repos: - id: end-of-file-fixer exclude: *whitespace_excludes - id: check-executables-have-shebangs - - id: file-contents-sorter - files: 'tools/ci/executable-list.txt' - id: mixed-line-ending args: ['-f=lf'] - id: double-quote-string-fixer @@ -75,3 +73,8 @@ repos: language: python files: '\.gitlab/CODEOWNERS' pass_filenames: false + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: file-contents-sorter + files: 'tools/ci/executable-list.txt'