From d858f77217a682e0017ba21f1d0375e279a4825d Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 27 Aug 2024 18:18:22 +0800 Subject: [PATCH 1/4] CI: Move the file permission checking from pre-commit to Style Checks workflow --- .github/workflows/style_checks.yaml | 5 +++++ .pre-commit-config.yaml | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/style_checks.yaml b/.github/workflows/style_checks.yaml index 119f1200066..b9b3a541a01 100644 --- a/.github/workflows/style_checks.yaml +++ b/.github/workflows/style_checks.yaml @@ -42,6 +42,11 @@ jobs: make check pre-commit run --all-files + - name: Ensure files have 644 permission + run: | + git ls-files -z | xargs -0 chmod 644 + if [[ $(git ls-files -m) ]]; then git --no-pager diff HEAD; exit 1; fi + - name: Ensure example scripts have at least one code block separator run: | git ls-files 'examples/**/*.py' | xargs grep --files-without-match '# %%' > output.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 328813ae7bc..2b4440b5bb4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,8 +13,6 @@ repos: hooks: - id: forbid-crlf - id: remove-crlf - - id: chmod - args: ['644'] # https://pre-commit.ci/#configuration ci: From 390a74900d1e488dc83f843870f844da60fd8b5c Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 27 Aug 2024 20:15:27 +0800 Subject: [PATCH 2/4] Update .pre-commit-config.yaml Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2b4440b5bb4..09ac1f8cc09 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,5 +16,6 @@ repos: # https://pre-commit.ci/#configuration ci: + skip: [chmod] autofix_prs: false autoupdate_schedule: quarterly From 4e08f91f5ff21574e278f2e7b7f279e1ed2cc7c6 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 27 Aug 2024 20:25:53 +0800 Subject: [PATCH 3/4] Revert "CI: Move the file permission checking from pre-commit to Style Checks workflow" This reverts commit d858f77217a682e0017ba21f1d0375e279a4825d. --- .github/workflows/style_checks.yaml | 5 ----- .pre-commit-config.yaml | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/style_checks.yaml b/.github/workflows/style_checks.yaml index b9b3a541a01..119f1200066 100644 --- a/.github/workflows/style_checks.yaml +++ b/.github/workflows/style_checks.yaml @@ -42,11 +42,6 @@ jobs: make check pre-commit run --all-files - - name: Ensure files have 644 permission - run: | - git ls-files -z | xargs -0 chmod 644 - if [[ $(git ls-files -m) ]]; then git --no-pager diff HEAD; exit 1; fi - - name: Ensure example scripts have at least one code block separator run: | git ls-files 'examples/**/*.py' | xargs grep --files-without-match '# %%' > output.txt diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 09ac1f8cc09..47f78ea5ed9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,6 +13,8 @@ repos: hooks: - id: forbid-crlf - id: remove-crlf + - id: chmod + args: ['644'] # https://pre-commit.ci/#configuration ci: From 7b918d33507557b5fa26ee0a7d010c05095d6112 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Tue, 27 Aug 2024 20:26:41 +0800 Subject: [PATCH 4/4] Fix intentation --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 47f78ea5ed9..1deeef23169 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,6 +18,6 @@ repos: # https://pre-commit.ci/#configuration ci: - skip: [chmod] + skip: [chmod] autofix_prs: false autoupdate_schedule: quarterly