Skip to content

Commit 7a2274c

Browse files
committed
feature: Add enabled field to Specification :breaking:
- Make parameters, languages and enabled fields non-optional and defaulting to their default values. This way we can support current tools in a non-breaking. This plays well with play-json library using `.using[Json.WithDefaultValues]` that make `Format`s accept json objects without the currently added `enabled` field.
1 parent e37d68b commit 7a2274c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/scala/com/codacy/plugins/api/results/Pattern.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ object Pattern {
3232
level: Result.Level,
3333
category: Category,
3434
subcategory: Option[Subcategory],
35-
parameters: Option[Set[Parameter.Specification]],
36-
languages: Option[Set[Language]] = None) {
35+
parameters: Set[Parameter.Specification] = Set.empty,
36+
languages: Set[Language] = Set.empty,
37+
enabled: Boolean = false) {
3738
require(subcategory.isEmpty || category == Category.Security, "Security is the only category having subcategories")
3839
}
3940

0 commit comments

Comments
 (0)