Skip to content

Expose and use labelMessage with pkg context#12123

Open
philderbeast wants to merge 1 commit into
haskell:masterfrom
cabalism:add/package-warning-context
Open

Expose and use labelMessage with pkg context#12123
philderbeast wants to merge 1 commit into
haskell:masterfrom
cabalism:add/package-warning-context

Conversation

@philderbeast

@philderbeast philderbeast commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Fixes #12019.

  • Rename warnMessage to labelMessage1 and export from Distribution.Simple.Utils
  • Add punctuation parameter and haddocks to labelMessage

The output of existing tests suffices to show and test this change.

I'll squash commits before applying the merge label if this pull request is approved.

Note

As can be seen in ppPackageCheck that returns the warning message, the Warning: package-name prefix is followed an [explanation-id] (like [no-default-language]) and then the explanation description:

-- | Pretty printing 'PackageCheck'.
ppPackageCheck :: PackageCheck -> String
ppPackageCheck e =
let ex = explanation e
in "["
++ (ppCheckExplanationId . checkExplanationId) ex
++ "] "
++ ppExplanation ex

QA Notes

Follow the reproduction in the issue, with this pull request checked out locally:

$ cabal install cabal-install:exe:cabal --overwrite-policy=always -j
$ cabal clean --project-file=cabal.validate.project
$ cabal build all --enable-tests --enable-benchmarks --project-file=cabal.validate.project 

The output from the build should contain Warning: Cabal-tests [no-default-language].


Footnotes

  1. I didn't go with labelledMessage or labeledMessage because of the US versus UK, AU, NZ etc spelling differences.

@philderbeast
philderbeast force-pushed the add/package-warning-context branch 2 times, most recently from c178f15 to bcf8228 Compare July 16, 2026 20:34
- Rename warnMessage to labelMessage
- Add punctuation parameter and haddocks
- Add since annotation for exposed function
- Update expected outputs
@philderbeast
philderbeast force-pushed the add/package-warning-context branch from ce01707 to 4fdffc4 Compare July 19, 2026 00:41
@philderbeast philderbeast added the merge me Tell Mergify Bot to merge label Jul 19, 2026
@mergify mergify Bot added the ready and waiting Mergify is waiting out the cooldown period label Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge me Tell Mergify Bot to merge ready and waiting Mergify is waiting out the cooldown period

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add package context to package warnings

3 participants