danger-js
danger-js copied to clipboard
Parse entire commit message not only first line
Commit-Messages via danger.git.commits
return only the first line and is parsed
- no body
- special chars (like
!
) are removed
What I am trying to achieve are warnings based on file changes in combination with commit guidelines (e.g. breaking changes with conventional commits).
message:
test!: breaking change
- this is the commit body with different "%&&%"§!_" signs
BREAKING-CHANGE:
here are breaking changes. what kind of actions are required?
danger returns:
message: 'test-breaking-change'
I guess is how the message is processed (locally?) https://github.com/danger/danger-js/blob/4100842c8922fa46e975ed772c1eb6ece677ff7e/source/platforms/git/localGetCommits.ts#L17
That part of the codebase is only used in danger local
, for a normal danger ci
or danger pr
it would use the GitHub API: https://github.com/danger/danger-js/blob/4100842c8922fa46e975ed772c1eb6ece677ff7e/source/platforms/github/GitHubGit.ts#L19-L29 which comes from https://github.com/danger/danger-js/blob/4100842c8922fa46e975ed772c1eb6ece677ff7e/source/platforms/github/GitHubAPI.ts#L208-L212
A commit looks like this which doesn't seem too have anything a bit more raw for a full message?
Is this consistent across all VCS?
I don't quite understand why a local commit is handled differently. Is there any difference between local and remote (on any VCS) commits? Honest question because that would be new to me
Everything in the Danger DSL is normally done via an API, with the exception of danger local
which replicates one locally. Danger is built to not just run on CI, so no guarantees of FS access.
Each VCS API (github/gitlab/bitbucket etc) all implements their own Commit API -> GitCommit
code