Comments (5)
Interesting find, TIL that git doesn’t ignore the commentChar when using -m
.
This indeed warrants a new option, I’m thinking general.ignore-comment-char
. I suspect this is an edge case not many users hit, so I think defaulting to false
to maximize backwards compatibility makes sense.
Also, while we might be able to auto-set this option (i.e. true
when reading from the repo or stdin, false
when specifying --msg-filename
), this would require us to allow this option to be set to auto
, which no other option in gitlint accepts today. i.e. this would require some extra work to introduce an AutoOption
type, which is an interesting thought but going beyond the scope of this issue.
Are you interested in contributing code for this?
2 parts to this:
- Add new
ignore-comment-char
option - Using the option in the code to get the right behavior
Everything will require tests and docs.
from gitlint.
This indeed warrants a new option, I’m thinking general.ignore-comment-char. I suspect this is an edge case not many users hit, so I think defaulting to false to maximize backwards compatibility makes sense.
If I understand correctly, the option should default to true
.
Are you interested in contributing code for this?
I'm not sure, if I'm going to have time for this soon, but yes.
from gitlint.
If I understand correctly, the option should default to true.
You're right!
I'm not sure, if I'm going to have time for this soon, but yes.
Ok, let me know!
from gitlint.
I have looked into this a little bit and I don't think I can figure this out on my own:
- I found the code which removes lines starting with the commentchar in the GitCommitMessage class. However, I don't know how to propagate the cli flag all the way from the cli parser to there.
- I tried searching for the tests that test command line arguments and it seems to me that it's done in
test_cli.py
. I don't usually code in Python and don't have any experience in Python testing, so the test is very confusing to me, and I'm not sure where to start (for example, how to make a simple assertion that the program at least accepts the option).
I'm still open to coding this, but it won't be an easy thing for me, meaning that it'll take me a while to figure this out (and I probably won't be able to progress without some guidance).
from gitlint.
Thanks for having a look!
Sounds like it would be a fairly long back-and-forth on this (totally understandable given you usually don't code in Python), in which case I prefer to keep this as-is because I'm limited on available time myself.
I'll probably implement this at some point, just can't commit to a timeline :-)
from gitlint.
Related Issues (20)
- Ability to have user-defined rules disabled by default HOT 2
- gitlint raises an exception if run without --staged and with an ignore-by-author-name configuration HOT 3
- Support for per-user configuration files and configuration inheritance HOT 9
- Ignore stdin by default in CI HOT 7
- Feature request: generate a junit or sarif report HOT 4
- Allow several --extra-path HOT 1
- v0.19.0dev tag should not be on the default branch HOT 7
- gitlint and gitlint-core v0.19.0 fail to build from sdist HOT 13
- 0.20.0 Release Plan
- Enable support for git archive installs HOT 7
- Consider adopting pypi-publish GHA instead of hatch publish
- Adopt GHA environments HOT 1
- Refactor GHA pipelines for improved security HOT 4
- Investigate smoke testing of sdist package for downstream packaging HOT 3
- Full workflow example for fixing a previously rejected commit message HOT 2
- installing hook on pre-commit fails with newest virtualenv (>20.24.5) present HOT 15
- Forever violations even after being edited HOT 2
- Poetry version solving failure
- Failed to install the `pre-commit` hook HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gitlint.