conventional-commits / conventionalcommits.org

The conventional commits specification
https://conventionalcommits.org
MIT License
7k stars 539 forks source link

What to use when you remove code? #469

Open holytshirt opened 2 years ago

holytshirt commented 2 years ago

There is no guidance on what to use when you removal code that is no longer needed. From googling around the best suggestion I could find was refactor(Acme)!: Remove ACME integration

But this irks me as it goes against the meaning of refactor, which is to tidy code without altering functionality.

It feels like there is something missing like delete(): or del(): or something like that. Would really like some idea and find out what other people are using?

dsbert commented 2 years ago

Seems like this is contextual. If you are removing something that's non-breaking, that could be a chore. If you are deprecating something, you haven't actually remove it yet... and if you are removing a deprecated feature, it's a breaking change and there's not a great recommendation for that. Each of these three things seems like they should be represented by a different type of action.

shadoath commented 5 months ago

I would second this idea. Some additional options would help when reviewing a PR that has the specific point to remove code.

javier-godoy commented 5 months ago

I had the same discussion with colleagues some time ago, and we settled on remove (although we hardly ever use it)

daniel-albuschat commented 2 months ago

Hello!

The discussion on what to use when removing features is something that comes up more often than you would think. And the consens is.... that there is no consens.

See, for example: https://stackoverflow.com/questions/48075169/semantic-commit-type-when-remove-something

All answers here suggest "refactor", which I personally don't think is good. "refactor", in my understand, is a change to the code that does not change the API or behaviour (in a notable way). Some comments or remarks inside the answers argue the same.

I could see two solutions for this:

1) "feat:" is also used for removing features, and this is described in the spec 2) A new scope, such as "remove:", is introduced, which would bump conventional commits to v1.1.0

I'd reallly appreciate to hear the opinions of the maintainers.

Daniel

btw.: ChatGPT - at least for me - suggested to use "feat:" when removing feature.