-
Notifications
You must be signed in to change notification settings - Fork 102
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
"No commits in range" should be an error #193
Comments
Not the maintainer, but I could see that this would be helpful to have as an flag, e.g., |
I'm always hesitant to change default behavior, as it tends to break gitlint for others. Appreciate your help :-) Please do take a moment to read through the contributing docs before you start. Thanks! |
This only introduces the feature flag in the lint config, the actual functionally still needs to be implemented. Relates to #193
Not actually functional yet, this commit only introduces the CLI flag. Relates to #193
Gitlint will now hard fail when passing an empty commit range via --commits and specifying the --fail-without-commits option. Fixes #193
This only introduces the feature flag in the lint config, the actual functionally still needs to be implemented. Relates to #193
Not actually functional yet, this commit only introduces the CLI flag. Relates to #193
- Python 3.10 support - New Rule: ignore-by-author-name allows users to skip linting commit messages made by specific authors - --commit <SHA> flag to more easily lint a single commit message (#141) - --fail-without-commits flag will force gitlint to fail (exit code 253) when the target commit range is empty (typically when using --commits) (#193) - Bugfixes: - contrib-title-conventional-commits (CT1) now properly enforces the commit type (#185) - contrib-title-conventional-commits (CT1) now supports the BREAKING CHANGE symbol "!" (#186) - Under-the-hood: dependencies updated, test and github action improvements. Full Release details in CHANGELOG.md.
First, thank you for this excellent tool!
GitLab CI pipelines for "ordinary" merge requests do not include a variable with the name of the target branch, which I only realised after running
gitlint --commits "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}..HEAD" --debug
and seeing it print 'DEBUG: gitlint.cli No commits in range "..HEAD"'. I suspect this is a common mistake, and that it should by default be treated as an error. There should probably also be a flag to override this, in case someone is runninggitlint
against references which could legitimately refer to an empty commit range.As a workaround I'm going to keep running this tool in debug mode for now.
I might have time (as part of work, where we use this tool extensively) to implement the change, but I first want to make sure you agree whether this is an issue and whether it should be solved in this or some other way.
The full output:
The text was updated successfully, but these errors were encountered: