From 549f9d41a00cad090d641d4d90fcb0123624e244 Mon Sep 17 00:00:00 2001 From: Mike Pilgrem Date: Sat, 10 Aug 2024 23:16:55 +0100 Subject: [PATCH] Fix #6638 Add `notify-if-no-run-tests` and `notify-if-no-run-benchmarks` --- ChangeLog.md | 3 + doc/configure/yaml/non-project.md | 18 ++++ src/Stack/Build/ExecutePackage.hs | 9 +- src/Stack/Config.hs | 5 + src/Stack/Types/Config.hs | 140 ++++++++++++++-------------- src/Stack/Types/ConfigMonoid.hs | 148 +++++++++++++++++------------- 6 files changed, 188 insertions(+), 135 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 02274d7d50..3909285d17 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -23,6 +23,9 @@ Other enhancements: * Add flags `--run-tests` and `--run-benchmarks` (the existing defaults) to Stack's `build` command, which take precedence over the existing `no-run-tests` and `no-run-benchmarks` configuration options, respectively. +* In configuration files, the `notify-if-no-run-tests` and + `notify-if-no-run-benchmarks` keys are introduced, to allow the exisitng + notification to be muted if unwanted. Bug fixes: diff --git a/doc/configure/yaml/non-project.md b/doc/configure/yaml/non-project.md index a5e34de684..548f1a151f 100644 --- a/doc/configure/yaml/non-project.md +++ b/doc/configure/yaml/non-project.md @@ -1053,6 +1053,24 @@ Default: `true` If Stack's integration with the Nix package manager is not enabled, should Stack notify the user if a `nix` executable is on the PATH? +## notify-if-no-run-benchmarks + +:octicons-tag-24: UNRELEASED + +Default: `true` + +Should Stack notify the user if the automatic running of a benchmark is +prevented by the `--no-run-benchmarks` flag? + +## notify-if-no-run-tests + +:octicons-tag-24: UNRELEASED + +Default: `true` + +Should Stack notify the user if the automatic running of a test suite is +prevented by the `--no-run-tests` flag? + ## package-index [:octicons-tag-24: 2.9.3](https://github.com/commercialhaskell/stack/releases/tag/v2.9.3) diff --git a/src/Stack/Build/ExecutePackage.hs b/src/Stack/Build/ExecutePackage.hs index 59fd0d8b2b..f8e070c2b6 100644 --- a/src/Stack/Build/ExecutePackage.hs +++ b/src/Stack/Build/ExecutePackage.hs @@ -997,7 +997,9 @@ singleTest topts testsToRun ac ee task installedMap = do pure True TSUnknown -> pure True else do - announce "Test running disabled by --no-run-tests flag." + notifyIfNoRunTests <- view $ configL . to (.notifyIfNoRunTests) + when notifyIfNoRunTests $ + announce "Test running disabled by --no-run-tests flag." pure False when toRun $ do @@ -1265,7 +1267,10 @@ singleBench beopts benchesToRun ac ee task installedMap = do if beopts.runBenchmarks then pure True else do - announce "Benchmark running disabled by --no-run-benchmarks flag." + notifyIfNoRunBenchmarks <- + view $ configL . to (.notifyIfNoRunBenchmarks) + when notifyIfNoRunBenchmarks $ + announce "Benchmark running disabled by --no-run-benchmarks flag." pure False when toRun $ do diff --git a/src/Stack/Config.hs b/src/Stack/Config.hs index 6163681222..f6d859fc37 100644 --- a/src/Stack/Config.hs +++ b/src/Stack/Config.hs @@ -437,6 +437,9 @@ configFromConfigMonoid notifyIfGhcUntested = fromFirstTrue configMonoid.notifyIfGhcUntested notifyIfCabalUntested = fromFirstTrue configMonoid.notifyIfCabalUntested notifyIfArchUnknown = fromFirstTrue configMonoid.notifyIfArchUnknown + notifyIfNoRunTests = fromFirstTrue configMonoid.notifyIfNoRunTests + notifyIfNoRunBenchmarks = + fromFirstTrue configMonoid.notifyIfNoRunBenchmarks noRunCompile = fromFirstFalse configMonoid.noRunCompile allowDifferentUser <- case getFirst configMonoid.allowDifferentUser of @@ -597,6 +600,8 @@ configFromConfigMonoid , notifyIfGhcUntested , notifyIfCabalUntested , notifyIfArchUnknown + , notifyIfNoRunTests + , notifyIfNoRunBenchmarks , noRunCompile , stackDeveloperMode , casa diff --git a/src/Stack/Types/Config.hs b/src/Stack/Types/Config.hs index 9c8496c826..7498db5297 100644 --- a/src/Stack/Types/Config.hs +++ b/src/Stack/Types/Config.hs @@ -59,152 +59,158 @@ import Stack.Types.Version ( VersionCheck (..), VersionRange ) -- | The top-level Stackage configuration. data Config = Config - { workDir :: !(Path Rel Dir) + { workDir :: !(Path Rel Dir) -- ^ this allows to override .stack-work directory - , userGlobalConfigFile :: !(Path Abs File) + , userGlobalConfigFile :: !(Path Abs File) -- ^ The user-specific global configuration file. - , build :: !BuildOpts + , build :: !BuildOpts -- ^ Build configuration - , docker :: !DockerOpts + , docker :: !DockerOpts -- ^ Docker configuration - , nix :: !NixOpts + , nix :: !NixOpts -- ^ Execution environment (e.g nix-shell) configuration - , processContextSettings :: !(EnvSettings -> IO ProcessContext) + , processContextSettings :: !(EnvSettings -> IO ProcessContext) -- ^ Environment variables to be passed to external tools - , localProgramsBase :: !(Path Abs Dir) + , localProgramsBase :: !(Path Abs Dir) -- ^ Non-platform-specific path containing local installations - , localPrograms :: !(Path Abs Dir) + , localPrograms :: !(Path Abs Dir) -- ^ Path containing local installations (mainly GHC) - , hideTHLoading :: !Bool + , hideTHLoading :: !Bool -- ^ Hide the Template Haskell "Loading package ..." messages from the -- console - , prefixTimestamps :: !Bool + , prefixTimestamps :: !Bool -- ^ Prefix build output with timestamps for each line. - , platform :: !Platform + , platform :: !Platform -- ^ The platform we're building for, used in many directory names - , platformVariant :: !PlatformVariant + , platformVariant :: !PlatformVariant -- ^ Variant of the platform, also used in directory names - , ghcVariant :: !(Maybe GHCVariant) + , ghcVariant :: !(Maybe GHCVariant) -- ^ The variant of GHC requested by the user. - , ghcBuild :: !(Maybe CompilerBuild) + , ghcBuild :: !(Maybe CompilerBuild) -- ^ Override build of the compiler distribution (e.g. standard, gmp4, -- tinfo6) - , latestSnapshot :: !Text + , latestSnapshot :: !Text -- ^ URL of a JSON file providing the latest LTS and Nightly snapshots. - , systemGHC :: !Bool + , systemGHC :: !Bool -- ^ Should we use the system-installed GHC (on the PATH) if -- available? Can be overridden by command line options. - , installGHC :: !Bool + , installGHC :: !Bool -- ^ Should we automatically install GHC if missing or the wrong -- version is available? Can be overridden by command line options. - , skipGHCCheck :: !Bool + , skipGHCCheck :: !Bool -- ^ Don't bother checking the GHC version or architecture. - , skipMsys :: !Bool + , skipMsys :: !Bool -- ^ On Windows: don't use a sandboxed MSYS - , msysEnvironment :: !(Maybe MsysEnvironment) + , msysEnvironment :: !(Maybe MsysEnvironment) -- ^ On Windows: what MSYS2 environment to apply. Nothing on other operating -- systems. - , compilerCheck :: !VersionCheck + , compilerCheck :: !VersionCheck -- ^ Specifies which versions of the compiler are acceptable. - , compilerRepository :: !CompilerRepository + , compilerRepository :: !CompilerRepository -- ^ Specifies the repository containing the compiler sources - , localBin :: !(Path Abs Dir) + , localBin :: !(Path Abs Dir) -- ^ Directory we should install executables into - , fileWatchHook :: !(Maybe (Path Abs File)) + , fileWatchHook :: !(Maybe (Path Abs File)) -- ^ Optional path of executable used to override --file-watch -- post-processing. - , requireStackVersion :: !VersionRange + , requireStackVersion :: !VersionRange -- ^ Require a version of Stack within this range. - , jobs :: !Int + , jobs :: !Int -- ^ How many concurrent jobs to run, defaults to number of capabilities - , overrideGccPath :: !(Maybe (Path Abs File)) + , overrideGccPath :: !(Maybe (Path Abs File)) -- ^ Optional gcc override path - , extraIncludeDirs :: ![FilePath] + , extraIncludeDirs :: ![FilePath] -- ^ --extra-include-dirs arguments - , extraLibDirs :: ![FilePath] + , extraLibDirs :: ![FilePath] -- ^ --extra-lib-dirs arguments - , customPreprocessorExts :: ![Text] + , customPreprocessorExts :: ![Text] -- ^ List of custom preprocessors to complete the hard coded ones - , concurrentTests :: !Bool + , concurrentTests :: !Bool -- ^ Run test suites concurrently - , templateParams :: !(Map Text Text) + , templateParams :: !(Map Text Text) -- ^ Parameters for templates. - , scmInit :: !(Maybe SCM) + , scmInit :: !(Maybe SCM) -- ^ Initialize SCM (e.g. git) when creating new projects. - , ghcOptionsByName :: !(Map PackageName [Text]) + , ghcOptionsByName :: !(Map PackageName [Text]) -- ^ Additional GHC options to apply to specific packages. - , ghcOptionsByCat :: !(Map ApplyGhcOptions [Text]) + , ghcOptionsByCat :: !(Map ApplyGhcOptions [Text]) -- ^ Additional GHC options to apply to categories of packages - , cabalConfigOpts :: !(Map CabalConfigKey [Text]) + , cabalConfigOpts :: !(Map CabalConfigKey [Text]) -- ^ Additional options to be passed to ./Setup.hs configure - , setupInfoLocations :: ![String] + , setupInfoLocations :: ![String] -- ^ URLs or paths to stack-setup.yaml files, for finding tools. -- If none present, the default setup-info is used. - , setupInfoInline :: !SetupInfo + , setupInfoInline :: !SetupInfo -- ^ Additional SetupInfo to use to find tools. - , pvpBounds :: !PvpBounds + , pvpBounds :: !PvpBounds -- ^ How PVP upper bounds should be added to packages - , modifyCodePage :: !Bool + , modifyCodePage :: !Bool -- ^ Force the code page to UTF-8 on Windows - , rebuildGhcOptions :: !Bool + , rebuildGhcOptions :: !Bool -- ^ Rebuild on GHC options changes - , applyGhcOptions :: !ApplyGhcOptions + , applyGhcOptions :: !ApplyGhcOptions -- ^ Which packages do --ghc-options on the command line apply to? - , applyProgOptions :: !ApplyProgOptions + , applyProgOptions :: !ApplyProgOptions -- ^ Which packages do all and any --PROG-option options on the command line -- apply to? - , allowNewer :: !(First Bool) + , allowNewer :: !(First Bool) -- ^ Ignore version ranges in .cabal files. Funny naming chosen to -- match cabal. - , allowNewerDeps :: !(Maybe [PackageName]) + , allowNewerDeps :: !(Maybe [PackageName]) -- ^ Ignore dependency upper and lower bounds only for specified -- packages. No effect unless allow-newer is enabled. - , defaultInitSnapshot :: !(First AbstractSnapshot) + , defaultInitSnapshot :: !(First AbstractSnapshot) -- ^ An optional default snapshot to use with @stack init@ when none is -- specified at the command line. - , defaultTemplate :: !(Maybe TemplateName) + , defaultTemplate :: !(Maybe TemplateName) -- ^ The default template to use when none is specified. -- (If Nothing, the 'default' default template is used.) - , allowDifferentUser :: !Bool + , allowDifferentUser :: !Bool -- ^ Allow users other than the Stack root owner to use the Stack -- installation. - , dumpLogs :: !DumpLogs + , dumpLogs :: !DumpLogs -- ^ Dump logs of local non-dependencies when doing a build. - , project :: !(ProjectConfig (Project, Path Abs File)) + , project :: !(ProjectConfig (Project, Path Abs File)) -- ^ Project information and stack.yaml file location - , allowLocals :: !Bool + , allowLocals :: !Bool -- ^ Are we allowed to build local packages? The script -- command disallows this. - , saveHackageCreds :: !FirstTrue + , saveHackageCreds :: !FirstTrue -- ^ Should we save Hackage credentials to a file? - , hackageBaseUrl :: !Text + , hackageBaseUrl :: !Text -- ^ Hackage base URL used when uploading packages - , runner :: !Runner - , pantryConfig :: !PantryConfig - , stackRoot :: !(Path Abs Dir) - , snapshot :: !(Maybe AbstractSnapshot) + , runner :: !Runner + , pantryConfig :: !PantryConfig + , stackRoot :: !(Path Abs Dir) + , snapshot :: !(Maybe AbstractSnapshot) -- ^ Any snapshot override from the command line - , userStorage :: !UserStorage + , userStorage :: !UserStorage -- ^ Database connection pool for user Stack database - , hideSourcePaths :: !Bool + , hideSourcePaths :: !Bool -- ^ Enable GHC hiding source paths? - , recommendStackUpgrade :: !Bool + , recommendStackUpgrade :: !Bool -- ^ Recommend a Stack upgrade? - , notifyIfNixOnPath :: !Bool + , notifyIfNixOnPath :: !Bool -- ^ Notify if the Nix package manager (nix) is on the PATH, but -- Stack's Nix integration is not enabled? - , notifyIfGhcUntested :: !Bool + , notifyIfGhcUntested :: !Bool -- ^ Notify if Stack has not been tested with the GHC version? - , notifyIfCabalUntested :: !Bool + , notifyIfCabalUntested :: !Bool -- ^ Notify if Stack has not been tested with the Cabal version? - , notifyIfArchUnknown :: !Bool + , notifyIfArchUnknown :: !Bool -- ^ Notify if the specified machine architecture is unknown to Cabal (the -- library)? - , noRunCompile :: !Bool + , notifyIfNoRunTests :: !Bool + -- ^ Notify if the --no-run-tests flag has prevented the running of a + -- targeted test suite? + , notifyIfNoRunBenchmarks :: !Bool + -- ^ Notify if the --no-run-benchmarks flag has prevented the running of a + -- targeted benchmark? + , noRunCompile :: !Bool -- ^ Use --no-run and --compile options when using `stack script` - , stackDeveloperMode :: !Bool + , stackDeveloperMode :: !Bool -- ^ Turn on Stack developer mode for additional messages? - , casa :: !(Maybe (CasaRepoPrefix, Int)) + , casa :: !(Maybe (CasaRepoPrefix, Int)) -- ^ Optional Casa configuration } diff --git a/src/Stack/Types/ConfigMonoid.hs b/src/Stack/Types/ConfigMonoid.hs index 5c954bed38..d5c94fb3a2 100644 --- a/src/Stack/Types/ConfigMonoid.hs +++ b/src/Stack/Types/ConfigMonoid.hs @@ -59,145 +59,149 @@ import Stack.Types.Snapshot (AbstractSnapshot) -- | An uninterpreted representation of configuration options. Configurations -- may be "cascaded" using mappend (left-biased). data ConfigMonoid = ConfigMonoid - { stackRoot :: !(First (Path Abs Dir)) + { stackRoot :: !(First (Path Abs Dir)) -- ^ See: 'clStackRoot' - , workDir :: !(First (Path Rel Dir)) + , workDir :: !(First (Path Rel Dir)) -- ^ See: 'configWorkDir'. - , buildOpts :: !BuildOptsMonoid + , buildOpts :: !BuildOptsMonoid -- ^ build options. - , dockerOpts :: !DockerOptsMonoid + , dockerOpts :: !DockerOptsMonoid -- ^ Docker options. - , nixOpts :: !NixOptsMonoid + , nixOpts :: !NixOptsMonoid -- ^ Options for the execution environment (nix-shell or container) - , connectionCount :: !(First Int) + , connectionCount :: !(First Int) -- ^ See: 'configConnectionCount' - , hideTHLoading :: !FirstTrue + , hideTHLoading :: !FirstTrue -- ^ See: 'configHideTHLoading' - , prefixTimestamps :: !(First Bool) + , prefixTimestamps :: !(First Bool) -- ^ See: 'configPrefixTimestamps' - , latestSnapshot :: !(First Text) + , latestSnapshot :: !(First Text) -- ^ See: 'configLatestSnapshot' - , packageIndex :: !(First PackageIndexConfig) + , packageIndex :: !(First PackageIndexConfig) -- ^ See: 'withPantryConfig' - , systemGHC :: !(First Bool) + , systemGHC :: !(First Bool) -- ^ See: 'configSystemGHC' - , installGHC :: !FirstTrue + , installGHC :: !FirstTrue -- ^ See: 'configInstallGHC' - , skipGHCCheck :: !FirstFalse + , skipGHCCheck :: !FirstFalse -- ^ See: 'configSkipGHCCheck' - , skipMsys :: !FirstFalse + , skipMsys :: !FirstFalse -- ^ See: 'configSkipMsys' - , msysEnvironment :: !(First MsysEnvironment) + , msysEnvironment :: !(First MsysEnvironment) -- ^ See: 'configMsysEnvironment' - , compilerCheck :: !(First VersionCheck) + , compilerCheck :: !(First VersionCheck) -- ^ See: 'configCompilerCheck' - , compilerRepository :: !(First CompilerRepository) + , compilerRepository :: !(First CompilerRepository) -- ^ See: 'configCompilerRepository' - , requireStackVersion :: !IntersectingVersionRange + , requireStackVersion :: !IntersectingVersionRange -- ^ See: 'configRequireStackVersion' - , arch :: !(First String) + , arch :: !(First String) -- ^ Used for overriding the platform - , ghcVariant :: !(First GHCVariant) + , ghcVariant :: !(First GHCVariant) -- ^ Used for overriding the platform - , ghcBuild :: !(First CompilerBuild) + , ghcBuild :: !(First CompilerBuild) -- ^ Used for overriding the GHC build - , jobs :: !(First Int) + , jobs :: !(First Int) -- ^ See: 'configJobs' - , extraIncludeDirs :: ![FilePath] + , extraIncludeDirs :: ![FilePath] -- ^ See: 'configExtraIncludeDirs' - , extraLibDirs :: ![FilePath] + , extraLibDirs :: ![FilePath] -- ^ See: 'configExtraLibDirs' - , customPreprocessorExts :: ![Text] + , customPreprocessorExts :: ![Text] -- ^ See: 'configCustomPreprocessorExts' - , overrideGccPath :: !(First (Path Abs File)) + , overrideGccPath :: !(First (Path Abs File)) -- ^ Allow users to override the path to gcc - , overrideHpack :: !(First FilePath) + , overrideHpack :: !(First FilePath) -- ^ Use Hpack executable (overrides bundled Hpack) - , hpackForce :: !FirstFalse + , hpackForce :: !FirstFalse -- ^ Pass --force to Hpack to always overwrite Cabal file - , concurrentTests :: !(First Bool) + , concurrentTests :: !(First Bool) -- ^ See: 'configConcurrentTests' - , localBinPath :: !(First FilePath) + , localBinPath :: !(First FilePath) -- ^ Used to override the binary installation dir - , fileWatchHook :: !(First FilePath) + , fileWatchHook :: !(First FilePath) -- ^ Path to executable used to override --file-watch post-processing. - , templateParameters :: !(Map Text Text) + , templateParameters :: !(Map Text Text) -- ^ Template parameters. - , scmInit :: !(First SCM) + , scmInit :: !(First SCM) -- ^ Initialize SCM (e.g. git init) when making new projects? - , ghcOptionsByName :: !(MonoidMap PackageName (Monoid.Dual [Text])) + , ghcOptionsByName :: !(MonoidMap PackageName (Monoid.Dual [Text])) -- ^ See 'configGhcOptionsByName'. Uses 'Monoid.Dual' so that -- options from the configs on the right come first, so that they -- can be overridden. - , ghcOptionsByCat :: !(MonoidMap ApplyGhcOptions (Monoid.Dual [Text])) + , ghcOptionsByCat :: !(MonoidMap ApplyGhcOptions (Monoid.Dual [Text])) -- ^ See 'configGhcOptionsAll'. Uses 'Monoid.Dual' so that options -- from the configs on the right come first, so that they can be -- overridden. - , cabalConfigOpts :: !(MonoidMap CabalConfigKey (Monoid.Dual [Text])) + , cabalConfigOpts :: !(MonoidMap CabalConfigKey (Monoid.Dual [Text])) -- ^ See 'configCabalConfigOpts'. - , extraPath :: ![Path Abs Dir] + , extraPath :: ![Path Abs Dir] -- ^ Additional paths to search for executables in - , setupInfoLocations :: ![String] + , setupInfoLocations :: ![String] -- ^ See 'configSetupInfoLocations' - , setupInfoInline :: !SetupInfo + , setupInfoInline :: !SetupInfo -- ^ See 'configSetupInfoInline' - , localProgramsBase :: !(First (Path Abs Dir)) + , localProgramsBase :: !(First (Path Abs Dir)) -- ^ Override the default local programs dir, where e.g. GHC is installed. - , pvpBounds :: !(First PvpBounds) + , pvpBounds :: !(First PvpBounds) -- ^ See 'configPvpBounds' - , modifyCodePage :: !FirstTrue + , modifyCodePage :: !FirstTrue -- ^ See 'configModifyCodePage' - , rebuildGhcOptions :: !FirstFalse + , rebuildGhcOptions :: !FirstFalse -- ^ See 'configMonoidRebuildGhcOptions' - , applyGhcOptions :: !(First ApplyGhcOptions) + , applyGhcOptions :: !(First ApplyGhcOptions) -- ^ See 'configApplyGhcOptions' - , applyProgOptions :: !(First ApplyProgOptions) + , applyProgOptions :: !(First ApplyProgOptions) -- ^ See 'configApplyProgOptions' - , allowNewer :: !(First Bool) + , allowNewer :: !(First Bool) -- ^ See 'configMonoidAllowNewer' - , allowNewerDeps :: !(Maybe AllowNewerDeps) + , allowNewerDeps :: !(Maybe AllowNewerDeps) -- ^ See 'configMonoidAllowNewerDeps' - , defaultInitSnapshot :: !(First (Unresolved AbstractSnapshot)) + , defaultInitSnapshot :: !(First (Unresolved AbstractSnapshot)) -- ^ An optional default snapshot to use with @stack init@ when none is -- specified. - , defaultTemplate :: !(First TemplateName) + , defaultTemplate :: !(First TemplateName) -- ^ The default template to use when none is specified. -- (If Nothing, the 'default' default template is used.) - , allowDifferentUser :: !(First Bool) + , allowDifferentUser :: !(First Bool) -- ^ Allow users other than the Stack root owner to use the Stack -- installation. - , dumpLogs :: !(First DumpLogs) + , dumpLogs :: !(First DumpLogs) -- ^ See 'configDumpLogs' - , saveHackageCreds :: !FirstTrue + , saveHackageCreds :: !FirstTrue -- ^ See 'configSaveHackageCreds' - , hackageBaseUrl :: !(First Text) + , hackageBaseUrl :: !(First Text) -- ^ See 'configHackageBaseUrl' - , colorWhen :: !(First ColorWhen) + , colorWhen :: !(First ColorWhen) -- ^ When to use 'ANSI' colors - , styles :: !StylesUpdate - , hideSourcePaths :: !FirstTrue + , styles :: !StylesUpdate + , hideSourcePaths :: !FirstTrue -- ^ See 'configHideSourcePaths' , recommendStackUpgrade :: !FirstTrue -- ^ See 'configRecommendStackUpgrade' - , notifyIfNixOnPath :: !FirstTrue + , notifyIfNixOnPath :: !FirstTrue -- ^ See 'configNotifyIfNixOnPath' - , notifyIfGhcUntested :: !FirstTrue + , notifyIfGhcUntested :: !FirstTrue -- ^ See 'configNotifyIfGhcUntested' - , notifyIfCabalUntested :: !FirstTrue + , notifyIfCabalUntested :: !FirstTrue -- ^ See 'configNotifyIfCabalUntested' - , notifyIfArchUnknown :: !FirstTrue + , notifyIfArchUnknown :: !FirstTrue -- ^ See 'configNotifyIfArchUnknown' - , casaOpts :: !CasaOptsMonoid + , notifyIfNoRunTests :: !FirstTrue + -- ^ See 'configNotifyIfNoRunTests' + , notifyIfNoRunBenchmarks :: !FirstTrue + -- ^ See 'configNotifyIfNoRunBenchmarks' + , casaOpts :: !CasaOptsMonoid -- ^ Casa configuration options. - , casaRepoPrefix :: !(First CasaRepoPrefix) + , casaRepoPrefix :: !(First CasaRepoPrefix) -- ^ Casa repository prefix (deprecated). - , snapshotLocation :: !(First Text) + , snapshotLocation :: !(First Text) -- ^ Custom location of LTS/Nightly snapshots - , globalHintsLocation :: !(First (Unresolved GlobalHintsLocation)) + , globalHintsLocation :: !(First (Unresolved GlobalHintsLocation)) -- ^ Custom location of global hints - , noRunCompile :: !FirstFalse + , noRunCompile :: !FirstFalse -- ^ See: 'configNoRunCompile' - , stackDeveloperMode :: !(First Bool) + , stackDeveloperMode :: !(First Bool) -- ^ See 'configStackDeveloperMode' } deriving Generic @@ -338,6 +342,10 @@ parseConfigMonoidObject rootDir obj = do FirstTrue <$> obj ..:? configMonoidNotifyIfCabalUntestedName notifyIfArchUnknown <- FirstTrue <$> obj ..:? configMonoidNotifyIfArchUnknownName + notifyIfNoRunTests <- + FirstTrue <$> obj ..:? configMonoidNotifyIfNoRunTestsName + notifyIfNoRunBenchmarks <- + FirstTrue <$> obj ..:? configMonoidNotifyIfNoRunBenchmarksName casaOpts <- jsonSubWarnings (obj ..:? configMonoidCasaOptsName ..!= mempty) casaRepoPrefix <- First <$> obj ..:? configMonoidCasaRepoPrefixName snapshotLocation <- First <$> obj ..:? configMonoidSnapshotLocationName @@ -407,6 +415,8 @@ parseConfigMonoidObject rootDir obj = do , notifyIfGhcUntested , notifyIfCabalUntested , notifyIfArchUnknown + , notifyIfNoRunTests + , notifyIfNoRunBenchmarks , casaOpts , casaRepoPrefix , snapshotLocation @@ -598,6 +608,12 @@ configMonoidNotifyIfCabalUntestedName = "notify-if-cabal-untested" configMonoidNotifyIfArchUnknownName :: Text configMonoidNotifyIfArchUnknownName = "notify-if-arch-unknown" +configMonoidNotifyIfNoRunTestsName :: Text +configMonoidNotifyIfNoRunTestsName = "notify-if-no-run-tests" + +configMonoidNotifyIfNoRunBenchmarksName :: Text +configMonoidNotifyIfNoRunBenchmarksName = "notify-if-no-run-benchmarks" + configMonoidCasaOptsName :: Text configMonoidCasaOptsName = "casa"