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

Warn on cabal format invocation #10549

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

}
Loading