Skip to content

Commit

Permalink
Extract function
Browse files Browse the repository at this point in the history
  • Loading branch information
jfmengels committed Sep 8, 2021
1 parent 9bb9132 commit 8478bdd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Docs/ReviewLinksAndSections.elm
Expand Up @@ -694,11 +694,16 @@ errorForFile projectContext sectionsPerModule fileLinksAndSections (MaybeExposed
Just (reportLinkToMissingReadme fileLinksAndSections.fileKey linkRange)

SyntaxHelp.External target ->
if projectContext.isApplication || String.contains "://" target then
Nothing
reportErrorsForExternalTarget projectContext.isApplication fileLinksAndSections.fileKey linkRange target

else
Just (reportLinkToExternalResourceWithoutProtocol fileLinksAndSections.fileKey linkRange)

reportErrorsForExternalTarget : Bool -> FileKey -> Range -> String -> Maybe (Rule.Error scope)
reportErrorsForExternalTarget isApplication fileKey linkRange target =
if isApplication || String.contains "://" target then
Nothing

else
Just (reportLinkToExternalResourceWithoutProtocol fileKey linkRange)


reportIfMissingSection : FileKey -> List Section -> Bool -> Range -> SyntaxHelp.Link -> Maybe (Rule.Error scope)
Expand Down

0 comments on commit 8478bdd

Please sign in to comment.