Skip to content

Commit c57345d

Browse files
committed
Add --warnings-as-errors flag for non-zero exit code
1 parent fcfd2b9 commit c57345d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/ex_doc/config.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ defmodule ExDoc.Config do
4343
version: nil,
4444
authors: nil,
4545
skip_undefined_reference_warnings_on: [],
46-
package: nil
46+
package: nil,
47+
warnings_as_errors: false
4748

4849
@type t :: %__MODULE__{
4950
apps: [atom()],
@@ -78,6 +79,7 @@ defmodule ExDoc.Config do
7879
version: nil | String.t(),
7980
authors: nil | [String.t()],
8081
skip_undefined_reference_warnings_on: [String.t()],
81-
package: :atom | nil
82+
package: :atom | nil,
83+
warnings_as_errors: boolean()
8284
}
8385
end

lib/mix/tasks/docs.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ defmodule Mix.Tasks.Docs do
2121
* `--language` - Specifies the language to annotate the
2222
EPUB output in valid [BCP 47](https://tools.ietf.org/html/bcp47)
2323
24+
* `--warnings-as-errors` - Exits with non-zero exit code if any warnings are found
25+
2426
The command line options have higher precedence than the options
2527
specified in your `mix.exs` file below.
2628
@@ -299,7 +301,8 @@ defmodule Mix.Tasks.Docs do
299301
canonical: :string,
300302
formatter: :keep,
301303
language: :string,
302-
output: :string
304+
output: :string,
305+
warnings_as_errors: :boolean
303306
]
304307

305308
@aliases [n: :canonical, f: :formatter, o: :output]

0 commit comments

Comments
 (0)