Skip to content

Commit e51d679

Browse files
author
Daniel Reigada
authored
Merge pull request #45 from codacy/add-unapply-to-spec
feature: Add unapply method to pattern specification
2 parents 66c76ce + 412330d commit e51d679

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ object Pattern {
4646
languages: Option[Set[Language]] = None)
4747
extends Specification
4848

49+
def unapply(s: Pattern.Specification): Option[(Pattern.Id,
50+
Result.Level,
51+
Category,
52+
Option[Subcategory],
53+
Option[Set[Parameter.Specification]],
54+
Option[Set[Language]])] = s match {
55+
case si: SpecificationImpl =>
56+
SpecificationImpl.unapply(si)
57+
}
58+
4959
def apply(patternId: Pattern.Id,
5060
level: Result.Level,
5161
category: Category,

0 commit comments

Comments
 (0)