leiningen icon indicating copy to clipboard operation
leiningen copied to clipboard

suppress warnings by type and/or regex

Open githorse opened this issue 3 years ago • 4 comments

I get the following warnings on most lein tasks:

Warning: implicit hook found: lein-protoc.plugin/hooks 
Hooks are deprecated and will be removed in a future version.
Warning: implicit hook found: lein-dotenv.plugin/hooks 
Hooks are deprecated and will be removed in a future version.

Nothing I personally can do about these except hope the plugins get fixed before they stop working. It would be nice to ignore the warnings in the meantime. Is this possible? (This is a pretty common feature in other build tools -- maybe I've missed it here.)

githorse avatar Apr 30 '21 17:04 githorse

What version of Leiningen are you using? I think those warnings are gone in the latest stable release.

technomancy avatar Apr 30 '21 17:04 technomancy

I'm on 2.9.1 (Linux Mint 20 apt-get). Just upgraded but I still see it so I assume my version is behind.

However, this question is more general than that -- I assume that warnings like this will come up from time to time in various dependencies (as they have in every project I've ever been on), and it's handy to ignore the ones you have explicitly decided not to fix.

githorse avatar Apr 30 '21 20:04 githorse

Ah sure. You can export LEIN_SILENT to suppress warnings.

Most of the remaining warnings come from things that are directly in your control in project.clj; other than that we only have warnings for calling functions which are deprecated; in those cases it's usually easy to send a PR which calls the new function if a plugin hasn't been updated yet.

technomancy avatar Apr 30 '21 20:04 technomancy

Thinking about this more, I would accept a patch for a way to supply a regex for silencing warnings. It would probably be best as an environment variable, since warnings can happen before profiles are parsed.

technomancy avatar May 01 '21 00:05 technomancy