mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-29 01:24:35 +03:00
Add files to RequestedData
This commit is contained in:
parent
0e63394168
commit
2239a05643
@ -1,4 +1,4 @@
|
||||
module Review.RequestedData exposing (RequestedData(..), combine, combineJust, none)
|
||||
module Review.RequestedData exposing (RequestedData(..), combine, combineJust, none, withFiles)
|
||||
|
||||
|
||||
type RequestedData
|
||||
@ -35,6 +35,15 @@ combine maybeA maybeB =
|
||||
a
|
||||
|
||||
|
||||
withFiles : List String -> RequestedData -> RequestedData
|
||||
withFiles files ((RequestedData requested) as untouched) =
|
||||
if List.isEmpty files then
|
||||
untouched
|
||||
|
||||
else
|
||||
RequestedData { requested | files = files }
|
||||
|
||||
|
||||
combineJust : RequestedData -> RequestedData -> RequestedData
|
||||
combineJust (RequestedData a) (RequestedData b) =
|
||||
RequestedData
|
||||
|
@ -1263,6 +1263,7 @@ fromProjectRuleSchema (ProjectRuleSchema schema) =
|
||||
RequestedData.combine
|
||||
(Maybe.map requestedDataFromContextCreator schema.moduleContextCreator)
|
||||
(Maybe.map (.fromModuleToProject >> requestedDataFromContextCreator) schema.folder)
|
||||
|> RequestedData.withFiles schema.arbitraryFileRequest
|
||||
, providesFixes = schema.providesFixes
|
||||
, ruleProjectVisitor =
|
||||
Ok
|
||||
|
Loading…
Reference in New Issue
Block a user