Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for cutting-lines and footers with blank lines #274

Merged
merged 5 commits into from
Jan 9, 2024

Conversation

KevinDeJong-TomTom
Copy link
Collaborator

This PR introduces a few features and improvements, incl:

Ensure that unexpected exceptions are no longer caught

Originally we would catch all exceptions thrown in the validate,
bump, and CLI execution. As a result, the action will ignore certain
failures and, in case of bump, continue as if nothing went wrong
(but also without the associated bump).

Support for cutting-lines

Cutting lines (--------), as inserted by GitHub in certain merge strategies, would be considered as a paragraph.

In example:

feat: remove logout button

BREAKING-CHANGE: this removes the logout button as we want
  all users to be trapped in this application

--------

co-authored-by: Bob the Builder

This would originally result in only the co-authored-by trailer
to be accepted, dropping the BREAKING CHANGE flag (and therefor
only bumping the MINOR version).

This change will ignore the cutting-line and consider both elements
in the above example as valid trailers.

NOTE: the cutting-line is the only exception, any other paragraph
entry will still discard previous git-trailers; i.e.

feat: remove logout button

BREAKING-CHANGE: this removes the logout button as we want
  all users to be trapped in this application

--------

This parapgraph causes the BREAKING-CHANGE to be discarded

co-authored-by: Bob the Builder

Add --verbose option to the CLI to pretty print commits

Running the check command with the --verbose-flag will provide more details about the commit message:
image

@github-actions github-actions bot added bump:minor Pull Requests that update the Minor SemVer version after merging initial development labels Dec 7, 2023
src/config.ts Outdated Show resolved Hide resolved
src/config.ts Show resolved Hide resolved
src/interfaces.ts Show resolved Hide resolved
src/rules.ts Show resolved Hide resolved
src/validate.ts Show resolved Hide resolved
src/validate.ts Show resolved Hide resolved
@KevinDeJong-TomTom KevinDeJong-TomTom changed the title Chore/eslint configuration feat: add support for cutting-lines and footers with blank lines Dec 7, 2023
Copy link
Collaborator

@jstmlr jstmlr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly minor whiny things, except for the shallowish copy in src/bump.ts, which I fear will not behave how you expect it to.

docs/cli.md Outdated Show resolved Hide resolved
docs/cli.md Outdated Show resolved Hide resolved
src/actions/validate.ts Outdated Show resolved Hide resolved
src/config.ts Outdated Show resolved Hide resolved
src/bump.ts Outdated Show resolved Hide resolved
src/cli/cli.ts Outdated Show resolved Hide resolved
src/cli/cli.ts Show resolved Hide resolved
src/commit.ts Outdated Show resolved Hide resolved
src/config.ts Show resolved Hide resolved
src/config.ts Show resolved Hide resolved
src/config.ts Outdated Show resolved Hide resolved
In addition, the configuration has been migrated from `.JSON`
to `.XML`, as is the now recommended layout by ESLint
Originally we would catch all exceptions thrown in the validate,
bump, and CLI execution. As a result, the action will ignore certain
failures and, in case of `bump`, continue as if nothing went wrong
(but also without the associated bump).
This commit introduces support for cutting-lines, as inserted
by GitHub in certain merge strategies. In example:

```
feat: remove logout button

BREAKING-CHANGE: this removes the logout button as we want
  all users to be trapped in this application

--------

co-authored-by: Bob the Builder
```

This would originally result in only the `co-authored-by` trailer
to be accepted, dropping the `BREAKING CHANGE` flag (and therefor
only bumping the MINOR version).

This change will ignore the cutting-line and consider both elements
in the above example as valid trailers.

NOTE: the cutting-line is the only exception, any other paragraph
      entry will still discard previous git-trailers; i.e.

```
feat: remove logout button

BREAKING-CHANGE: this removes the logout button as we want
  all users to be trapped in this application

--------

This parapgraph causes the BREAKING-CHANGE to be discarded

co-authored-by: Bob the Builder
```
@KevinDeJong-TomTom KevinDeJong-TomTom merged commit bef8904 into master Jan 9, 2024
7 checks passed
@KevinDeJong-TomTom KevinDeJong-TomTom deleted the chore/eslint-configuration branch January 9, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump:minor Pull Requests that update the Minor SemVer version after merging initial development
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants