1{-# OPTIONS_GHC -Wall #-}
2module Reporting.Error.Docs where
4import qualified Reporting.Error.Helpers as Help
5import qualified Reporting.Report as Report
10 | OnlyInDocs String [String]
11 | OnlyInExports [String]
18toReport :: Error -> Report.Report
22 Report.simple "DOCUMENTATION ERROR"
23 ( "You must have a documentation comment between the module declaration and the\n"
26 "Learn how at <http://package.elm-lang.org/help/documentation-format>"
28 OnlyInDocs name suggestions ->
29 Report.simple "DOCUMENTATION ERROR"
30 ("Your module documentation includes `" ++ name ++ "` which is not exported.")
31 ("Is it misspelled? Should it be exported? " ++ Help.maybeYouWant suggestions)
33 OnlyInExports names ->
36 ( "The following exports do not appear in your module documentation:\n"
37 ++ concatMap ("\n " ++) names
39 ( "All exports must be listed in the module documentation after a @docs keyword.\n"
40 ++ "Learn how at <http://package.elm-lang.org/help/documentation-format>"
44 Report.simple "DOCUMENTATION ERROR"
45 ("The value `" ++ name ++ "` does not have a documentation comment.")
46 ( "Documentation comments start with {-| and end with -}. They should provide a\n"
47 ++ "clear description of how they work, and ideally a small code example. This is\n"
48 ++ "extremely valuable for users checking out your package!\n\n"
49 ++ "If you think the docs are clearer without any words, you can use an empty\n"
50 ++ "comment {-|-} which should be used sparingly. Maybe you have a section of 20\n"
51 ++ "values all with the exact same type. The docs may read better if they are all\n"
52 ++ "described in one place.\n\n"
53 ++ "Learn more at <http://package.elm-lang.org/help/documentation-format>"
57 Report.simple "MISSING ANNOTATION"
58 ("The value `" ++ name ++ "` does not have a type annotation.")
59 ( "Adding type annotations is best practice and it gives you a chance to name\n"
60 ++ "types and type variables so they are as easy as possible to understand!"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list