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

Depend on optparse-applicative instead of optparse-applicative-fork #899

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

smelc
Copy link
Contributor

@smelc smelc commented Sep 18, 2024

Changelog

- description: |
    Depend on optparse-applicative instead of optparse-applicative-fork
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

We want to get rid on our dependency to optparse-applicative-fork here: cardano-cli/cardano-cli.cabal#L245.

This PR does this, as well as showing what it happens if we take a vanilla version of optparse-applicative. This is what the commit Changes to golden files WITHOUT change to optparse-applicative shows.

Then the last commit, named Changes to golden files WITH change to optparse-applicative shows what we can achieve if we tweak optparse-applicative slightly. In this case the changes to golden files is minimal (pipes move to the left, and then are more single line disjunctions, but they are fine IMHO).

How to trust this PR

Look at the golden files. See that the end state is quite nice.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • Self-reviewed the diff

@@ -45,8 +45,8 @@ pref =
Opt.prefs $
mconcat
[ showHelpOnEmpty
, helpEmbedBriefDesc PP.align
, helpRenderHelp customRenderHelp
-- , helpEmbedBriefDesc PP.align
Copy link
Contributor Author

@smelc smelc Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PP.align value is the magical configuration bit that makes the golden files still look good. The changes in https://github.com/smelc/optparse-applicative/commits/smelc/wip-cardano-cli-usecase/ are hardcoding this configuration change for now, but my plan is to make a PR to optparse-applicative to make this configurable.

@smelc smelc force-pushed the smelc/use-vanilla-optparse-applicative branch 2 times, most recently from c6f2764 to f974a10 Compare November 4, 2024 10:43
@smelc smelc force-pushed the smelc/use-vanilla-optparse-applicative branch from f974a10 to 7d32504 Compare November 4, 2024 11:01
@smelc smelc force-pushed the smelc/use-vanilla-optparse-applicative branch from 7d32504 to 13cfd22 Compare November 4, 2024 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant