Skip to content

Commit 39a246b

Browse files
authored
gha: add pre-commit with about 15 hooks (#27)
Run pre-commit to auto fix linter errors
1 parent 69e8678 commit 39a246b

File tree

17 files changed

+68
-19
lines changed

17 files changed

+68
-19
lines changed

.asf.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,3 @@ notifications:
2929
3030
3131
pullrequests: [email protected]
32-

.github/workflows/pre-commit.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# https://pre-commit.com/
2+
name: Lint
3+
4+
on: [pull_request]
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
pre-commit:
11+
name: Run pre-commit
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
- name: Install
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install pre-commit
20+
- name: Set PY
21+
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> "$GITHUB_ENV"
22+
- uses: actions/cache@v4
23+
with:
24+
path: ~/.cache/pre-commit
25+
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
26+
- name: Run pre-commit
27+
run: pre-commit run --all-files

.pre-commit-config.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
# https://pre-commit.com/
3+
default_stages: [pre-commit, pre-push]
4+
default_language_version:
5+
# force all unspecified Python hooks to run python3
6+
python: python3
7+
minimum_pre_commit_version: "3.2.0"
8+
repos:
9+
- repo: meta
10+
hooks:
11+
- id: identity
12+
name: run identity
13+
description: check your identity
14+
- id: check-hooks-apply
15+
name: run check-hooks-apply
16+
description: check hooks apply to the repository
17+
- repo: https://github.com/pre-commit/pre-commit-hooks
18+
rev: v5.0.0
19+
hooks:
20+
- id: check-ast
21+
- id: check-case-conflict
22+
- id: check-executables-have-shebangs
23+
- id: check-illegal-windows-names
24+
- id: check-merge-conflict
25+
- id: check-shebang-scripts-are-executable
26+
- id: check-vcs-permalinks
27+
- id: check-yaml
28+
- id: detect-private-key
29+
- id: end-of-file-fixer
30+
- id: fix-byte-order-marker
31+
- id: forbid-submodules
32+
- id: mixed-line-ending
33+
- id: requirements-txt-fixer
34+
files: ^requirements\.txt$
35+
- id: trailing-whitespace
36+
args: [--markdown-linebreak-ext=md]
37+
exclude: \.svg$

apache-trusted-release/platform.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,3 @@ Note: this section is a flexible outline of what we intend for the UI, and may c
124124
6. Page Template
125125
- Responsive with Header(Hamburger)/Content/Footer.
126126
- Include Search in Header(Hamburger)
127-
128-

apache-trusted-release/requirements.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,3 @@ While reading consider these Notes:
8181
> There are policy implications to the automation of digital signatures.
8282
> For now, creating digital signatures on certain artifact types must be done prior to GPG signing and
8383
> prior to submission of the release candidate.
84-

content/css/bootstrap.min.css

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

content/css/foundation.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

content/js/bootstrap.bundle.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

content/js/vendor/foundation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9121,4 +9121,4 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
91219121

91229122
// Window exports
91239123
Foundation.plugin(Tooltip, 'Tooltip');
9124-
}(jQuery);
9124+
}(jQuery);

content/js/vendor/foundation.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)