- Shell 90.6%
- JavaScript 9.4%
Bumps [actions/github-script](https://github.com/actions/github-script) from 8 to 9. - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/v8...v9) --- updated-dependencies: - dependency-name: actions/github-script dependency-version: '9' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> |
||
|---|---|---|
| .githooks | ||
| .github | ||
| assets | ||
| src | ||
| action.yml | ||
| LICENSE | ||
| README.md | ||
HyperStickler
Commit & PR formalities checker based on the OpenWrt submission guidelines.
Rules
- Pull request must come from a feature branch. Configured via the
check_branchinput. - 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. Configured via thecheck_signoffinput.Signed-off-bymust not be a GitHub noreply email. Configured 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.
Inputs
All inputs are optional.
check_branch
- Check if pull request comes from a feature branch.
- Default:
true.
check_signoff
- Check if
Signed-off-byexists and matches author. - Default:
false.
exclude_dependabot
- Exclude commits authored by dependabot from some checks.
- Default:
true.
exclude_weblate
- Exclude commits authored by Weblate from some checks.
- Default:
false.
feedback_url
- URL to provide feedback to. If empty, no feedback text will be added to either console log or comment.
- Default: HyperStickler repository.
guideline_url
- Submission guideline URL used in PR comments.
- Default: https://www.kernel.org/doc/html/latest/process/submitting-patches.html
job_step
- 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_len
- Max body line length. Longer lines result in a warning.
- Default: 75.
max_subject_len_hard
- Hard max subject line length limit. Longer subjects fails check.
- Default: 60.
max_subject_len_soft
- Soft max subject line length limit. Longer subjects result in a warning.
- Default: 50.
post_comment
- Post summaries to the pull request.
- Default:
false.
warn_on_no_modify
- Warn when PR edits by maintainers are not allowed. Requires
post_commentto betrue. - Default:
false.
Permissions
Posting comments requires pull-requests: write.
Example usage
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: true
Example output
Example status comment
Warning
Some formality checks failed.
Consider (re)reading submissions guidelines.
Failed 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 <hosted@weblate.org>
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 <good.author@example.com>
Commit 5f4c710
-
❌
Signed-off-bymust match authorActual: missing or doesn't match author
Expected:
Signed-off-by: Good Author <good.author@example.com>
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
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/repo
License
GNU General Public License v2.0 only
