Skip to content
Merged
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
13 changes: 12 additions & 1 deletion dhall/src/Dhall/Freeze.hs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,17 @@ freezeRemoteImportWithSettings settings directory import_ =
Remote {} -> freezeImportWithSettings settings directory import_
_ -> return import_

-- | See 'freezeRemoteImport'.
freezeNonMissingImportWithSettings
:: EvaluateSettings
-> FilePath
-> Import
-> IO Import
freezeNonMissingImportWithSettings settings directory import_ =
case importType (importHashed import_) of
Missing -> return import_
_ -> freezeImportWithSettings settings directory import_

-- | See 'freeze'.
freezeWithSettings
:: EvaluateSettings
Expand Down Expand Up @@ -322,7 +333,7 @@ freezeExpressionWithSettings
freezeExpressionWithSettings settings directory scope intent expression = do
let freezeScope =
case scope of
AllImports -> freezeImportWithSettings
AllImports -> freezeNonMissingImportWithSettings
OnlyRemoteImports -> freezeRemoteImportWithSettings

let freezeFunction = freezeScope settings directory
Expand Down
2 changes: 1 addition & 1 deletion dhall/src/Dhall/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ parseMode =
parseAllFlag =
Options.Applicative.switch
( Options.Applicative.long "all"
<> Options.Applicative.help "Add integrity checks to all imports (not just remote imports)"
<> Options.Applicative.help "Add integrity checks to all imports (not just remote imports) except for missing imports"
)

parseCacheFlag =
Expand Down
5 changes: 5 additions & 0 deletions dhall/tests/freeze/cached/idempotentA.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- The purpose of this test is to verify that `dhall freeze --cached` is
-- idempotent and doesn't attempt to resolve the `missing` import
missing
sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70
? ./True.dhall
3 changes: 3 additions & 0 deletions dhall/tests/freeze/cached/idempotentB.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
missing
sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70
? ./True.dhall