diff --git a/phantom-type-tests/No_Project_Rule_Without_Visitors.txt b/phantom-type-tests/No_Project_Rule_Without_Visitors.txt index 61b74360..57ed0225 100644 --- a/phantom-type-tests/No_Project_Rule_Without_Visitors.txt +++ b/phantom-type-tests/No_Project_Rule_Without_Visitors.txt @@ -10,7 +10,7 @@ The argument is: Rule.ProjectRuleSchema () moduleContext - { canAddModuleVisitor : (), withModuleContext : Rule.NotNeeded } + { canAddModuleVisitor : (), withModuleContext : Rule.Forbidden } But (|>) is piping it to a function that expects: @@ -20,7 +20,7 @@ But (|>) is piping it to a function that expects: { a | canAddModuleVisitor : () , hasAtLeastOneVisitor : () - , withModuleContext : Rule.NotNeeded + , withModuleContext : Rule.Forbidden } Hint: Seems like a record field typo. Maybe hasAtLeastOneVisitor should be diff --git a/phantom-type-tests/No_WithModuleContext_Without_WithModuleVisitor.txt b/phantom-type-tests/No_WithModuleContext_Without_WithModuleVisitor.txt index bb90ce2b..c8d7e5f9 100644 --- a/phantom-type-tests/No_WithModuleContext_Without_WithModuleVisitor.txt +++ b/phantom-type-tests/No_WithModuleContext_Without_WithModuleVisitor.txt @@ -14,7 +14,7 @@ The argument is: Rule.ProjectRuleSchema () () - { canAddModuleVisitor : (), withModuleContext : Rule.NotNeeded } + { canAddModuleVisitor : (), withModuleContext : Rule.Forbidden } But (|>) is piping it to a function that expects: diff --git a/phantom-type-tests/No_WithModuleVisitor_After_WithModuleContext.txt b/phantom-type-tests/No_WithModuleVisitor_After_WithModuleContext.txt index 26641498..3cfe4c7c 100644 --- a/phantom-type-tests/No_WithModuleVisitor_After_WithModuleContext.txt +++ b/phantom-type-tests/No_WithModuleVisitor_After_WithModuleContext.txt @@ -16,7 +16,7 @@ The argument is: Rule.ProjectRuleSchema () () - { hasAtLeastOneVisitor : (), withModuleContext : Rule.NotNeeded } + { hasAtLeastOneVisitor : (), withModuleContext : Rule.Forbidden } But (|>) is piping it to a function that expects: @@ -26,7 +26,7 @@ But (|>) is piping it to a function that expects: { a | canAddModuleVisitor : () , hasAtLeastOneVisitor : () - , withModuleContext : Rule.NotNeeded + , withModuleContext : Rule.Forbidden } Hint: Seems like a record field typo. Maybe canAddModuleVisitor should be diff --git a/phantom-type-tests/No_WithModuleVisitor_Without_WithModuleContext.txt b/phantom-type-tests/No_WithModuleVisitor_Without_WithModuleContext.txt index b122c796..b501b8ea 100644 --- a/phantom-type-tests/No_WithModuleVisitor_Without_WithModuleContext.txt +++ b/phantom-type-tests/No_WithModuleVisitor_Without_WithModuleContext.txt @@ -11,7 +11,7 @@ The argument is: Rule.ProjectRuleSchema () () - { canAddModuleVisitor : (), withModuleContext : Rule.NotNeeded } + { canAddModuleVisitor : (), withModuleContext : Rule.Forbidden } But (|>) is piping it to a function that expects: @@ -21,7 +21,7 @@ But (|>) is piping it to a function that expects: { a | canAddModuleVisitor : () , hasAtLeastOneVisitor : () - , withModuleContext : Rule.NotNeeded + , withModuleContext : Rule.Forbidden } Hint: Seems like a record field typo. Maybe hasAtLeastOneVisitor should be diff --git a/phantom-type-tests/WithModuleContext_AtMostOnce.txt b/phantom-type-tests/WithModuleContext_AtMostOnce.txt index 1a2174ba..5ceb29f8 100644 --- a/phantom-type-tests/WithModuleContext_AtMostOnce.txt +++ b/phantom-type-tests/WithModuleContext_AtMostOnce.txt @@ -20,7 +20,7 @@ The argument is: Rule.ProjectRuleSchema () () - { hasAtLeastOneVisitor : (), withModuleContext : Rule.NotNeeded } + { hasAtLeastOneVisitor : (), withModuleContext : Rule.Forbidden } But (|>) is piping it to a function that expects: diff --git a/src/Review/Rule.elm b/src/Review/Rule.elm index 31f2d62c..ba038ab5 100644 --- a/src/Review/Rule.elm +++ b/src/Review/Rule.elm @@ -9,7 +9,7 @@ module Review.Rule exposing , withFixes , ignoreErrorsForDirectories, ignoreErrorsForFiles , review - , Required, NotNeeded + , Required, Forbidden ) {-| This module contains functions that are used for writing rules. @@ -235,7 +235,7 @@ reason or seemingly inappropriately. # Internals -@docs Required, NotNeeded +@docs Required, Forbidden -} @@ -950,7 +950,7 @@ You can't use [`withElmJsonModuleVisitor`](#withElmJsonModuleVisitor) or [`withD in project rules. Instead, you should use [`withElmJsonProjectVisitor`](#withElmJsonProjectVisitor) or [`withDependenciesProjectVisitor`](#withDependenciesProjectVisitor). -} -newProjectRuleSchema : String -> projectContext -> ProjectRuleSchema projectContext moduleContext { canAddModuleVisitor : (), withModuleContext : NotNeeded } +newProjectRuleSchema : String -> projectContext -> ProjectRuleSchema projectContext moduleContext { canAddModuleVisitor : (), withModuleContext : Forbidden } newProjectRuleSchema name_ initialProjectContext = ProjectRuleSchema { name = name_ @@ -966,7 +966,7 @@ newProjectRuleSchema name_ initialProjectContext = {-| Create a [`Rule`](#Rule) from a configured [`ProjectRuleSchema`](#ProjectRuleSchema). -} -fromProjectRuleSchema : ProjectRuleSchema projectContext moduleContext { schemaState | withModuleContext : NotNeeded, hasAtLeastOneVisitor : () } -> Rule +fromProjectRuleSchema : ProjectRuleSchema projectContext moduleContext { schemaState | withModuleContext : Forbidden, hasAtLeastOneVisitor : () } -> Rule fromProjectRuleSchema (ProjectRuleSchema schema) = Rule schema.name Exceptions.init @@ -1015,8 +1015,8 @@ type Required {-| Used for phantom type constraints. You can safely ignore this type. -} -type NotNeeded - = NotNeeded +type Forbidden + = Forbidden {-| TODO Documentation @@ -1027,7 +1027,7 @@ withModuleContext : , foldProjectContexts : projectContext -> projectContext -> projectContext } -> ProjectRuleSchema projectContext moduleContext { schemaState | canAddModuleVisitor : (), withModuleContext : Required } - -> ProjectRuleSchema projectContext moduleContext { schemaState | hasAtLeastOneVisitor : (), withModuleContext : NotNeeded } + -> ProjectRuleSchema projectContext moduleContext { schemaState | hasAtLeastOneVisitor : (), withModuleContext : Forbidden } withModuleContext moduleContext (ProjectRuleSchema schema) = let visitors : List (ModuleRuleSchema {} moduleContext -> ModuleRuleSchema { hasAtLeastOneVisitor : () } moduleContext)