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

Docs.ReviewAtDocs Allows All Exposed Functions Not to Be Documented #18

Open matzko opened 1 year ago

matzko commented 1 year ago

Summary

The documentation for Docs.ReviewAtDocs rule says

Once there are no more issues of malformed @docs, the rule will report about:

  Missing @docs for exposed elements

but this doesn't seem to be the case if no functions are exposed.

Actual Behavior

As an example, run npm run review in the example I've attached as no-docs-example.zip and you'll see the following actual output:

-- ELM-REVIEW ERROR ---------------- src/ModuleWithOneExposedFunctionDoc.elm:3:7

Docs.ReviewAtDocs: Missing @docs reference for exposed `anotherThing`

2|     ( oneThing
3|     , anotherThing
         ^^^^^^^^^^^^
4|     )

There is no @docs reference for this element. Maybe you exposed or renamed it
recently.

Please add a @docs reference to it the module documentation (the one at the top
of the module) like this:

{-|
@docs anotherThing
-}

I found 1 error in 1 file.

Expected Behavior

But I would expect, when running npm run review, that in addition to the error above there would be a message about how ModuleWithoutExposedFunctionDocs fails to expose both oneThing and anotherThing

jfmengels commented 1 year ago

The documentation for the rule says the following

If a module does not have any usage of @docs, then the rule will not report anything, as the rule will assume the module is not meant to be documented at this moment in time. An exception is made for exposed modules of a package.

so this intended behavior. Would you personally like this rule to be more strict? Or to be more strict through configuration?