From 297e87b2466412396dafe5210ec90238614f7402 Mon Sep 17 00:00:00 2001 From: Adarsh Rawat Date: Sat, 25 Mar 2023 13:36:06 +0530 Subject: [PATCH 1/8] Absorbed actionlint into pre-commit - added actionlint to .pre-commit-config.yaml file - deleted the actionlint.yml file from .github/workflows. --- .github/workflows/actionlint.yml | 26 -------------------------- .pre-commit-config.yaml | 5 +++++ 2 files changed, 5 insertions(+), 26 deletions(-) delete mode 100644 .github/workflows/actionlint.yml diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml deleted file mode 100644 index 5ae36d07f0d..00000000000 --- a/.github/workflows/actionlint.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Lint GitHub Actions workflows - -on: - pull_request: - push: - branches: - - main - -# Cancels all previous workflow runs for pull requests that have not completed. -concurrency: - # The concurrency group contains the workflow name and the branch name for pull requests - # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -jobs: - actionlint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Check workflow files - run: | - echo "::add-matcher::.github/actionlint-matcher.json" - bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/v1.6.15/scripts/download-actionlint.bash) - ./actionlint -color - shell: bash diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d53ef0e2774..6a8d10115dd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -129,6 +129,11 @@ repos: hooks: - id: shellcheck + - repo: https://github.com/rhysd/actionlint + rev: main + hooks: + - id: actionlint + - repo: local # More local hooks are defined at the top. hooks: - id: types From 21f29fc49910f5e23b9818bc6e52ecd58dc91044 Mon Sep 17 00:00:00 2001 From: Adarsh Rawat Date: Sat, 25 Mar 2023 15:43:12 +0530 Subject: [PATCH 2/8] Added 'actionlint' to pre-commit-config template Added '- actionlint' to hooks in pre-commit-config template of `.pre-commit-config.yaml` file. --- templates/.pre-commit-config.yaml.jinja | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/.pre-commit-config.yaml.jinja b/templates/.pre-commit-config.yaml.jinja index ac24915e554..ca3dc3ec685 100644 --- a/templates/.pre-commit-config.yaml.jinja +++ b/templates/.pre-commit-config.yaml.jinja @@ -30,6 +30,7 @@ repos: - id: fix-encoding-pragma args: - --remove + - id: actionlint {% if contains_python_code | default(true) %} - id: check-docstring-first - id: requirements-txt-fixer From 5ab00abf28676800250f018f52f3dd7801e29e80 Mon Sep 17 00:00:00 2001 From: Adarsh Rawat Date: Sat, 25 Mar 2023 17:00:32 +0530 Subject: [PATCH 3/8] Added `actionlint` to pre-commit-config --- templates/.pre-commit-config.yaml.jinja | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/.pre-commit-config.yaml.jinja b/templates/.pre-commit-config.yaml.jinja index ca3dc3ec685..90bc3e0a51c 100644 --- a/templates/.pre-commit-config.yaml.jinja +++ b/templates/.pre-commit-config.yaml.jinja @@ -30,7 +30,6 @@ repos: - id: fix-encoding-pragma args: - --remove - - id: actionlint {% if contains_python_code | default(true) %} - id: check-docstring-first - id: requirements-txt-fixer @@ -66,7 +65,7 @@ repos: - id: black args: - --safe - + - repo: https://github.com/pycqa/pydocstyle rev: 6.2.2 # 6.2.3 is slightly broken hooks: @@ -82,6 +81,11 @@ repos: # See the following documentation for what each rule does: # https://www.pydocstyle.org/en/6.2.3/error_codes.html#error-codes - --add-ignore=D1,D202,D205,D211,D400 + + - repo: https://github.com/rhysd/actionlint + rev: main + hooks: + - id: actionlint {% endif %} {% if contains_js_code | default(true) %} From 0fdf652fb9f91bc376a5e89e2edc817972c79ba6 Mon Sep 17 00:00:00 2001 From: Adarsh Rawat Date: Sat, 25 Mar 2023 17:04:46 +0530 Subject: [PATCH 4/8] removed extra whitespaces --- templates/.pre-commit-config.yaml.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/.pre-commit-config.yaml.jinja b/templates/.pre-commit-config.yaml.jinja index 90bc3e0a51c..096c4c823b3 100644 --- a/templates/.pre-commit-config.yaml.jinja +++ b/templates/.pre-commit-config.yaml.jinja @@ -65,7 +65,7 @@ repos: - id: black args: - --safe - + - repo: https://github.com/pycqa/pydocstyle rev: 6.2.2 # 6.2.3 is slightly broken hooks: From 569bdff56d14fc701b30d0b70de796981fb2e130 Mon Sep 17 00:00:00 2001 From: Adarsh Rawat Date: Fri, 31 Mar 2023 07:47:56 +0530 Subject: [PATCH 5/8] Update templates/.pre-commit-config.yaml.jinja Co-authored-by: Dhruv Bhanushali --- templates/.pre-commit-config.yaml.jinja | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/.pre-commit-config.yaml.jinja b/templates/.pre-commit-config.yaml.jinja index 096c4c823b3..de9a09e39e0 100644 --- a/templates/.pre-commit-config.yaml.jinja +++ b/templates/.pre-commit-config.yaml.jinja @@ -85,7 +85,8 @@ repos: - repo: https://github.com/rhysd/actionlint rev: main hooks: - - id: actionlint + - id: actionlint-docker + files: ^\.github/(workflows|actions)/.*$ {% endif %} {% if contains_js_code | default(true) %} From ad750b7621c77fd0307d59bff2f1ab9467375435 Mon Sep 17 00:00:00 2001 From: Adarsh Rawat Date: Fri, 31 Mar 2023 16:18:51 +0530 Subject: [PATCH 6/8] Update .pre-commit-config.yaml --- .pre-commit-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f37c68a5ed5..bb9f3e6ffba 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -132,7 +132,8 @@ repos: - repo: https://github.com/rhysd/actionlint rev: main hooks: - - id: actionlint + - id: actionlint-docker + files: ^\.github/(workflows|actions)/.*$ - repo: local # More local hooks are defined at the top. hooks: From 38680af7d75ac53703ff22b69da311897ab705c0 Mon Sep 17 00:00:00 2001 From: Adarsh Rawat Date: Sun, 2 Apr 2023 21:24:49 +0530 Subject: [PATCH 7/8] Removed the files directive for actionlint-docker. --- .pre-commit-config.yaml | 1 - templates/.pre-commit-config.yaml.jinja | 1 - 2 files changed, 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bb9f3e6ffba..f66b355ac21 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -133,7 +133,6 @@ repos: rev: main hooks: - id: actionlint-docker - files: ^\.github/(workflows|actions)/.*$ - repo: local # More local hooks are defined at the top. hooks: diff --git a/templates/.pre-commit-config.yaml.jinja b/templates/.pre-commit-config.yaml.jinja index de9a09e39e0..4e8892a09fd 100644 --- a/templates/.pre-commit-config.yaml.jinja +++ b/templates/.pre-commit-config.yaml.jinja @@ -86,7 +86,6 @@ repos: rev: main hooks: - id: actionlint-docker - files: ^\.github/(workflows|actions)/.*$ {% endif %} {% if contains_js_code | default(true) %} From ee268673438c957883bb3ed8b53f4813032ab648 Mon Sep 17 00:00:00 2001 From: Dhruv Bhanushali Date: Mon, 3 Apr 2023 02:48:30 +0400 Subject: [PATCH 8/8] Fix template to pass lint checks --- templates/.pre-commit-config.yaml.jinja | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/.pre-commit-config.yaml.jinja b/templates/.pre-commit-config.yaml.jinja index 4e8892a09fd..2b3f6170894 100644 --- a/templates/.pre-commit-config.yaml.jinja +++ b/templates/.pre-commit-config.yaml.jinja @@ -81,11 +81,6 @@ repos: # See the following documentation for what each rule does: # https://www.pydocstyle.org/en/6.2.3/error_codes.html#error-codes - --add-ignore=D1,D202,D205,D211,D400 - - - repo: https://github.com/rhysd/actionlint - rev: main - hooks: - - id: actionlint-docker {% endif %} {% if contains_js_code | default(true) %} @@ -125,5 +120,10 @@ repos: rev: v0.8.0 hooks: - id: shellcheck + + - repo: https://github.com/rhysd/actionlint + rev: main + hooks: + - id: actionlint-docker {% block repos_bottom %} {% endblock %}