mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-09-11 16:16:09 +03:00
Add visitor for the changelog
This commit is contained in:
parent
5322a8a5d1
commit
da70f8c64f
@ -49,6 +49,7 @@ rule : Rule
|
||||
rule =
|
||||
Rule.newProjectRuleSchema "Docs.NoMissingChangelogEntry" initialProjectContext
|
||||
|> Rule.withElmJsonProjectVisitor elmJsonVisitor
|
||||
|> Rule.withExtraFilesProjectVisitor [ "CHANGELOG.md" ] extraFilesVisitor
|
||||
|> Rule.fromProjectRuleSchema
|
||||
|
||||
|
||||
@ -77,3 +78,14 @@ elmJsonVisitor maybeElmJsonData context =
|
||||
|
||||
Nothing ->
|
||||
( [], context )
|
||||
|
||||
|
||||
extraFilesVisitor : List { path : String, content : String } -> ProjectContext -> ( List (Rule.Error { useErrorForModule : () }), ProjectContext )
|
||||
extraFilesVisitor files context =
|
||||
case List.head files of
|
||||
Just { content } ->
|
||||
( [], context )
|
||||
|
||||
Nothing ->
|
||||
--( [ Rule.error { useErrorForModule = () } "Missing CHANGELOG.md file" ], context
|
||||
( [], context )
|
||||
|
Loading…
Reference in New Issue
Block a user