Code Monkey home page Code Monkey logo

Comments (5)

jorisroovers avatar jorisroovers commented on June 3, 2024

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:

  1. Add new ignore-comment-char option
  2. Using the option in the code to get the right behavior

Everything will require tests and docs.

from gitlint.

syyyr avatar syyyr commented on June 3, 2024

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.

jorisroovers avatar jorisroovers commented on June 3, 2024

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.

syyyr avatar syyyr commented on June 3, 2024

I have looked into this a little bit and I don't think I can figure this out on my own:

  1. 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.
  2. 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.

jorisroovers avatar jorisroovers commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.