What to use when you remove code? #153

Open
opened 2026-02-17 11:50:07 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @holytshirt on GitHub (Aug 18, 2022).

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?

Originally created by @holytshirt on GitHub (Aug 18, 2022). 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?
Author
Owner

@dsbert commented on GitHub (Sep 7, 2022):

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.

@dsbert commented on GitHub (Sep 7, 2022): 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.
Author
Owner

@shadoath commented on GitHub (Apr 26, 2024):

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

@shadoath commented on GitHub (Apr 26, 2024): I would second this idea. Some additional options would help when reviewing a PR that has the specific point to remove code.
Author
Owner

@javier-godoy commented on GitHub (Apr 26, 2024):

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

@javier-godoy commented on GitHub (Apr 26, 2024): I had the [same discussion](https://github.com/FlowingCode/DevelopmentConventions/issues/25) with colleagues some time ago, and we settled on `remove` (although we hardly ever use it)
Author
Owner

@daniel-albuschat commented on GitHub (Jul 25, 2024):

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.

@daniel-albuschat commented on GitHub (Jul 25, 2024): 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/conventionalcommits.org#153