Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tanishiking/scalafix-check-scaladoc
Custom scalafix lint rule that examines scaladoc comments on classes, methods, values, type definitions, and so on.
https://github.com/tanishiking/scalafix-check-scaladoc
Last synced: 24 days ago
JSON representation
Custom scalafix lint rule that examines scaladoc comments on classes, methods, values, type definitions, and so on.
- Host: GitHub
- URL: https://github.com/tanishiking/scalafix-check-scaladoc
- Owner: tanishiking
- Created: 2018-11-18T15:55:34.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-27T15:40:21.000Z (almost 6 years ago)
- Last Synced: 2023-07-01T00:08:29.170Z (over 1 year ago)
- Language: Scala
- Homepage:
- Size: 14.6 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# scalafix-check-scaladoc
`scalafix-check-scaladoc` is a custom scalafix lint rule that examines scaladoc comments on classes, methods, values, type definitions, and so on.
It complains if they are visible from `scalafix-check-scaladoc` (it examines only **public** APIs by default) and are missing scaladoc comments.## Installation
- [Install scalafix](https://scalacenter.github.io/scalafix/)To permanently install the rule for a build, users can add the dependency to build.sbt by updating scalafixDependencies in ThisBuild.
```sh
// build.sbt
scalafixDependencies in ThisBuild +=
"com.github.tanishiking" %% "scalafix-check-scaladoc" % "0.0.2"
```Now `CheckScaladoc` is available.
```
// sbt shell
> scalafix CheckScaladoc
```or configure in `.scalafix.conf`
```
rules = [
CheckScaladoc
]
CheckScaladoc.files = ["src/main/scala/path/to/target/dir"]
```and run `> scalafix` (on sbt shell).
## Examples
```scala
MyCode.scala:45:1: error: [CheckScaladoc] case object Test doesn't have scaladoc
[error] case object Test
[error] ^^^^^^^^^^^^^^^^
``````scala
/** This object won't be complained because it has a scaladoc comment
*/
object Test {
val value = 1 // this will be complained because it doesn't have scaladoc comment/** This won't be complained
*/
var valueWithScaladoc = 1// this won't be complained even though it doesn't have scaladoc comment
// because privateVal is private and scalafix-check-scaladoc examines
// only on public APIs.
private val privateVal = 1
}
```## Configuration
|Name |Description |Default |
|------|-------------|---|
|`access`|Access modifier that allow scalafix-check-scaladoc to lint the API. For example, if `access=protected`, scalafix-check-scladoc examines on public or protected APIs. |`public` |
|`files` |Files or dictionaries to lint |`[]` |
|`requireDocOnInherited` | If `requireDocOnInherited=true`, scalafix-check-scaladoc will examines on inherited methods. |`false` |