Commit & PR formalities checker based on the OpenWrt submission guidelines.
- Pull request must come from a feature branch
- Pull request must not include merge commits
- Author name must be either a real name 'firstname lastname' or a nickname/alias/handle
- Author email must not be a GitHub noreply email
- Commit(ter) name must be either a real name 'firstname lastname' or a nickname/alias/handle
- Commit(ter) email must not be a GitHub noreply email
- Commit subject must not start with whitespace
- Commit subject must start with
<package name or prefix>: - Commit subject must start with a lower-case word after the prefix
- Commit subject must not end with a period
- Commit subject must be <=
MAX_SUBJECT_LEN_HARD(and should be <=MAX_SUBJECT_LEN_SOFT) characters long. Limits are 60 and 50 by default, respectively and are configurable via themax_subject_len_hardandmax_subject_len_softinputs. Signed-off-bymust match author. Enabled via thecheck_signoffinput.Signed-off-bymust not be a GitHub noreply email. Enabled via thecheck_signoffinput.- Commit message must exist
- Commit message lines should be <=
MAX_BODY_LINE_LENcharacters long. Limit is 75 by default and is configurable via themax_body_line_leninput. - Commit to stable branch should be marked as cherry-picked
All inputs are optional.
- Check if
Signed-off-byexists and matches author. - Default:
false.
- Exclude commits authored by dependabot from some checks.
- Default:
true.
- Exclude commits authored by Weblate from some checks.
- Default:
false.
- URL to provide feedback to. If empty, no feedback text will be added to either console log or comment.
- Default: HyperStickler repository.
- Submission guideline URL used in PR comments.
- Default: https://www.kernel.org/doc/html/latest/process/submitting-patches.html
- Job step number that full log link in comment should point to. Otherwise it
will point to the job itself. Requires
post_commentto betrue.
- Max body line length. Longer lines result in a warning.
- Default: 75.
- Hard max subject line length limit. Longer subjects fails check.
- Default: 60.
- Soft max subject line length limit. Longer subjects result in a warning.
- Default: 50.
- Post summaries to the pull request.
- Default:
false.
- Warn when PR edits by maintainers are not allowed. Requires
post_commentto betrue. - Default:
false.
Posting comments requires pull-requests: write.
name: Formalities
on:
pull_request_target:
permissions:
pull-requests: write
jobs:
formal:
runs-on: ubuntu-slim
name: Formalities
steps:
- name: Check formalities
uses: georgesapkin/hyperstickler@main
with:
check_signoff: true
exclude_weblate: true
post_comment: trueFailed checks
Issues marked with an ❌ are failing checks.
Commit 57b3864
-
❌ Commit subject must start with
<package name or prefix>: -
❌
Signed-off-bymust match authorActual: missing or doesn't match author
Expected:
Signed-off-by: Hosted Weblate <[email protected]>
Commit 5058449
-
🔶 Commit message lines should be <= 75 characters long
Actual: line 1 is 137 characters long
$\textsf{This line in the commit body is extremely long and should definitely exceed\color{red}{ the seventy-five character limit imposed by the check script.}}$
Commit 2e99bff
-
🔶 Commit subject must be <= 60 (and should be <= 50) characters long
Actual: subject is 58 characters long
$\textsf{package: this subject is long and should trigger a\color{yellow}{ warning}\color{red}{}}$
Commit fed351d
-
🔶 Author name must be either a real name 'firstname lastname' or a nickname/alias/handle
Actual: Nickname seems to be a nickname or an alias
Expected: a real name 'firstname lastname'
Commit 5130080
- ❌ Commit message must exist
Commit d13201a
-
❌
Signed-off-bymust match authorActual: missing or doesn't match author
Expected:
Signed-off-by: Good Author <[email protected]>
Commit 5f4c710
-
❌
Signed-off-bymust match authorActual: missing or doesn't match author
Expected:
Signed-off-by: Good Author <[email protected]>
Commit b26caff
-
❌ Commit subject must be <= 60 (and should be <= 50) characters long
Actual: subject is 86 characters long
$\textsf{package: this subject is way too long and should f\color{yellow}{ail the ha}\color{red}{rd limit check of 60 chars}}$
Commit d6ffd3d
- ❌ Commit subject must not end with a period
Commit bb7a6f8
- ❌ Commit subject must start with a lower-case word after the prefix
Commit 0f2c7e8
- ❌ Commit subject must start with
<package name or prefix>:
Commit f7d3b13
- ❌ Commit subject must not start with whitespace
- ❌ Commit subject must start with
<package name or prefix>:
Commit ff3950e
-
❌ Author email must not be a GitHub noreply email
Expected: a real email address
-
❌
Signed-off-bymust not be a GitHub noreply emailExpected: a real email address
For more details, see the full job log.
Something broken? Consider providing feedback.
Tests use /tmp to create a temporary git repository in. Otherwise an
alternative test path can be passed to the test script that will be created
before running tests and removed afterwards.
src/test.sh /optional/path/to/test/repoGNU General Public License v2.0 only
