-
Notifications
You must be signed in to change notification settings - Fork 697
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add check for recursive glob in root directory (#8441)
* Add check for recursive glob in root directory Such globs might be expensive to include, as they might pull unnecessary directories just like `.git` or `dist-newstyle`. * Move expensive glob warning to its own constructor * Add changelog entry * Add test for recursive glob warning * Fix formatting
- Loading branch information
Showing
8 changed files
with
82 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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 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
Empty file.
Empty file.
11 changes: 11 additions & 0 deletions
11
cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/RecursiveGlobInRoot/cabal.out
This file contains 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# cabal check | ||
Warning: These warnings may cause trouble when distributing the package: | ||
Warning: In the 'data-files': glob '**/*.dat' starts at project root | ||
directory, this might include `.git/`, ``dist-newstyle/``, or other large | ||
directories! | ||
Warning: In the 'extra-source-files': glob '**/*.hs' starts at project root | ||
directory, this might include `.git/`, ``dist-newstyle/``, or other large | ||
directories! | ||
Warning: In the 'extra-doc-files': glob '**/*.md' starts at project root | ||
directory, this might include `.git/`, ``dist-newstyle/``, or other large | ||
directories! |
4 changes: 4 additions & 0 deletions
4
cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/RecursiveGlobInRoot/cabal.test.hs
This file contains 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import Test.Cabal.Prelude | ||
|
||
main = cabalTest $ | ||
cabal "check" [] |
19 changes: 19 additions & 0 deletions
19
cabal-testsuite/PackageTests/Check/ConfiguredPackage/Paths/RecursiveGlobInRoot/pkg.cabal
This file contains 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
cabal-version: 3.8 | ||
name: pkg | ||
version: 0 | ||
extra-source-files: | ||
**/*.hs | ||
data-files: | ||
**/*.dat | ||
extra-doc-files: | ||
**/*.md | ||
license: BSD-3-Clause | ||
synopsis: no | ||
description: none | ||
category: Test | ||
maintainer: none | ||
|
||
library | ||
default-language: Haskell2010 | ||
exposed-modules: | ||
Foo |
This file contains 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
synopsis: Add warning about expensive globs | ||
packages: Cabal | ||
prs: #8441 | ||
issues: #5311 | ||
description: { | ||
|
||
- Now cabal check will emit a warning when package uses | ||
recursive globs starting at root of the project | ||
|
||
} |