Commit 973d042 1 parent 2143bd9 commit 973d042 Copy full SHA for 973d042
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 @@ -691,14 +691,13 @@ defmodule Credo.Check do
691
691
- `:column` Sets the issue's column.
692
692
- `:exit_status` Sets the issue's exit_status.
693
693
- `:severity` Sets the issue's severity.
694
+ - `:category` Sets the issue's category.
694
695
"""
695
696
def format_issue ( issue_meta , opts , check ) do
696
697
source_file = IssueMeta . source_file ( issue_meta )
697
698
params = IssueMeta . params ( issue_meta )
698
- issue_category = Params . category ( params , check )
699
- issue_base_priority = Params . priority ( params , check )
700
-
701
- priority = Priority . to_integer ( issue_base_priority )
699
+ issue_category = opts [ :category ] || Params . category ( params , check )
700
+ priority = params |> Params . priority ( check ) |> Priority . to_integer ( )
702
701
703
702
exit_status_or_category =
704
703
opts [ :exit_status ] || Params . exit_status ( params , check ) || issue_category
Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ defmodule Credo.CheckTest do
66
66
line_no: 3 ,
67
67
column: 15 ,
68
68
exit_status: 23 ,
69
- severity: 11
69
+ severity: 11 ,
70
+ category: :custom_category
70
71
)
71
72
]
72
73
end
@@ -89,6 +90,7 @@ defmodule Credo.CheckTest do
89
90
assert issue . column == 15
90
91
assert issue . exit_status == 23
91
92
assert issue . severity == 11
93
+ assert issue . category == :custom_category
92
94
end )
93
95
end
94
96
end
You can’t perform that action at this time.
0 commit comments