develooper Front page | perl.perl5.porters | Postings from November 2021

Protocol/convention for optional lint-type warnings

Thread Next
Paul "LeoNerd" Evans
November 19, 2021 16:55
Protocol/convention for optional lint-type warnings
Message ID:
A few times in either perl core, or some modules like syntax modules,
I've found places where I've wanted to add very-optional warnings that
aren't enabled by default, but suggest to the author that "you're doing
something a bit weird here", or maybe "eh; this feature might be
removed in a later version so you want to swap to something else", but
it isn't yet a problem that should warn for end-users.

I'm thinking there ought to be some standard way to enable these
non-default warnings that both perl core and whatever modules can all
follow, to enable these things. I'd then want to enable that when
doing my author testing so I can see these extra things.

It shouldn't require any source changes (so any lexical pragmas etc..
are no good) because I'd want to optionally enable it during auther
testing alone, but I wonder about using an environment variable.

For example, I could

  $ PERL_WARN_ME_HARDER=1 ./Build test
  t/00use.t ..... Hey you probably shouldn't be doing this weird thing
  at line 123.
  t/00use.t ..... ok

Before I try to create something new (or just propose the-above), I
wonder: Are there any existing precedents for this kind of thing

Paul "LeoNerd" Evans      |  |

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About