Skip to content

Commit

Permalink
Merge pull request #285 from parroty/doc-silence-cover-warnings
Browse files Browse the repository at this point in the history
Update README with instructions on silencing OTP warnings
  • Loading branch information
parroty committed Jul 14, 2022
2 parents 0bc6940 + 23a883a commit 9eca9a5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -468,6 +468,18 @@ defmodule MyModule do
end
```
### Silence OTP Cover Warnings
To remove OTP warnings about modules or specific logging, you can copy the `cover.erl` file under `src/` of your Elixir project and modify it to remove the warnings, as a tentative solution.
- Remove the 2 lines below to remove the "WARNING: Module already imported from ..." log
https://github.com/erlang/otp/blob/131398b54cca5f1ae95ed268274936d2efde8c39/lib/tools/src/cover.erl#L1553-L1554
- If you do not want the imported info cluttering your test output, replace the function in https://github.com/erlang/otp/blob/131398b54cca5f1ae95ed268274936d2efde8c39/lib/tools/src/cover.erl#L1520-L1525 with
```
imported_info(_Text,_Module,_Imported) ->
ok.
```
### Notes
- If mock library is used, it will show some warnings during execution.
- https://github.com/eproxus/meck/pull/17
Expand Down

0 comments on commit 9eca9a5

Please sign in to comment.