Hi,

I want to say upfront that i know this kind of proposal happened before, 
and i know the stance is "if you disable warnings, why have warnings at 
all" if i remember correctly. Which i support.

That said, i think there is now an opportunity for a new discussion around 
a particular kind of tuning for warnings.

*Proposal*
Tag all elixir deprecation with @deprecated and @since (hard ?)

Offer a flag to restrict deprecation warnings to only warnings before a 
given version. It could be a flag to mix for xref like: 

> --only-deprecated-before 1.6


This would only generate warnings for deprecations that are anterior to 
deprecation in 1.6+

*Why ?*

1. The compile flag --warnings-as-errors do make sense to use, among other 
reasons due to warnings like this one:

>  function Foo.bar/0 is undefined (module Foo is not available)

because they do tend to be real errors in the code most of the time.
 (I know there have been some discussions for elixir 2.0)

2. Elixir is deprecating a lot recently on each versions. Which is great, 
but make for a really noisy output on CI, especially when some dependencies 
want to keep compatibility with 1.4+ ( a good example is Phoenix recently). 
But it also happens a lot if you want to compile with 1.6 locally your 
library to get better error message and all, but you target 1.4+ for the 
user of your library.

Now that we have the @deprecated and the @since attributes, there is a 
window to offer the possibility to filter these warnings for deprecations.

It would benefit CI noisiness and make it easier to support library 
maintainer that want to bump up their versions support without going full 
bleeding edge. Yes they can compile with the old version and will probably 
keep doing it, but when newer versions also provides niceties for 
development...

*Why not ?*

Some of my own counter arguments :
Hard to do. And useless before 1.6 as we do not have @deprecated and @since 
before that.
Small value added, you should develop and compile with the version you 
target.
Deps warning are already ignored for `--warnings-as-errors`
Hiding warnings is a bad pattern, as people will not fix their stuff.
This is not doable right now without the change coming with 1.7, or would 
need more changes. (no idea if true here)


Would love to hear your thoughts on it. I would happily take a swing at 
trying to work on that if the team want to go with it.

Thomas Depierre

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/1268ddba-55a1-43dd-84a8-af3919873211%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to