Skip to content

Commit

Permalink
Warn on cabal format invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
jasagredo authored and Mikolaj committed Nov 16, 2024
1 parent fc85821 commit 318e921
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cabal-install/src/Distribution/Client/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ import Distribution.Simple.Utils
, notice
, topHandler
, tryFindPackageDesc
, warn
)
import Distribution.Text
( display
Expand Down Expand Up @@ -1343,6 +1344,7 @@ checkAction checkFlags extraArgs _globalFlags = do
formatAction :: Flag Verbosity -> [String] -> Action
formatAction verbosityFlag extraArgs _globalFlags = do
let verbosity = fromFlag verbosityFlag
warn verbosity "This command is not a full formatter yet"
path <- case extraArgs of
[] -> relativeSymbolicPath <$> tryFindPackageDesc verbosity Nothing
(p : _) -> return $ makeSymbolicPath p
Expand Down
11 changes: 11 additions & 0 deletions changelog.d/pr-10549
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
synopsis: Warn on `cabal format`
packages: cabal-install
prs: #10549
issues:
significance:

description: {

- Despite its name, `cabal format` is not a proper formatter for cabal files. By chance users have sometimes found the command eventhough it is not mentioned in the help text, and they used it to format cabal files. This has some downsides like comments are stripped away or common stanzas are inlined, the command is more like a dump of the resolved package description. There are future plans (#7544) to make it an actual formatter so, rather than going through a deprecation cycle, we decided to keep this command for future use and in the meantime just warn the user about the fact that it is not a proper formatter.

}

0 comments on commit 318e921

Please sign in to comment.