1
1
mirror of https://github.com/anoma/juvix.git synced 2024-11-30 05:42:26 +03:00

Ignore files that start with a . (#3072)

- Closes #3068
This commit is contained in:
Jan Mas Rovira 2024-09-30 12:17:18 +02:00 committed by GitHub
parent 6e58aad8e7
commit deca981fa3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 28 additions and 1 deletions

View File

@ -156,11 +156,14 @@ instance Show FileExt where
instance Pretty FileExt where
pretty = pretty . fileExtToText
isHidden :: Path b File -> Bool
isHidden = (== ".") . take 1 . toFilePath
isJuvixOrJuvixMdFile :: Path b File -> Bool
isJuvixOrJuvixMdFile = isJuvixFile .||. isJuvixMarkdownFile
isJuvixFile :: Path b File -> Bool
isJuvixFile = (== Just juvixFileExt) . fileExtension
isJuvixFile = (not . isHidden) .&&. ((== Just juvixFileExt) . fileExtension)
isJuvixMarkdownFile :: Path b File -> Bool
isJuvixMarkdownFile p = case splitExtension p of

View File

@ -269,5 +269,9 @@ tests =
posTest
"Proper formatting of import module path"
$(mkRelDir "issue2737")
$(mkRelFile "main.juvix"),
posTest
"Ignore dot files"
$(mkRelDir "issue3068")
$(mkRelFile "main.juvix")
]

View File

@ -0,0 +1 @@
nothing to see here

View File

@ -0,0 +1,9 @@
module Package;
import PackageDescription.V2 open;
package : Package :=
defaultPackage@?{
name := "issue3068";
dependencies := []
};

View File

@ -0,0 +1 @@
module main;

View File

@ -1,5 +1,14 @@
working-directory: ./../../../tests/
tests:
- name: ignore-dot-file
working-directory: ./../../../tests/positive/issue3068
command:
- juvix
- typecheck
stderr:
equals: "Well done! It type checks\n"
exit-status: 0
- name: flag-help-shows-juvix-file-for-autocompletion
command:
- juvix