You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#530
One scenario where multiple formatters is helpful is on CI where you want to use the GitHub
formatter along with a more verbose formatter to see more about the specific failures (especially
when viewing the CI logs directly).
Copy file name to clipboardExpand all lines: README.md
+15-15
Original file line number
Diff line number
Diff line change
@@ -37,21 +37,21 @@ mix dialyzer
37
37
38
38
### Command line options
39
39
40
-
*`--no-compile` - do not compile even if needed.
41
-
*`--no-check` - do not perform (quick) check to see if PLT needs to be updated.
42
-
*`--ignore-exit-status` - display warnings but do not halt the VM or return an exit status code.
43
-
*`--list-unused-filters` - list unused ignore filters useful for CI. do
44
-
not use with `mix do`.
45
-
*`--plt` - only build the required PLT(s) and exit
46
-
*`--format short` - format the warnings in a compact format, suitable for ignore file using Elixir term format.
47
-
*`--format raw` - format the warnings in format returned before Dialyzer formatting.
48
-
*`--format dialyxir` - format the warnings in a pretty printed format. (default)
49
-
*`--format dialyzer` - format the warnings in the original Dialyzer format, suitable for ignore file using simple string matches.
50
-
*`--format github` - format the warnings in the Github Actions message format.
51
-
*`--format ignore_file` - format the warnings in {file, warning} format for Elixir Format ignore file.
52
-
*`--format ignore_file_strict` - format the warnings in {file, short_description} format for Elixir Format ignore file.
53
-
*`--quiet` - suppress all informational messages.
54
-
*`--quiet-with-result` - suppress all informational messages except for the final result message
40
+
*`--no-compile`- do not compile even if needed.
41
+
*`--no-check`- do not perform (quick) check to see if PLT needs to be updated.
42
+
*`--ignore-exit-status`- display warnings but do not halt the VM or return an exit status code.
43
+
*`--list-unused-filters`- list unused ignore filters useful for CI. do not use with `mix do`.
44
+
*`--plt` - only build the requir ed PLT(s) and exit.
45
+
*`--format <name>` - Specify the format for the warnings, can be specified multiple times to print warnings multiple times in different output formats. Defaults to `dialyxir`.
46
+
*`--format short` - format the warnings in a compact format, suitable for ignore file using Elixir term format.
47
+
*`--format raw` - format the warnings in format returned before Dialyzer formatting.
48
+
*`--format dialyxir` - format the warnings in a pretty printed format. (default)
49
+
*`--format dialyzer` - format the warnings in the original Dialyzer format, suitable for ignore file using simple string matches.
50
+
*`--format github` - format the warnings in the Github Actions message format.
51
+
*`--format ignore_file` - format the warnings in {file, warning} format for Elixir Format ignore file.
52
+
*`--format ignore_file_strict` - format the warnings in {file, short_description} format for Elixir Format ignore file.
53
+
*`--quiet` - suppress all informational messages.
54
+
*`--quiet-with-result`- suppress all informational messages except for the final result message.
55
55
56
56
Warning flags passed to this task are passed on to `:dialyzer` - e.g.
Copy file name to clipboardExpand all lines: docs/github_actions.md
+5-2
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,10 @@ steps:
42
42
priv/plts
43
43
44
44
- name: Run dialyzer
45
-
run: mix dialyzer --format github
45
+
# Two formats are included for ease of debugging and it is lightly recommended to use both, see https://github.com/jeremyjh/dialyxir/issues/530 for reasoning
46
+
# --format github is helpful to print the warnings in a way that GitHub understands and can place on the /files page of a PR
47
+
# --format dialyxir allows the raw GitHub actions logs to be useful because they have the full warning printed
Copy file name to clipboardExpand all lines: lib/mix/tasks/dialyzer.ex
+10-9
Original file line number
Diff line number
Diff line change
@@ -17,13 +17,14 @@ defmodule Mix.Tasks.Dialyzer do
17
17
* `--list-unused-filters` - list unused ignore filters useful for CI. do
18
18
not use with `mix do`.
19
19
* `--plt` - only build the required PLT(s) and exit
20
-
* `--format short` - format the warnings in a compact format
21
-
* `--format raw` - format the warnings in format returned before Dialyzer formatting
22
-
* `--format dialyxir` - format the warnings in a pretty printed format
23
-
* `--format dialyzer` - format the warnings in the original Dialyzer format
24
-
* `--format github` - format the warnings in the Github Actions message format
25
-
* `--format ignore_file` - format the warnings in {file, warning} format for Elixir Format ignore file
26
-
* `--format ignore_file_strict` - format the warnings in {file, short_description} format for Elixir Format ignore file.
20
+
* `--format <name>` - Specify the format for the warnings, can be specified multiple times to print warnings multiple times in different output formats. Defaults to `dialyxir`.
21
+
* `--format short` - format the warnings in a compact format, suitable for ignore file using Elixir term format.
22
+
* `--format raw` - format the warnings in format returned before Dialyzer formatting
23
+
* `--format dialyxir` - format the warnings in a pretty printed format (default)
24
+
* `--format dialyzer` - format the warnings in the original Dialyzer format
25
+
* `--format github` - format the warnings in the Github Actions message format
26
+
* `--format ignore_file` - format the warnings in {file, warning} format for Elixir Format ignore file
27
+
* `--format ignore_file_strict` - format the warnings in {file, short_description} format for Elixir Format ignore file.
27
28
* `--quiet` - suppress all informational messages
28
29
* `--quiet-with-result` - suppress all informational messages except for the final result message
29
30
@@ -154,7 +155,7 @@ defmodule Mix.Tasks.Dialyzer do
154
155
quiet: :boolean,
155
156
quiet_with_result: :boolean,
156
157
raw: :boolean,
157
-
format: :string
158
+
format: [:string,:keep]
158
159
)
159
160
160
161
defrun(args)do
@@ -265,7 +266,7 @@ defmodule Mix.Tasks.Dialyzer do
test"Warning is printed when unknown format is requested"do
73
+
args=["dialyzer","--format","foo"]
74
+
env=[{"MIX_ENV","prod"}]
75
+
{result,0}=System.cmd("mix",args,env: env)
76
+
77
+
assertresult=~
78
+
"Unrecognized formatter foo received. Known formatters are dialyzer, dialyxir, github, ignore_file, ignore_file_string, raw, and short. Falling back to dialyxir."
0 commit comments