Skip Menu |
 

This queue is for tickets about the criticism CPAN distribution.

Report information
The Basics
Id: 45907
Status: open
Priority: 0/
Queue: criticism

People
Owner: Nobody in particular
Requestors: DVWRIGHT [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.02
Fixed in: (no value)



Subject: 'requires' discrepancy
Download (untitled) / with headers
text/plain 612b
From the docs: "If you have a separate development environment, you can effectively bypass the criticism pragma by not installing Perl::Critic in the production environment. If Perl::Critic can't be loaded, then criticism just fails silently." From Build.pm: requires => { 'Perl::Critic' => 1.089 }, Am I missing something? If criticism requires Perl::Critic, then how can one install it (criticism), without installing Perl::Critic? Shouldn't the Build/Makefile be changed from requires to 'Suggests' (or something stronger, such as (the non-existant, "Pleeds" =>) :) Thanks, David
Download (untitled) / with headers
text/plain 710b
On Sat May 09 18:10:57 2009, DVWRIGHT wrote: Show quoted text
> Am I missing something? If criticism requires Perl::Critic, then how can > one install it (criticism), without installing Perl::Critic?
Good question. I hadn't really thought about it until now. At the moment, you have a couple options: * If using the cpan(1) utility, use the "force" option to install it without dependencies. * Install manually, using "perl Build.PL; ./Build install" or equivalent. Alternatively, I could modify the build process to ask you if you also want to install Perl-Critic. The default would be "yes" so if you want to do this automatically, you'd need to configure it with your distro-prefs. What do you think of that? -Jeff
Download (untitled) / with headers
text/plain 1.6k
On Mon May 11 18:35:15 2009, THALJEF wrote: Show quoted text
> On Sat May 09 18:10:57 2009, DVWRIGHT wrote: >
> > Am I missing something? If criticism requires Perl::Critic, then how can > > one install it (criticism), without installing Perl::Critic?
> > Good question. I hadn't really thought about it until now. At the > moment, you have a couple options: > > * If using the cpan(1) utility, use the "force" option to install it > without dependencies. > > * Install manually, using "perl Build.PL; ./Build install" or equivalent. > > Alternatively, I could modify the build process to ask you if you also > want to install Perl-Critic. The default would be "yes" so if you want > to do this automatically, you'd need to configure it with your distro-prefs. > > What do you think of that? > > -Jeff
I would rather that the build process was modified to be a 'suggests' with some sort of warning when Perl-Critic is not installed, "NOTICE: Perl-Critic is not installed, this module is disabled", or something to that effect. One downside to this approach is that when one has 'use criticism' in their code and receives no warnings, one may believe 'all's well'. (when in fact in may not be). Maybe for that case there could be a flag of some sort, 'use criticism qw/brutal verbose/'. 'verbose' which would warn 'Perl-Critic not installed', along with the 'normal'/expected code execution. I realize that without Perl-Critic, criticism has no function, but to look at it from another perspective. I think the point is that one doesn't want the overhead (or potential 'style' warnings,...) in a production environment, this is a tool for developers. (not sys admins) Thoughts? Thanks, David
Subject: Re: [rt.cpan.org #45907] 'requires' discrepancy
Date: Wed, 13 May 2009 00:40:01 -0700
To: bug-criticism [...] rt.cpan.org
From: Jeffrey Thalhammer <jeff [...] imaginative-software.com>
Download (untitled) / with headers
text/plain 1.6k
On May 12, 2009, at 11:51 PM, David Wright via RT wrote: Show quoted text
> I would rather that the build process was modified to be a > 'suggests' with some sort of > warning when Perl-Critic is not installed, "NOTICE: Perl-Critic is > not installed, this module is > disabled", or something to that effect.
Will do. Show quoted text
> One downside to this approach is that when one has 'use criticism' > in their code and receives > no warnings, one may believe 'all's well'. (when in fact in may not > be). > > Maybe for that case there could be a flag of some sort, 'use > criticism qw/brutal verbose/'. > 'verbose' which would warn 'Perl-Critic not installed', along with > the 'normal'/expected code > execution.
Do you really want your users to see this warning every time they run something in production? Show quoted text
> I realize that without Perl-Critic, criticism has no function, but > to look at it from another > perspective. I think the point is that one doesn't want the overhead > (or potential 'style' > warnings,...) in a production environment, this is a tool for > developers. (not sys admins)
Personally, I wouldn't recommend using the criticism pragma at all. The no-op behavior when Perl-Critic is not installed just creates an extra degree of freedom between your development and production environments, which results in another variable in the equation when you're trying to reproduce bugs. As you said, Perl-Critic is a development tool, so it should be run only at development-time. So I'd recommend using Test::Perl::Critic or Test::Perl::Critic::Progressive instead, and make Perl-Critic part of your unit tests. Is that an option for you?
Download (untitled) / with headers
text/plain 626b
Show quoted text
> Do you really want your users to see this warning every time they run > something in production?
Nope. (I was assuming the commenting out 'verbose', but that's not realistic) Show quoted text
> As you said, Perl-Critic is a development tool, so it should be run > only at development-time. > So I'd recommend using Test::Perl::Critic or > Test::Perl::Critic::Progressive instead, and > make Perl-Critic part of your unit tests. Is that an option for you?
Yes, that is a very good suggestion, thanks. I really liked criticism because it was clean, quick and easy. (I didn't want 'another' pref/conf env file to worry about).
Subject: Re: [rt.cpan.org #45907] 'requires' discrepancy
Date: Wed, 13 May 2009 01:42:45 -0700
To: bug-criticism [...] rt.cpan.org
From: Jeffrey Thalhammer <jeff [...] imaginative-software.com>
Download (untitled) / with headers
text/plain 530b
On May 13, 2009, at 1:04 AM, David Wright via RT wrote: Show quoted text
> > I really liked criticism because it was clean, quick and easy. (I > didn't want 'another' pref/conf > env file to worry about).
I can appreciate that. Hopefully, we've done a good job of keeping the config language down to a minimum. Also, be sure to take a look at the --profile-prototype option on perlcritic(1). That may save you some typing. Also, the --only switch is useful if you're only going to run a few hand-picked policies. Hope that helps :]


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.