Closed Bug 555438 Opened 15 years ago Closed 9 years ago

Improve the Bugzilla code base using Perl::Critic

Categories

(Bugzilla :: Testing Suite, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 6.0

People

(Reporter: szabgab, Assigned: dylan)

References

Details

Attachments

(1 file, 2 obsolete files)

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100214 Ubuntu/9.10 (karmic) Firefox/3.5.8 Build Identifier: Perl::Critic and Test::Perl::Critic have been used for many years for defining policies regarding the code base of Perl projects. The way it could work is to add a Test::Perl::Critic based test script to xt/ along with the configuration file defining the rules you want to use. Then configure the automated smoke testing to run these tests. I created a set of rules based on what we have in Padre and disabled all the rules that are currently violated in the Bugzilla code base. If you accept the idea of code improvement using Perl::Critic then please add these files to xt/ and check if they indeed pass the tests by running: RELEASE_TESTING=1 prove xt/ Configure the Tinderbox to run these tests (and install Test::Perl::Critic). Then start removing the policies that are currently violated and start fixing the issues in the code base. Reproducible: Always
Attached file xt/critic-core.t (obsolete) —
Attachment #435375 - Flags: review?
Attached file xt/critic-core.ini (obsolete) —
Attachment #435376 - Flags: review?
Attachment #435375 - Attachment mime type: text/troff → text/plain
Attachment #435376 - Attachment mime type: application/octet-stream → text/plain
szabgab: It's best to request review from somebody specific, or it's likely to never happen.
OS: Linux → All
Hardware: x86 → All
I've run some Bugzilla files through Perl::Critic before, and I disagreed with almost all the recommendations. So I'm somewhat skeptical, but it could still be valuable. Like you said, we can disable policies we disagree with. BTW, I'd rather just have the tests in t/ and do a skip_all if the environment variable isn't set.
Assignee: general → testing
Component: Bugzilla-General → Testing Suite
There is a clear consensus amongst core developers against using Perl::Critic. We all agree that if we don't want to follow a rule, we will remove/relax it, making this RFE useless. Thanks for suggesting that, though.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → WONTFIX
Attachment #435375 - Flags: review?
Attachment #435376 - Flags: review?
Per IRC discussion with Frédéric Buclin, re-opening this bug. We can make apply only the policies that there is a consensus about, and ignore that ones that we disagree with.
Assignee: testing → dylan
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: WONTFIX → ---
Attached patch 555438_1.patchSplinter Review
This includes the suggestions from Gabor from 6 years ago -- protected under a RELEASE_TESTING=1 flag for now. With that enabled, this test will not pass but I think the errors it brings up should be discussed first (from a historical perspective of Bugzilla aspect as well). I'm very keen to fix the warnings it produces and then "tighten the screws".
Attachment #435375 - Attachment is obsolete: true
Attachment #435376 - Attachment is obsolete: true
Attachment #8711489 - Flags: review?(dkl)
Comment on attachment 8711489 [details] [diff] [review] 555438_1.patch Review of attachment 8711489 [details] [diff] [review]: ----------------------------------------------------------------- r=dkl
Attachment #8711489 - Flags: review?(dkl) → review+
To ssh://gitolite3@git.mozilla.org/bugzilla/bugzilla.git 39d8526..a0f345b master -> master
Status: REOPENED → RESOLVED
Closed: 13 years ago9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Bugzilla 6.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: