Skip to content

Commit 64300e2

Browse files
committed
Stop parsing stack-work and node_modules
1 parent 3373663 commit 64300e2

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

package.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: aws-lambda-haskell-runtime
2-
version: 1.1.0
2+
version: 1.1.1
33
github: "theam/aws-lambda-haskell-runtime"
44
license: Apache-2.0
55
author: Nikita Tchayka
@@ -79,4 +79,3 @@ ghc-options:
7979
- -Wpartial-fields
8080
- -fhide-source-paths
8181
- -freverse-errors
82-
- -O2

src/Aws/Lambda/Meta/Discover.hs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{-| Discovery of AWS Lambda handlers
22
A handler is basically a function that has a type definition that
3-
starts with "handler :: ".
3+
starts with "handler " and two colons.
44
-}
55
module Aws.Lambda.Meta.Discover
66
( handlers
@@ -15,6 +15,13 @@ import qualified Data.Text as Text
1515
import Path
1616
import qualified Path.IO as PathIO
1717

18+
-- | Paths to ignore during compilation
19+
ignoredPaths :: [Text]
20+
ignoredPaths =
21+
[ "node_modules"
22+
, ".stack-work"
23+
]
24+
1825
{-| Returns a list of handler paths that look like
1926
2027
@src/Foo/Bar/Quux.handler@
@@ -35,6 +42,11 @@ modulesWithHandler files =
3542
where
3643
isHaskellModule file =
3744
fileExtension file == ".hs"
45+
&& isNotIgnoredPath file
46+
47+
isNotIgnoredPath file =
48+
filter ((Text.pack $ toFilePath file) `Text.isInfixOf`) ignoredPaths
49+
& null
3850

3951
handlerNames :: [Path Rel File] -> [Text]
4052
handlerNames modules =

0 commit comments

Comments
 (0)