jfmengels / elm-review-documentation

Provides elm-review rules to help with the quality and correctness of your Elm project's documentation
https://package.elm-lang.org/packages/jfmengels/elm-review-documentation/latest/
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

New rule: Make sure that all the exposed things in the module have a corresponding @docs and vice-versa #5

Closed jfmengels closed 3 years ago

jfmengels commented 4 years ago

What the rule should do:

Report problems around misuse of @docs

What problems does it solve:

Example of things the rule would report:

module A exposing (a, b)
{-|
Here, both a and c should be reported: a is exposed but not documentated, and c is documentation but not exposed
@docs b, c 
-}

import ...
module A exposing (a, b)
{-|@docs a -- should not appear on the first line, otherwise docs will look broken

  @docs b -- should appear at the start

-- should have at least one thing
@docs

-- should only contain valid types/functions
@docs 1
@docs A(..)

-- should be separated by `,`
@docs c d

-- should not document the same thing twice
@docs e
@docs e
-}

import ...

{-|
@docs -- should only appear in the module documentation, not in function/types' documentation
-}
init = ()

Example of things the rule would not report:

module A exposing (a, b)
{-|
@docs a, b
@docs c
-}
import ...

{-| something
-}
init = ()

When (not) to enable this rule:

If you are working on an application and it has no documentation?

I am looking for: