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

Add cfgVerbosity #10688

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

philderbeast
Copy link
Collaborator

@philderbeast philderbeast commented Dec 29, 2024

I was working on a fix for #10527 and noticed that all but one of the callers of withContextAndSelectors had already accessed verbosity in the same way that withContextAndSelectors does (Cmd*.hs modules do this):

verbosity = fromFlagOrDefault normal (setupVerbosity $ configCommonFlags configFlags)

verbosity = fromFlagOrDefault normal (setupVerbosity $ configCommonFlags configFlags)

This is a refactor that adds a verbosity argument to withContextAndSelectors and a function cfgVerbosity that simplifies grabbing the verbosity from the configuration or using a default value.

With this a lot of -XRecordWildCards can be removed as can a lot of imports from Distribution.Client.Setup.

This will help with my fix for #10527 too as I may have to call withContextAndSelectors twice1 and don't want repeated messaging so would silence the verbosity of the first call.

Configuration is affected by the following files:
- cabal.project
Configuration is affected by the following files:
- cabal.project

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

Footnotes

  1. Depending on whether cabal repl should pick the one target, Should cabal repl pick the one package library as TARGET? #10689.

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