@@ -16,26 +16,31 @@ and [silencer](https://github.com/ghik/silencer) plugin for warning suppression.
16
16
17
17
Here's a list of currently supported rules:
18
18
19
- | Name | Default level | Description |
20
- | --- | --- | --- |
21
- | ` importJavaUtil ` | warning | Rejects direct imports of ` java.util ` package. |
19
+ | Name | Default level | Description |
20
+ | ---------------------------- | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
21
+ | ` importJavaUtil ` | warning | Rejects direct imports of ` java.util ` package. |
22
22
| ` valueEnumExhaustiveMatch ` | warning | Enables (limited) exhaustive pattern match checking for [ ` ValueEnum ` s] ( https://github.com/AVSystem/scala-commons/blob/master/commons-core/src/main/scala/com/avsystem/commons/misc/ValueEnum.scala ) . |
23
- | ` any2stringadd ` | off | Disables ` any2stringadd ` (concatenating arbitrary values with strings using ` + ` ). |
24
- | ` bincompat ` | warning | Enables [ ` @bincompat ` ] ( https://github.com/AVSystem/scala-commons/blob/master/commons-core/src/main/scala/com/avsystem/commons/annotation/bincompat.scala ) checking |
25
- | ` showAst ` | error | Handles [ ` @showAst ` ] ( https://github.com/AVSystem/scala-commons/blob/master/commons-core/src/main/scala/com/avsystem/commons/annotation/showAst.scala ) . |
26
- | ` findUsages ` | warning | Issues a message for every occurrence of any of the symbols listed in the argument of this rule |
27
- | ` varargsAtLeast ` | warning | Enables [ ` @atLeast ` ] ( https://github.com/AVSystem/scala-commons/blob/master/commons-core/src/main/scala/com/avsystem/commons/annotation/atLeast.scala ) checking |
28
- | ` macroPrivate ` | warning | Enables [ ` @macroPrivate ` ] ( https://github.com/AVSystem/scala-commons/blob/master/commons-core/src/main/scala/com/avsystem/commons/annotation/macroPrivate.scala ) checking |
29
- | ` explicitGenerics ` | warning | Enables [ ` @explicitGenerics ` ] ( https://github.com/AVSystem/scala-commons/blob/master/commons-core/src/main/scala/com/avsystem/commons/annotation/explicitGenerics.scala ) checking |
23
+ | ` any2stringadd ` | off | Disables ` any2stringadd ` (concatenating arbitrary values with strings using ` + ` ). |
24
+ | ` bincompat ` | warning | Enables [ ` @bincompat ` ] ( https://github.com/AVSystem/scala-commons/blob/master/commons-core/src/main/scala/com/avsystem/commons/annotation/bincompat.scala ) checking |
25
+ | ` showAst ` | error | Handles [ ` @showAst ` ] ( https://github.com/AVSystem/scala-commons/blob/master/commons-core/src/main/scala/com/avsystem/commons/annotation/showAst.scala ) . |
26
+ | ` findUsages ` | warning | Issues a message for every occurrence of any of the symbols listed in the argument of this rule |
27
+ | ` varargsAtLeast ` | warning | Enables [ ` @atLeast ` ] ( https://github.com/AVSystem/scala-commons/blob/master/commons-core/src/main/scala/com/avsystem/commons/annotation/atLeast.scala ) checking |
28
+ | ` macroPrivate ` | warning | Enables [ ` @macroPrivate ` ] ( https://github.com/AVSystem/scala-commons/blob/master/commons-core/src/main/scala/com/avsystem/commons/annotation/macroPrivate.scala ) checking |
29
+ | ` explicitGenerics ` | warning | Enables [ ` @explicitGenerics ` ] ( https://github.com/AVSystem/scala-commons/blob/master/commons-core/src/main/scala/com/avsystem/commons/annotation/explicitGenerics.scala ) checking |
30
+ | ` discardedMonixTask ` | warning | Makes sure that expressions evaluating to Monix ` Task ` s are not accidentally discarded by conversion to ` Unit ` |
31
+ | ` throwableObjects ` | warning | Makes sure that objects are never used as ` Throwable ` s (unless they have stack traces disabled) |
32
+ | ` constantDeclarations ` | warning | Checks if constants are always declared as ` final val ` s with ` UpperCamelCase ` and no explicit type annotation for literal values |
30
33
31
34
Rules may be enabled and disabled in ` build.sbt ` with Scala compiler options:
32
35
33
36
``` scala
34
37
scalacOptions += " -P:AVSystemAnalyzer:<level><ruleName>,<level><ruleName>,..."
35
38
```
39
+
36
40
` <name> ` must be one of the rule names listed above or ` _ ` to apply to all rules.
37
41
38
42
` <level> ` may be one of:
43
+
39
44
* ` - ` to disable rule
40
45
* ` * ` for "info" level
41
46
* _ empty_ for "warning" level
0 commit comments