Skip to content

Commit 3399153

Browse files
authored
add more pre-commit configs (#5457)
Signed-off-by: Junpu Fan <junpu@amazon.com>
1 parent dd9a064 commit 3399153

File tree

8 files changed

+67
-15
lines changed

8 files changed

+67
-15
lines changed

.github/scripts/runner_setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ set -e
33

44
curl -LsSf https://astral.sh/uv/install.sh | UV_INSTALL_DIR="/usr/local/bin" sh
55
uv self update
6-
docker --version
6+
docker --version

.github/workflows/pre-commit.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
pre-commit:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v5
20+
- uses: actions/setup-python@v6
21+
with:
22+
python-version: "3.12"
23+
- uses: pre-commit/action@v3.0.1
24+
with:
25+
extra_args: --all-files

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
__pycache__
33
.idea
44
*.pyc
5-
.venv
5+
.venv

.markdownlint.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"MD013": false, // disable line-length limit
33
"MD033": false, // allow inline HTML
44
"MD041": false // allow first line not being top level
5-
}
5+
}

.pre-commit-config.yaml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,38 @@ default_stages:
77
- manual
88

99
repos:
10+
# - repo: https://github.com/reteps/dockerfmt
11+
# # run `pre-commit autoupdate` to pin the version
12+
# rev: main
13+
# hooks:
14+
# - id: dockerfmt
15+
# args:
16+
# # optional: add additional arguments here
17+
# - --indent=2
18+
# - --write
19+
# - repo: https://github.com/rhysd/actionlint
20+
# rev: v1.7.7
21+
# hooks:
22+
# - id: actionlint
23+
- repo: https://github.com/scop/pre-commit-shfmt
24+
rev: v3.12.0-2 # Use the latest stable revision
25+
hooks:
26+
- id: shfmt
27+
# Optional: Add arguments to shfmt if needed, e.g., to enable "simplify" mode
28+
args: ["-s"]
1029
- repo: https://github.com/crate-ci/typos
1130
rev: v1.38.1
1231
hooks:
1332
- id: typos
1433
args: [--force-exclude]
34+
- repo: https://github.com/hukkin/mdformat
35+
rev: 1.0.0 # Use the ref you want to point at
36+
hooks:
37+
- id: mdformat
38+
# Optionally add plugins
39+
additional_dependencies:
40+
- mdformat-gfm
41+
- mdformat-black
1542
- repo: https://github.com/igorshubovych/markdownlint-cli
1643
rev: v0.45.0
1744
hooks:
@@ -36,4 +63,4 @@ repos:
3663
fi
3764
language: system
3865
verbose: true
39-
stages: [commit-msg]
66+
stages: [commit-msg]

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
# Contributing Guidelines
22

3-
We appreciate your interest in this project.
3+
We appreciate your interest in this project.\
44
At this time, **we are not accepting external contributions** (including pull requests or new feature submissions).
55

6-
Our team is still in the early stages of establishing contribution workflows, code ownership, and testing standards.
6+
Our team is still in the early stages of establishing contribution workflows, code ownership, and testing standards.\
77
Once we are ready to open the project for community participation, we will announce it publicly and update this document with detailed contribution procedures.
88

99
In the meantime:
1010

11-
- You are welcome to **open issues** for **bug reports, questions, or feedback**.
11+
- You are welcome to **open issues** for **bug reports, questions, or feedback**.\
1212
Please keep issue reports focused and include relevant context (environment, version, steps to reproduce, etc.).
1313
- Please **do not open pull requests** — they will be closed without review until contribution is re-enabled.
1414
- Security issues should continue to be reported through the [AWS/Amazon Security vulnerability reporting page](https://aws.amazon.com/security/vulnerability-reporting/).
1515

16-
---
16+
______________________________________________________________________
1717

1818
## Code of Conduct
1919

20-
This project follows the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
21-
For more information, see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
20+
This project follows the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).\
21+
For more information, see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact\
2222
<opensource-codeofconduct@amazon.com> with questions.
2323

24-
---
24+
______________________________________________________________________
2525

2626
## Licensing
2727

28-
See the [LICENSE](LICENSE) file for licensing information.
28+
See the [LICENSE](LICENSE) file for licensing information.\
2929
When external contributions are accepted, contributors will be asked to confirm license compliance and may be required to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement).

DEVELOPMENT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This document describes how to set up a local development environment, run check
44

55
> 💡 All commands below assume a Unix-like environment (macOS or Linux).
66
7-
---
7+
______________________________________________________________________
88

99
## 1. Environment Setup
1010

@@ -15,7 +15,7 @@ uv venv --python 3.12
1515
source .venv/bin/activate
1616
```
1717

18-
---
18+
______________________________________________________________________
1919

2020
## 2. Linting and Code Style
2121

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ target-version = "py312"
55
[tool.ruff.format]
66
quote-style = "double"
77
indent-style = "space"
8-
line-ending = "lf"
8+
line-ending = "lf"

0 commit comments

Comments
 (0)