Skip to content

Make code meet perlcritic severity level 4. - #3126

Open
drgrice1 wants to merge 1 commit into
openwebwork:developfrom
drgrice1:perlcritic-workflow
Open

Make code meet perlcritic severity level 4.#3126
drgrice1 wants to merge 1 commit into
openwebwork:developfrom
drgrice1:perlcritic-workflow

Conversation

@drgrice1

Copy link
Copy Markdown
Member

This adds a GitHub workflow that checks that Perl files in the lib directory satisfy perlcritic with the .perlcriticrc file included in this pull request.

I have been working toward this for years now (since December of 2022 according to the date on this commit). Originally there were are large number of changes to files. At this point, there are not so many, so I think it is time for this to go in.

Note there are some things that can't be helped (particularly with safe mode code). So those are disabled with ## no critic annotations. Almost every method in the lib/WeBWorK/DB.pm file breaks the Subroutines::RequireArgUnpacking rule, and so that is disabled for the entire file.

Note that if no critic annotations are added to the code, they should be specific and disable only the rule or rules that are to be ignored, and those rules should usually be enabled again later in the file after the rule breaking code. Other than the annotations already added in this pull request, this is generally something that should be avoided.

@drgrice1
drgrice1 force-pushed the perlcritic-workflow branch 2 times, most recently from 69e3983 to 8b30a4b Compare August 10, 2026 22:10
This adds a GitHub workflow that checks that Perl files in the `lib`
directory satisfy perlcritic with the `.perlcriticrc` file included in
this pull request.

I have been working toward this for years now (since December of 2022
according to the date on this commit).  Originally there were are large
number of changes to files.  At this point, there are not so many, so I
think it is time for this to go in.

Note there are some things that can't be helped (particularly with safe
mode code).  So those are disabled with `## no critic` annotations.
Almost every method in the `lib/WeBWorK/DB.pm` file breaks the
`Subroutines::RequireArgUnpacking` rule, and so that is disabled for the
entire file.

Note that if `no critic` annotations are added to the code, they should
be specific and disable only the rule or rules that are to be ignored,
and those rules should usually be enabled again later in the file after
the rule breaking code. Other than the annotations already added in this
pull request, this is generally something that should be avoided.
@drgrice1
drgrice1 force-pushed the perlcritic-workflow branch from 8b30a4b to 92be955 Compare August 10, 2026 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant