Skip to content

Commit 79a0bff

Browse files
authored
Merge pull request #757 from hasezoey/lintPr
Lint PR Commit style
2 parents 17e77e0 + bab2641 commit 79a0bff

3 files changed

Lines changed: 61 additions & 1 deletion

File tree

.github/workflows/check-pr.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Not run as part of pre-commit checks because they don't handle sending the correct commit
2+
# range to `committed`
3+
name: Check PR Style
4+
on: [pull_request]
5+
6+
permissions:
7+
contents: read
8+
9+
env:
10+
RUST_BACKTRACE: 1
11+
CARGO_TERM_COLOR: always
12+
CLICOLOR: 1
13+
14+
concurrency:
15+
group: "${{ github.workflow }}-${{ github.ref }}"
16+
cancel-in-progress: true
17+
18+
jobs:
19+
committed:
20+
name: Lint Commits
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout Actions Repository
24+
uses: actions/checkout@v7
25+
with:
26+
fetch-depth: 0
27+
- name: Lint Commits
28+
uses: crate-ci/committed@faeed42f2e10c244533a01525f13c4d8b6ce383f # v1.1.11

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ Specifically, we use:
4848
1. For types:
4949
- `feat`: Feature work, which would not fall into `refactor`, `fix` or `style`.
5050
- `fix`: A minor fix, which does not change much overall.
51-
- `refactor`: A Code refactor that does not change the observable behavior of the code.
51+
- `perf`: A change that does not change the observable behavior and is a performance fix.
52+
- `refactor`: A Code refactor that does not change the observable behavior of the code. (except performance changes)
5253
- `style`: A style only change. (ex. `cargo clippy --fix`)
5354
- `deps`: A Dependency update. (includes updates necessary for breaking dependency updates)
5455
- `docs`: Documentation update. (ex. for `README`; code should use `style` instead)

committed.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# We currently dont enforce a subject or line length
2+
subject_length = 0
3+
hard_line_length = 0
4+
line_length = 0
5+
# We dont require the subject to be capitalized (automatically done in changelog generation)
6+
subject_capitalized = false
7+
# Subject lines are a headlines, they dont need punctuation
8+
subject_not_punctuated = true
9+
# For now, allow all subject writing
10+
imperative_subject = false
11+
# dont allow "!fixup" commits
12+
no_fixup = true
13+
# dont allow commits that contain "WIP"
14+
no_wip = true
15+
# We use merge commits; disabled for PRs though
16+
merge_commit = true
17+
style = "conventional"
18+
allowed_types = [
19+
"fix",
20+
"feat",
21+
"chore",
22+
"docs",
23+
"style",
24+
"refactor",
25+
"perf",
26+
"test",
27+
"deps",
28+
"revert",
29+
"merge",
30+
]
31+
allowed_scopes = []

0 commit comments

Comments
 (0)