Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--format ignore_file not working as intended? #456

Open
x-ji opened this issue Mar 29, 2022 · 5 comments
Open

--format ignore_file not working as intended? #456

x-ji opened this issue Mar 29, 2022 · 5 comments

Comments

@x-ji
Copy link
Contributor

x-ji commented Mar 29, 2022

Environment

  • Elixir & Erlang/OTP versions (elixir --version):
Erlang/OTP 24 [erts-12.2] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1]
Elixir 1.13.3 (compiled with Erlang/OTP 24)
  • Which version of Dialyxir are you using? (cat mix.lock | grep dialyxir):
  "dialyxir": {:hex, :dialyxir, "1.1.0", "c5aab0d6e71e5522e77beff7ba9e08f8e02bad90dfbeffae60eaf0cb47e29488",
[:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "07ea8e49c45f15264ebe6d5b93799d4dd56a44036cf42d0ad9c960bc266c0b9a"},

Current behavior

I'm not sure if I didn't correctly understand how it's supposed to work, it seems to me that when I pass in the option --format ignore_file, the output is the same as when I don't pass in any --format option, and thus cannot be used for .dialyzer_ignore.exs?

I'm looking at the output to stderr.

Expected behavior

The output by mix dialyzer --format ignore_file can be used in the ignore file.

@x-ji
Copy link
Contributor Author

x-ji commented Mar 29, 2022

Putting the output of mix dialyzer --format dialyzer in a dialyzer.ignore-warnings file worked. Not sure if the new format would be preferred though.

@jeremyjh
Copy link
Owner

Yeah I think the docs could definitely be improved regarding this - its for the legacy warning format.

@x-ji
Copy link
Contributor Author

x-ji commented Mar 29, 2022

Thanks. Does it mean I should actually use mix dialyzer --format short for the format corresponding to .dialyzer_ignore.exs, and mix dialyzer --format dialyzer for the old format (dialyzer.ignore-warnings)? Does the flag --format ignore_file still have an effect/purpose? (I seem to still see it in the source code of dialyxir, but the output seems to be the same as when dialyzer is run without the flag, which confuses me. Sorry if I still didn't get it right 😅 .)

I can also make a small PR to fix the docs.

@jeremyjh
Copy link
Owner

jeremyjh commented Apr 1, 2022

Yes --format short can be used to get the description, you just have to put it in quotes/braces for .dialyzer_ignore.exs.

@x-ji
Copy link
Contributor Author

x-ji commented Apr 1, 2022

I made a PR at #457. Hope it makes sense (I removed the mention of --format ignore_file from the README, though the option ignore_file still remains in the code).

jeremyjh added a commit that referenced this issue Apr 4, 2022
…gnore-file

#456 Improve documentation of the ignore file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants