Rename NotNeeded phantom type to Forbidden

This commit is contained in:
Jeroen Engels 2020-03-21 12:04:04 +01:00
parent 097dbdb7b0
commit 9a983f1190
6 changed files with 15 additions and 15 deletions

View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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)