Skip to content
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

Increment Package Version Pragma #102

Closed
BebeSparkelSparkel opened this issue Jul 24, 2024 · 2 comments
Closed

Increment Package Version Pragma #102

BebeSparkelSparkel opened this issue Jul 24, 2024 · 2 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@BebeSparkelSparkel
Copy link
Contributor

BebeSparkelSparkel commented Jul 24, 2024

Being able to specify how to increment the package version would be useful for ci managing pull requests.

Pragma increment-version [version-index] where the optional version index specifies the version number (major, minor, ...) to be incremented. When cabal-gild is run

  • the version will be incremented
  • the version-index will be removed from the pragma line
  • the new version will be printed to stdout
  • zero exit

If the version index is not specified and the new --no-increment-version flag is not given to the cabal-gild command, then cabal-gild should have a non-zero exit. The --no-increment-version allows the other features of cabal-gild to be run without incrementing the version or having the command fail if no version index is specified.

For example with the cabal file

-- cabal-gild: increment-version 0
version: 0.0.0.1

running

$ cabal-gild --io=*.cabal
new-version: 1.0.0.1

the new version would be printed to stdout (shown above)

and the cabal file would be changed to

-- cabal-gild: increment-version
version: 1.0.0.1

Solves the issue specifed in snoyberg/mono-traversable#238

@tfausak
Copy link
Owner

tfausak commented Jul 24, 2024

I don't understand how this pragma is any better or different than simply changing the version number directly.

Aside from that, I think this is beyond the scope of what I want Gild to do. This type of "bump version" command really belongs in the build tool (like cabal bump major), or it belongs in a tool specifically meant for changing precise parts of the package description (like some hypothetical cabal-edit version 1.2.3.4). A principled approach to that requires something like haskell/cabal#7544.

@BebeSparkelSparkel
Copy link
Contributor Author

I think you are right that this is out of scope.

@tfausak tfausak added enhancement New feature or request wontfix This will not be worked on labels Jul 25, 2024
@tfausak tfausak closed this as not planned Won't fix, can't repro, duplicate, stale Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants