File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -687,14 +687,13 @@ defmodule Credo.Check do
687
687
- `:column` Sets the issue's column.
688
688
- `:exit_status` Sets the issue's exit_status.
689
689
- `:severity` Sets the issue's severity.
690
+ - `:category` Sets the issue's category.
690
691
"""
691
692
def format_issue ( issue_meta , opts , check ) do
692
693
source_file = IssueMeta . source_file ( issue_meta )
693
694
params = IssueMeta . params ( issue_meta )
694
- issue_category = Params . category ( params , check )
695
- issue_base_priority = Params . priority ( params , check )
696
-
697
- priority = Priority . to_integer ( issue_base_priority )
695
+ issue_category = opts [ :category ] || Params . category ( params , check )
696
+ priority = params |> Params . priority ( check ) |> Priority . to_integer ( )
698
697
699
698
exit_status_or_category =
700
699
opts [ :exit_status ] || Params . exit_status ( params , check ) || issue_category
Original file line number Diff line number Diff line change @@ -68,7 +68,8 @@ defmodule Credo.CheckTest do
68
68
line_no: 3 ,
69
69
column: 15 ,
70
70
exit_status: 23 ,
71
- severity: 11
71
+ severity: 11 ,
72
+ category: :custom_category
72
73
)
73
74
]
74
75
end
@@ -91,6 +92,7 @@ defmodule Credo.CheckTest do
91
92
assert issue . column == 15
92
93
assert issue . exit_status == 23
93
94
assert issue . severity == 11
95
+ assert issue . category == :custom_category
94
96
end )
95
97
end
96
98
You can’t perform that action at this time.
0 commit comments