Skip to content

Commit

Permalink
feat!: change Readability and Consistency diagnostic severity to hint (
Browse files Browse the repository at this point in the history
  • Loading branch information
mhanberg committed Jun 6, 2023
1 parent a1b289f commit 060763e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
8 changes: 6 additions & 2 deletions lib/credo_language_server.ex
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,12 @@ defmodule CredoLanguageServer do
defp category_to_severity(:refactor), do: DiagnosticSeverity.error()
defp category_to_severity(:warning), do: DiagnosticSeverity.warning()
defp category_to_severity(:design), do: DiagnosticSeverity.information()
defp category_to_severity(:consistency), do: DiagnosticSeverity.hint()
defp category_to_severity(:readability), do: DiagnosticSeverity.hint()

defp category_to_severity(:consistency),
do: DiagnosticSeverity.information()

defp category_to_severity(:readability),
do: DiagnosticSeverity.information()

defp wait_until(cb) do
wait_until(120, cb)
Expand Down
14 changes: 7 additions & 7 deletions test/credo_language_server_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ defmodule CredoLanguageServerTest do
assert_notification "textDocument/publishDiagnostics",
%{
"uri" => ^uri,
"diagnostics" => [%{"severity" => 4}]
"diagnostics" => [%{"severity" => 3}]
}
end

Expand All @@ -160,8 +160,8 @@ defmodule CredoLanguageServerTest do
%{
"uri" => ^uri,
"diagnostics" => [
%{"severity" => 4},
%{"severity" => 4}
%{"severity" => 3},
%{"severity" => 3}
]
}

Expand Down Expand Up @@ -197,8 +197,8 @@ defmodule CredoLanguageServerTest do
}

[
%{"severity" => 4} = diagnostic,
%{"severity" => 4}
%{"severity" => 3} = diagnostic,
%{"severity" => 3}
] = Enum.sort(diagnostics)

assert :ok ==
Expand Down Expand Up @@ -307,8 +307,8 @@ defmodule CredoLanguageServerTest do
})

[
%{"severity" => 4},
%{"severity" => 4} = diagnostic
%{"severity" => 3},
%{"severity" => 3} = diagnostic
] = Enum.sort(diagnostics)

assert :ok ==
Expand Down

0 comments on commit 060763e

Please sign in to comment.