From cf2a955d408ba57eaa89995cd29a40b119e123ea Mon Sep 17 00:00:00 2001 From: Jeroen Engels Date: Sun, 3 Sep 2023 11:36:24 +0200 Subject: [PATCH] Extract function --- src/Review/Rule.elm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Review/Rule.elm b/src/Review/Rule.elm index 61d25edcf..bff1e9c64 100644 --- a/src/Review/Rule.elm +++ b/src/Review/Rule.elm @@ -1368,7 +1368,7 @@ mergeModuleVisitorsHelp ruleName_ initialProjectContext moduleContextCreator vis ) emptyModuleVisitor visitors - |> (\(ModuleRuleSchema moduleVisitorSchema) -> ModuleRuleSchema moduleVisitorSchema) + |> removeExtensibleRecordFromModuleRuleSchema , moduleContextCreator ) @@ -1408,7 +1408,12 @@ removeExtensibleRecordTypeVariable : (ModuleRuleSchema {} moduleContext -> ModuleRuleSchema { a | hasAtLeastOneVisitor : () } moduleContext) -> (ModuleRuleSchema {} moduleContext -> ModuleRuleSchema { hasAtLeastOneVisitor : () } moduleContext) removeExtensibleRecordTypeVariable function = - function >> (\(ModuleRuleSchema param) -> ModuleRuleSchema param) + function >> removeExtensibleRecordFromModuleRuleSchema + + +removeExtensibleRecordFromModuleRuleSchema : ModuleRuleSchema schemaState moduleContext -> ModuleRuleSchema a moduleContext +removeExtensibleRecordFromModuleRuleSchema (ModuleRuleSchema param) = + ModuleRuleSchema param {-| Creates a rule that will **only** report a configuration error, which stops `elm-review` from reviewing the project