You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to configure and assert errors of specific types/scopes to code changes in the PR diff.
For instance, if I have a PR with docs: as the type/scope I want to ensure this is only applied when the PR contains changes only to the documentation, that is, a list of files or dirs.
Why
Users will create PRs with fix: type, but really they're updating some CI, Tests or Docs which should be captured under ci:, tests: or docs: types. This is important with Changelogs generated from semantic commits, helping stop erroneous Changelog entries. It would be useful to assert these types of requirements to remove human error when approving PRs with incorrect semantic types. I often make mistakes when reviewing simple PRs, only noticing my mistakes afterwards 😅
Example
An example of what this would look like in configuration:
So from this config, PRs with changes only in docs/* or README.md can then only have the docs: type applied. If it has a different type it errors, or if it has changes in the specified paths and elsewhere it is up to the Reviewer to validate the semantic type.
Title/commit: "fix: typo in docs"
Files changed:
- docs/index.md
Wrong type for changes in Paths. Should have type of docs:, found fix:
Failure PR:
Title/commit: "fix: typo in ci pipeline"
Files changed:
- .github/workflows/test.yml
Wrong type for changes in Paths. Should have Type of ci:, found fix:
More changes detected
If changes occur in more than one of the typeWhenOnlyPaths then the rules are ignored, they only apply when ONLY those paths are present.
Success PR:
Title/commit: "fix: typo in ci pipeline"
Files changed:
- .github/workflows/test.yml
- docs/index.md
No rules under typeWhenOnlyPaths match, so the fix: type cannot be asserted by this configuration. Now we must rely on humans.
Caveats
This is useful for avoiding simple issues, but doesn't help classify changes to multiple areas of the code at once. More complex changes generally must be reviewed more thoroughly, so complex changes aren't subject to the same simple errors I would like to capture with this type of feature.
Urgency
Nice to have.
Thanks for the great GitHub Action 👏
The text was updated successfully, but these errors were encountered:
What
I would like to configure and assert errors of specific types/scopes to code changes in the PR diff.
For instance, if I have a PR with
docs:
as the type/scope I want to ensure this is only applied when the PR contains changes only to the documentation, that is, a list of files or dirs.Why
Users will create PRs with
fix:
type, but really they're updating some CI, Tests or Docs which should be captured underci:
,tests:
ordocs:
types. This is important with Changelogs generated from semantic commits, helping stop erroneous Changelog entries. It would be useful to assert these types of requirements to remove human error when approving PRs with incorrect semantic types. I often make mistakes when reviewing simple PRs, only noticing my mistakes afterwards 😅Example
An example of what this would look like in configuration:
So from this config, PRs with changes only in
docs/*
orREADME.md
can then only have thedocs:
type applied. If it has a different type it errors, or if it has changes in the specified paths and elsewhere it is up to the Reviewer to validate the semantic type.Success PR:
Failure PR:
Wrong
type
for changes in Paths. Should havetype
ofdocs:
, foundfix:
Failure PR:
Wrong
type
for changes in Paths. Should have Type ofci:
, foundfix:
More changes detected
If changes occur in more than one of the
typeWhenOnlyPaths
then the rules are ignored, they only apply when ONLY those paths are present.Success PR:
No rules under
typeWhenOnlyPaths
match, so thefix:
type cannot be asserted by this configuration. Now we must rely on humans.Caveats
This is useful for avoiding simple issues, but doesn't help classify changes to multiple areas of the code at once. More complex changes generally must be reviewed more thoroughly, so complex changes aren't subject to the same simple errors I would like to capture with this type of feature.
Urgency
Nice to have.
Thanks for the great GitHub Action 👏
The text was updated successfully, but these errors were encountered: