You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by wa...@apache.org on 2025/07/25 03:04:35 UTC

(tooling-docs) branch main updated: gha: add pre-commit with about 15 hooks (#27)

This is an automated email from the ASF dual-hosted git repository.

wave pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-docs.git


The following commit(s) were added to refs/heads/main by this push:
     new 39a246b  gha: add pre-commit with about 15 hooks (#27)
39a246b is described below

commit 39a246b92014fb11cd42e0230797ab13361e6099
Author: John Bampton <jb...@users.noreply.github.com>
AuthorDate: Fri Jul 25 13:04:31 2025 +1000

    gha: add pre-commit with about 15 hooks (#27)
    
    Run pre-commit to auto fix linter errors
---
 .asf.yaml                              |  1 -
 .github/workflows/pre-commit.yml       | 27 +++++++++++++++++++++++++
 .pre-commit-config.yaml                | 37 ++++++++++++++++++++++++++++++++++
 apache-trusted-release/platform.md     |  2 --
 apache-trusted-release/requirements.md |  1 -
 content/css/bootstrap.min.css          |  1 -
 content/css/foundation.min.css         |  2 +-
 content/js/bootstrap.bundle.min.js     |  2 +-
 content/js/vendor/foundation.js        |  2 +-
 content/js/vendor/foundation.min.js    |  2 +-
 content/pages/platform.md              |  2 --
 content/pages/trusted-release.md       |  1 -
 content/pages/volunteer.md             |  1 -
 content/theme/templates/blog.html      |  1 -
 content/theme/templates/styles.html    |  1 -
 pagefind.sh                            |  1 -
 pelicanconf.py                         |  3 ---
 17 files changed, 68 insertions(+), 19 deletions(-)

diff --git a/.asf.yaml b/.asf.yaml
index 0b7afe5..d55187f 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -29,4 +29,3 @@ notifications:
   commits:      commits@tooling.apache.org
   issues:       dev@tooling.apache.org
   pullrequests: dev@tooling.apache.org
-
diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml
new file mode 100644
index 0000000..dd6e295
--- /dev/null
+++ b/.github/workflows/pre-commit.yml
@@ -0,0 +1,27 @@
+# https://pre-commit.com/
+name: Lint
+
+on: [pull_request]
+
+permissions:
+  contents: read
+
+jobs:
+  pre-commit:
+    name: Run pre-commit
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout code
+        uses: actions/checkout@v4
+      - name: Install
+        run: |
+          python -m pip install --upgrade pip
+          pip install pre-commit
+      - name: Set PY
+        run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> "$GITHUB_ENV"
+      - uses: actions/cache@v4
+        with:
+          path: ~/.cache/pre-commit
+          key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
+      - name: Run pre-commit
+        run: pre-commit run --all-files
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..ca7e532
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,37 @@
+---
+# https://pre-commit.com/
+default_stages: [pre-commit, pre-push]
+default_language_version:
+  # force all unspecified Python hooks to run python3
+  python: python3
+minimum_pre_commit_version: "3.2.0"
+repos:
+  - repo: meta
+    hooks:
+      - id: identity
+        name: run identity
+        description: check your identity
+      - id: check-hooks-apply
+        name: run check-hooks-apply
+        description: check hooks apply to the repository
+  - repo: https://github.com/pre-commit/pre-commit-hooks
+    rev: v5.0.0
+    hooks:
+      - id: check-ast
+      - id: check-case-conflict
+      - id: check-executables-have-shebangs
+      - id: check-illegal-windows-names
+      - id: check-merge-conflict
+      - id: check-shebang-scripts-are-executable
+      - id: check-vcs-permalinks
+      - id: check-yaml
+      - id: detect-private-key
+      - id: end-of-file-fixer
+      - id: fix-byte-order-marker
+      - id: forbid-submodules
+      - id: mixed-line-ending
+      - id: requirements-txt-fixer
+        files: ^requirements\.txt$
+      - id: trailing-whitespace
+        args: [--markdown-linebreak-ext=md]
+        exclude: \.svg$
diff --git a/apache-trusted-release/platform.md b/apache-trusted-release/platform.md
index 3148c81..7e41dd8 100644
--- a/apache-trusted-release/platform.md
+++ b/apache-trusted-release/platform.md
@@ -124,5 +124,3 @@ Note: this section is a flexible outline of what we intend for the UI, and may c
 6. Page Template
    - Responsive with Header(Hamburger)/Content/Footer.
    - Include Search in Header(Hamburger)
-
-
diff --git a/apache-trusted-release/requirements.md b/apache-trusted-release/requirements.md
index e966f51..a3642ac 100644
--- a/apache-trusted-release/requirements.md
+++ b/apache-trusted-release/requirements.md
@@ -81,4 +81,3 @@ While reading consider these Notes:
      > There are policy implications to the automation of digital signatures.
      > For now, creating digital signatures on certain artifact types must be done prior to GPG signing and
      > prior to submission of the release candidate.
-
diff --git a/content/css/bootstrap.min.css b/content/css/bootstrap.min.css
index 935d921..22e4f21 100644
--- a/content/css/bootstrap.min.css
+++ b/content/css/bootstrap.min.css
@@ -4,4 +4,3 @@
  * Copyright 2011-2022 Twitter, Inc.
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
  */:root{--bs-blue:#0d6efd;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#d63384;--bs-red:#dc3545;--bs-orange:#fd7e14;--bs-yellow:#ffc107;--bs-green:#198754;--bs-teal:#20c997;--bs-cyan:#0dcaf0;--bs-black:#000;--bs-white:#fff;--bs-gray:#6c757d;--bs-gray-dark:#343a40;--bs-gray-100:#f8f9fa;--bs-gray-200:#e9ecef;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#6c757d;--bs-gray-700:#495057;--bs-gray-800:#343a40;--bs-gray-900:#212529;--bs-primary:#0d6efd;--b [...]
-
diff --git a/content/css/foundation.min.css b/content/css/foundation.min.css
index 8428d09..43418f7 100644
--- a/content/css/foundation.min.css
+++ b/content/css/foundation.min.css
@@ -1,2 +1,2 @@
 @charset "UTF-8";
-/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[ti [...]
\ No newline at end of file
+/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[ti [...]
diff --git a/content/js/bootstrap.bundle.min.js b/content/js/bootstrap.bundle.min.js
index 1d13886..3e99d21 100644
--- a/content/js/bootstrap.bundle.min.js
+++ b/content/js/bootstrap.bundle.min.js
@@ -4,4 +4,4 @@
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
   */
 !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e()}(this,(function(){"use strict";const t="transitionend",e=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():nul [...]
-//# sourceMappingURL=bootstrap.bundle.min.js.map
\ No newline at end of file
+//# sourceMappingURL=bootstrap.bundle.min.js.map
diff --git a/content/js/vendor/foundation.js b/content/js/vendor/foundation.js
index 0265fff..2b50b69 100644
--- a/content/js/vendor/foundation.js
+++ b/content/js/vendor/foundation.js
@@ -9121,4 +9121,4 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
 
   // Window exports
   Foundation.plugin(Tooltip, 'Tooltip');
-}(jQuery);
\ No newline at end of file
+}(jQuery);
diff --git a/content/js/vendor/foundation.min.js b/content/js/vendor/foundation.min.js
index a6f5521..f0cbe8b 100644
--- a/content/js/vendor/foundation.min.js
+++ b/content/js/vendor/foundation.min.js
@@ -1 +1 @@
-function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}!function(t){"use strict";function e(t){if(void 0===Function.prototype.name){var e=/function\s([^(]{1,})\(/,n=e.exec(t.toString());return n&&n.length>1?n[1].trim():""}return void 0===t.prototype?t.constructor.name:t.prototype.constructor.name}function n(t){return/true/.test(t)?!0:/false/.test(t)?!1:isNaN(1*t)?t:parseFloat(t)}function i(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2") [...]
\ No newline at end of file
+function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}!function(t){"use strict";function e(t){if(void 0===Function.prototype.name){var e=/function\s([^(]{1,})\(/,n=e.exec(t.toString());return n&&n.length>1?n[1].trim():""}return void 0===t.prototype?t.constructor.name:t.prototype.constructor.name}function n(t){return/true/.test(t)?!0:/false/.test(t)?!1:isNaN(1*t)?t:parseFloat(t)}function i(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2") [...]
diff --git a/content/pages/platform.md b/content/pages/platform.md
index 939c554..c072aa5 100644
--- a/content/pages/platform.md
+++ b/content/pages/platform.md
@@ -128,5 +128,3 @@ Note: this section is a flexible outline of what we intend for the UI, and may c
 6. Page Template
    - Responsive with Header(Hamburger)/Content/Footer.
    - Include Search in Header(Hamburger)
-
-
diff --git a/content/pages/trusted-release.md b/content/pages/trusted-release.md
index 3478d71..5041df7 100644
--- a/content/pages/trusted-release.md
+++ b/content/pages/trusted-release.md
@@ -79,4 +79,3 @@ The main project is the Apache Trusted Release Platform.
      > There are policy implications to the automation of digital signatures.
      > For now, creating digital signatures on certain artifact types must be done prior to GPG signing and
      > prior to submission of the release candidate.
-
diff --git a/content/pages/volunteer.md b/content/pages/volunteer.md
index 1a59698..c395a69 100644
--- a/content/pages/volunteer.md
+++ b/content/pages/volunteer.md
@@ -14,4 +14,3 @@ There are some basic things you could do if you're going to help out with the AS
   - Discuss policy clarifications and other difficult issues including moving questions and proposals to the appropriate place.
 
 **Come talk to us on [Slack](https://the-asf.slack.com/) in the #tooling-discuss channel!**
-
diff --git a/content/theme/templates/blog.html b/content/theme/templates/blog.html
index af4db2c..5890af4 100644
--- a/content/theme/templates/blog.html
+++ b/content/theme/templates/blog.html
@@ -24,4 +24,3 @@
     </body>
     </html>
 {% endblock %}
-
diff --git a/content/theme/templates/styles.html b/content/theme/templates/styles.html
index 4280454..bddec6a 100644
--- a/content/theme/templates/styles.html
+++ b/content/theme/templates/styles.html
@@ -28,4 +28,3 @@
       margin-top: 5px;
   }
 </style>
-
diff --git a/pagefind.sh b/pagefind.sh
index bf6bc22..283b5dc 100755
--- a/pagefind.sh
+++ b/pagefind.sh
@@ -51,4 +51,3 @@ fi
 
 echo "Running pagefind on ${PELICAN_OUTPUT_PATH}"
 ${PAGEFIND} --site ${PELICAN_OUTPUT_PATH} --output-subdir "_pagefind"
-
diff --git a/pelicanconf.py b/pelicanconf.py
index a91adf4..f6788f1 100644
--- a/pelicanconf.py
+++ b/pelicanconf.py
@@ -69,6 +69,3 @@ ASF_POSTRUN = [ '/bin/bash pagefind.sh',  ]
 # Configure ignore files
 # File and directory basenames matching any of these patterns will be ignored by the processor.
 IGNORE_FILES = [ 'theme',  ]
-
-
-


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org