mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-29 01:24:35 +03:00
Filter files in withArbitraryFilesProjectVisitor
This commit is contained in:
parent
082c6cee77
commit
2af4f864cf
@ -1868,11 +1868,17 @@ withArbitraryFilesProjectVisitor :
|
||||
-> (List { path : String, content : String } -> projectContext -> ( List (Error { useErrorForModule : () }), projectContext ))
|
||||
-> ProjectRuleSchema schemaState projectContext moduleContext
|
||||
-> ProjectRuleSchema { schemaState | hasAtLeastOneVisitor : () } projectContext moduleContext
|
||||
withArbitraryFilesProjectVisitor newRequestedFiles visitor (ProjectRuleSchema schema) =
|
||||
withArbitraryFilesProjectVisitor requestedFiles baseVisitor (ProjectRuleSchema schema) =
|
||||
let
|
||||
visitor : List { path : String, content : String } -> projectContext -> ( List (Error {}), projectContext )
|
||||
visitor files context =
|
||||
baseVisitor (List.filter (globMatch requestedFiles) files) context
|
||||
|> Tuple.mapFirst removeErrorPhantomTypes
|
||||
in
|
||||
ProjectRuleSchema
|
||||
{ schema
|
||||
| arbitraryFilesVisitor = Just (combineVisitors (removeErrorPhantomTypeFromVisitor visitor) schema.arbitraryFilesVisitor)
|
||||
, arbitraryFileRequest = newRequestedFiles ++ schema.arbitraryFileRequest
|
||||
| arbitraryFilesVisitor = Just (combineVisitors visitor schema.arbitraryFilesVisitor)
|
||||
, arbitraryFileRequest = requestedFiles ++ schema.arbitraryFileRequest
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user