-
Notifications
You must be signed in to change notification settings - Fork 710
make cabal less chatty w.r.t. project files in use #10940
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
Draft
ulysses4ever
wants to merge
1
commit into
master
Choose a base branch
from
cabal-project-message-less-chatty-t10885
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -226,6 +226,7 @@ import Control.Monad.IO.Class (liftIO) | |||||
import Control.Monad.State as State (State, execState, runState, state) | ||||||
import Data.Foldable (fold) | ||||||
import Data.List (deleteBy, groupBy) | ||||||
import qualified Data.List as L | ||||||
import qualified Data.List.NonEmpty as NE | ||||||
import qualified Data.Map as Map | ||||||
import qualified Data.Set as Set | ||||||
|
@@ -407,13 +408,7 @@ rebuildProjectConfig | |||||
localPackages <- phaseReadLocalPackages compiler (projectConfig <> cliConfig) | ||||||
return (projectConfig, localPackages) | ||||||
|
||||||
let configfiles = | ||||||
[ text "-" <+> docProjectConfigPath path | ||||||
| Explicit path <- Set.toList . (if verbosity >= verbose then id else onlyTopLevelProvenance) $ projectConfigProvenance projectConfig | ||||||
] | ||||||
unless (null configfiles) $ | ||||||
notice (verboseStderr verbosity) . render . vcat $ | ||||||
text "Configuration is affected by the following files:" : configfiles | ||||||
informAboutConfigFiles projectConfig | ||||||
|
||||||
return (projectConfig <> cliConfig, localPackages) | ||||||
where | ||||||
|
@@ -460,6 +455,48 @@ rebuildProjectConfig | |||||
projectConfigBuildOnly | ||||||
pkgLocations | ||||||
|
||||||
informAboutConfigFiles projectConfig = | ||||||
unless (null configFiles) | ||||||
. out (verboseStderr verbosity) | ||||||
. render | ||||||
$ message | ||||||
where | ||||||
-- output mode is either 'notice' or 'info' depending on how trivial the information | ||||||
out | ||||||
| allProjectFilesInCWD = info | ||||||
| otherwise = notice | ||||||
where | ||||||
allProjectFilesInCWD = | ||||||
map projectConfigPathRoot configFiles | ||||||
L.\\ ["cabal.project", "cabal.project.local", "cabal.freeze"] | ||||||
== [] | ||||||
|
||||||
-- formatting depends on |config files| (the number of config files) | ||||||
message = case configFilesDoc of | ||||||
(_ : _ : _ : _) -> | ||||||
-- \|config files| > 2 => vertical list | ||||||
vcat | ||||||
[ text "Configuration is affected by the following files:" | ||||||
, configFilesVertList | ||||||
] | ||||||
[path1, path2] -> | ||||||
text "Configuration is affected by '" <+> path1 <+> text "' and '" <+> path2 <+> text "'" | ||||||
[path] -> | ||||||
text "Configuration is affected by '" <+> path <+> text "'" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd expect
Suggested change
and similar above. |
||||||
[] -> | ||||||
error "impossible" -- see `unless (null configFiles)` above | ||||||
where | ||||||
configFilesDoc = map docProjectConfigPath configFiles | ||||||
configFilesVertList = docProjectConfigFiles configFiles | ||||||
|
||||||
configFiles = | ||||||
[ path | ||||||
| Explicit path <- | ||||||
Set.toList | ||||||
. (if verbosity >= verbose then id else onlyTopLevelProvenance) | ||||||
$ projectConfigProvenance projectConfig | ||||||
] | ||||||
|
||||||
configureCompiler | ||||||
:: Verbosity | ||||||
-> DistDirLayout | ||||||
|
3 changes: 1 addition & 2 deletions
3
cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external-target.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
cabal-testsuite/PackageTests/Backpack/Includes2/cabal-external.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal-target.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
cabal-testsuite/PackageTests/Backpack/Includes2/cabal-internal.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
cabal-testsuite/PackageTests/BuildAutogenPackageGuard/cabal.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
cabal-testsuite/PackageTests/BuildDeps/InternalLibrary1/cabal.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
...uite/PackageTests/BuildTargets/UseLocalPackageForSetup/use-local-package-as-setup-dep.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
cabal-testsuite/PackageTests/BuildToolDependsExternal/setup.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
cabal-testsuite/PackageTests/CustomWithoutCabalDefaultMain/cabal.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
cabal-testsuite/PackageTests/ExternalCommandExitCode/cabal.out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative is something like