-
Notifications
You must be signed in to change notification settings - Fork 909
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
subject-case rule breaks ConventionalCommits spec #2141
Comments
Looks like this should be updated: https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#subject-case For now you could change the subject-case rule in your own config. |
I this true also of Is the wording implying that |
I guess so? Although all their examples are showing non-mixed-cases. Would it be possible to allow
If it's referring to this part I think it means everything? |
I guess my point being that (ignoring the silly spongebob case) should we be enforcing |
I guess that's a yes for "the user input the case however they want". I feel like we should enforce some sort of consistency otherwise people will end up with changelogs saying, i.e.:
That can't be what people would expect from commitlint, right? |
Agreed, I think the default config should set some standard, as you mentioned above you can tailor the plugins to behave in a certain way. I think we should enforce |
@mrmartan we tend to close this. |
I tend to disagree. I see your point but raise that with the spec itself. All implementors are expected to conform to it. Otherwise problems arise in heterogenous environments. That's in fact how we arrived here. One tool in one part of the system would be ok with At least make the casing rules opt-in instead of opt-out. As for consistency, the spec itself argues for consistency but does not presume what that should be. https://www.conventionalcommits.org/en/v1.0.0/#are-the-types-in-the-commit-title-uppercase-or-lowercase There is a more demanding solution. You could pickup the preferred style from the commits themselves and make them self-consistent on contrary to all lower-case. I can imagine the inconsistencies, in type and scope in particular, could cause trouble down the line if other plugins/tool are not case-insensitive, e.g. release notes generators. |
So I have tried disabling the case-sensitvity rules. The |
We've been having a bit of a discussion about this one in Slack and can appreciate where you are coming from. I think (internally) there is a consensus for us to provide some basic and generally adopted opinionated defaults, as we do now, based on the conventional changelog format. However we do appreciate that some users might want something that matches the spec but is less opinionated. I'm not sure how this will turn out in practice yet. One suggestion was relaxing the rules on the current configuration and also supplying a I guess we would have to discuss how that affects documentation and onboarding because we already get questions about trying to streamline setup and two configs might be confusing for users. EDIT: @escapedcat a change like this would also be considered a breaking change I guess if we loosen or change config values as current users may expect Thoughts @mrmartan? |
Well, from my POV @commitlint/config-conventional was from the start about setting up rules conforming to the standard. So when it does not, I see it as a bug and any change to make it conform does not break the original contract. Which strictly speaking means also removing the |
I found this issue because I came here to report that The conventional commits FAQ does recommend keeping a consistent case:
I like the point that people using commitlint expect extra consistency - what about having two rule sets:
Edit: I'm happy to put together a PR if you like the two rulesets approach. |
@TimothyJones hey thanks for your offer. |
It depends on how many rules we are making opinions on. If it's just this one, then I think It's OK to enforce this rule and let the user override it if they want to use a different case. From the comments of
We are adding a rule, so there must be a rule for the case of the message, and setting it to
I think this could be a bigger issue and if we are doing down the road of 100% spec, we work with the team making the spec to come up with a test suite like json-patch and then any project can implement that test suite to comply to the spec. |
For me, the issue is that we don’t want to bikeshed the rules within the team, we want to just adopt the ones from conventional-commits. It would be nice if we can do that by using an existing config. So, we found the However, that package implements the conventional commits rules, plus some extra ones. Pragmatically, as you point out, we can override those bits, but this means it’s less easy to have the same config everywhere (unless we publish It’s also concerning as a user- because if the rules here are the spec plus some modifications, where else do the rules differ, and how do we know? It’s much easier to trust a lint package named after a specification if it only implements the rules from that specification. |
[subject-case rule breaks ConventionalCommits spec · Issue #2141 · conventional-changelog/commitlint](conventional-changelog/commitlint#2141)
My team recently adopted this and are finding pain that the package doesn't follow conventional commits specification. We will be adding overrides. As this package advertises itself as following the spec, it probably shouldn't get opinionated about these things. Specifically casing and length were the issues for us. |
This will allow to start subjects from uppercase words. Currently it fails on something like: ``` fix: Gitlab CI pipeline fixed build: CMake sets wrong Synfig Studio/ETL versions ``` P.S. This change does not violate the standard. Discussion here: conventional-changelog/commitlint#2141 P.P.S. Puppeteer did the same: https://github.com/puppeteer/puppeteer/pull/8091/files
This will allow to start subjects from uppercase words. Currently it fails on something like: ``` fix: Gitlab CI pipeline fixed build: CMake sets wrong Synfig Studio/ETL versions ``` P.S. If I understand correctly, this change does not violate the standard. Discussion here: conventional-changelog/commitlint#2141 P.P.S. Puppeteer did the same: https://github.com/puppeteer/puppeteer/pull/8091/files
This will allow to start subjects from uppercase words. Currently it fails on something like: ``` fix: Gitlab CI pipeline fixed build: CMake sets wrong Synfig Studio/ETL versions ``` P.S. If I understand correctly, this change does not violate the standard. Discussion here: conventional-changelog/commitlint#2141 P.P.S. Puppeteer did the same: https://github.com/puppeteer/puppeteer/pull/8091/files
An obvious use case that confirms to the spec, but is rejected by this implementation:
I fully agree with previous commenters that while commitlint has every right to provide an opinionated stance, such as via a config called |
Realistically, I don't think we're ever going to see this fixed. It's been 3.5 years and is still open. The current maintainers are happy to advertise the factually correct but drastically misleading statement below, while also leaving this ticket open knowing they have added their own rules in. Anyone following this shouldn't really hold their breath. It will be faster and easier to implement your own rules to move it close to the spec, than it will be to wait for this package to follow the spec.
|
@commitlint/config-conventional subject-case rule breaks ConventionalCommits spec
Expected Behavior
From https://www.conventionalcommits.org/en/v1.0.0/#specification
Current Behavior
Affected packages
Possible Solution
Remove the casing rule
The text was updated successfully, but these errors were encountered: