Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to using Perl::Tidy version 20240903 (the latest). #2632

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-formats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: cpanm -n Perl::Tidy@20220613
run: cpanm -n Perl::Tidy@20240903
- name: Run perltidy
shell: bash
run: |
Expand Down
1 change: 0 additions & 1 deletion .perltidyrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@
-nlop # No logical padding (this causes mixed tabs and spaces)
-wn # Weld nested containers
-xci # Extended continuation indentation
-vxl='q' # No vertical alignment of qw quotes
1 change: 0 additions & 1 deletion bin/check_modules.pl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ =head1 DESCRIPTION
'LWP::Protocol::https' => 6.06,
'Mojolicious' => 9.34,
'Net::SSLeay' => 1.46,
'Perl::Tidy' => 20220613,
'SQL::Abstract' => 2.000000
);

Expand Down
2 changes: 1 addition & 1 deletion bin/crypt_passwords_in_classlist.pl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ BEGIN

use lib "$ENV{WEBWORK_ROOT}/lib";

use WeBWorK::Utils qw(cryptPassword);
use WeBWorK::Utils qw(cryptPassword);
use WeBWorK::File::Classlist qw(parse_classlist write_classlist);

unless (@ARGV == 1) {
Expand Down
4 changes: 2 additions & 2 deletions bin/dev_scripts/PODtoHTML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use Pod::Simple::Search;
use Mojo::Template;
use Mojo::DOM;
use Mojo::Collection qw(c);
use File::Path qw(make_path);
use File::Basename qw(dirname);
use File::Path qw(make_path);
use File::Basename qw(dirname);
use IO::File;
use POSIX qw(strftime);

Expand Down
4 changes: 2 additions & 2 deletions bin/dev_scripts/generate-ww-pg-pod.pl
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ =head1 DESCRIPTION
use Mojo::Template;
use IO::File;
use File::Copy;
use File::Path qw(make_path remove_tree);
use File::Path qw(make_path remove_tree);
use File::Basename qw(dirname);
use Cwd qw(abs_path);
use Cwd qw(abs_path);

use lib dirname(dirname(dirname(__FILE__))) . '/lib';
use lib dirname(__FILE__);
Expand Down
5 changes: 2 additions & 3 deletions bin/dev_scripts/run-perltidy.pl
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@ =head1 OPTIONS

my $webwork_root = curfile->dirname->dirname->dirname;

die "Version 20220613 or newer of perltidy is required for this script.\n"
. "The installed version is $Perl::Tidy::VERSION.\n"
unless $Perl::Tidy::VERSION >= 20220613;
die "Version 20240903 of perltidy is required for this script.\nThe installed version is $Perl::Tidy::VERSION.\n"
unless $Perl::Tidy::VERSION == 20240903;
die "The .perltidyrc file in the webwork root directory is not readable.\n"
unless -r "$webwork_root/.perltidyrc";

Expand Down
2 changes: 1 addition & 1 deletion bin/download-OPL-metadata-release.pl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

BEGIN {
use Mojo::File qw(curfile);
use Env qw(WEBWORK_ROOT);
use Env qw(WEBWORK_ROOT);

$WEBWORK_ROOT = curfile->dirname->dirname;
}
Expand Down
2 changes: 1 addition & 1 deletion bin/dump-OPL-tables.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

BEGIN {
use Mojo::File qw(curfile);
use Env qw(WEBWORK_ROOT);
use Env qw(WEBWORK_ROOT);

$WEBWORK_ROOT = curfile->dirname->dirname;
}
Expand Down
2 changes: 1 addition & 1 deletion bin/dump-past-answers.pl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ =head1 DESCRIPTION

BEGIN {
use Mojo::File qw(curfile);
use Env qw(WEBWORK_ROOT);
use Env qw(WEBWORK_ROOT);
$WEBWORK_ROOT = curfile->dirname->dirname;
}

Expand Down
2 changes: 1 addition & 1 deletion bin/generate-OPL-set-def-lists.pl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ =head1 DESCRIPTION

BEGIN {
use Mojo::File qw(curfile);
use Env qw(WEBWORK_ROOT);
use Env qw(WEBWORK_ROOT);

$WEBWORK_ROOT = curfile->dirname->dirname;
}
Expand Down
4 changes: 2 additions & 2 deletions bin/importClassList.pl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

BEGIN {
use Mojo::File qw(curfile);
use Env qw(WEBWORK_ROOT);
use Env qw(WEBWORK_ROOT);

$WEBWORK_ROOT = curfile->dirname->dirname;
}
Expand All @@ -31,7 +31,7 @@ BEGIN

use WeBWorK::DB qw(check_user_id);
use WeBWorK::File::Classlist;
use WeBWorK::Utils qw(cryptPassword);
use WeBWorK::Utils qw(cryptPassword);
use WeBWorK::File::Classlist qw(parse_classlist);

if ((scalar(@ARGV) != 2)) {
Expand Down
2 changes: 1 addition & 1 deletion bin/load-OPL-global-statistics.pl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

BEGIN {
use Mojo::File qw(curfile);
use Env qw(WEBWORK_ROOT);
use Env qw(WEBWORK_ROOT);

$WEBWORK_ROOT = curfile->dirname->dirname;
}
Expand Down
2 changes: 1 addition & 1 deletion bin/restore-OPL-tables.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

BEGIN {
use Mojo::File qw(curfile);
use Env qw(WEBWORK_ROOT);
use Env qw(WEBWORK_ROOT);

$WEBWORK_ROOT = curfile->dirname->dirname;
}
Expand Down
2 changes: 1 addition & 1 deletion bin/test_library_build.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

BEGIN {
use Mojo::File qw(curfile);
use Env qw(WEBWORK_ROOT);
use Env qw(WEBWORK_ROOT);

$WEBWORK_ROOT = curfile->dirname->dirname;
}
Expand Down
2 changes: 1 addition & 1 deletion bin/update-OPL-statistics.pl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

BEGIN {
use Mojo::File qw(curfile);
use Env qw(WEBWORK_ROOT);
use Env qw(WEBWORK_ROOT);

$WEBWORK_ROOT = curfile->dirname->dirname;
}
Expand Down
2 changes: 1 addition & 1 deletion bin/updateOPLextras.pl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ =head1 DESCRIPTION

BEGIN {
use Mojo::File qw(curfile);
use Env qw(WEBWORK_ROOT);
use Env qw(WEBWORK_ROOT);

$WEBWORK_ROOT = curfile->dirname->dirname;
}
Expand Down
2 changes: 1 addition & 1 deletion bin/upgrade-database-to-utf8mb4.pl
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ =head1 OPTIONS

BEGIN {
use Mojo::File qw(curfile);
use Env qw(WEBWORK_ROOT);
use Env qw(WEBWORK_ROOT);

$WEBWORK_ROOT = curfile->dirname->dirname;
}
Expand Down
2 changes: 1 addition & 1 deletion bin/upgrade_admin_db.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

BEGIN {
use Mojo::File qw(curfile);
use Env qw(WEBWORK_ROOT);
use Env qw(WEBWORK_ROOT);

$WEBWORK_ROOT = curfile->dirname->dirname;
}
Expand Down
2 changes: 1 addition & 1 deletion bin/upload-OPL-statistics.pl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

BEGIN {
use Mojo::File qw(curfile);
use Env qw(WEBWORK_ROOT);
use Env qw(WEBWORK_ROOT);

$WEBWORK_ROOT = curfile->dirname->dirname;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/FormatRenderedProblem.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ use warnings;

use JSON;
use Digest::SHA qw(sha1_base64);
use Mojo::Util qw(xml_escape);
use Mojo::Util qw(xml_escape);
use Mojo::DOM;

use WeBWorK::Utils qw(getAssetURL);
use WeBWorK::Utils qw(getAssetURL);
use WeBWorK::Utils::LanguageAndDirection qw(get_lang_and_dir get_problem_lang_and_dir);

sub formatRenderedProblem {
Expand Down
5 changes: 2 additions & 3 deletions lib/HardcopyRenderedProblem.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use warnings;
use File::Path;
use String::ShellQuote;
use Archive::Zip qw(:ERROR_CODES);
use Mojo::File qw(path tempdir);
use Mojo::File qw(path tempdir);
use XML::LibXML;

sub hardcopyRenderedProblem {
Expand Down Expand Up @@ -265,8 +265,7 @@ sub write_problem_tex {
$correctTeX .=
"\\item\n\$\\displaystyle "
. ($rh_result->{answers}{$_}{correct_ans_latex_string}
|| "\\text{$rh_result->{answers}{$_}{correct_ans}}")
. "\$\n";
|| "\\text{$rh_result->{answers}{$_}{correct_ans}}") . "\$\n";
}

$correctTeX .= "\\end{itemize}}\\par\n";
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/WeBWorK.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use Mojo::JSON qw(encode_json);

use WeBWorK;
use WeBWorK::CourseEnvironment;
use WeBWorK::Utils::Logs qw(writeTimingLogEntry);
use WeBWorK::Utils::Logs qw(writeTimingLogEntry);
use WeBWorK::Utils::Routes qw(setup_content_generator_routes);

sub startup ($app) {
Expand Down
2 changes: 1 addition & 1 deletion lib/WeBWorK/AchievementEvaluator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use Mojo::Base 'Exporter', -signatures;

use DateTime;

use WeBWorK::Utils qw(sortAchievements nfreeze_base64 thaw_base64);
use WeBWorK::Utils qw(sortAchievements nfreeze_base64 thaw_base64);
use WeBWorK::Utils::ProblemProcessing qw(compute_unreduced_score);
use WeBWorK::Utils::Tags;
use WeBWorK::WWSafe;
Expand Down
4 changes: 2 additions & 2 deletions lib/WeBWorK/AchievementItems/AddNewTestGW.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use Mojo::Base 'WeBWorK::AchievementItems', -signatures;

# Item to allow students to take an additional version of a test within its test version interval

use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils::DateTime qw(before between);
use WeBWorK::Utils::Sets qw(format_set_name_display);
use WeBWorK::Utils::Sets qw(format_set_name_display);

sub new ($class) {
return bless {
Expand Down
4 changes: 2 additions & 2 deletions lib/WeBWorK/AchievementItems/DoubleProb.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ use Mojo::Base 'WeBWorK::AchievementItems', -signatures;

use Mojo::JSON qw(encode_json);

use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils::DateTime qw(after);
use WeBWorK::Utils::Sets qw(format_set_name_display);
use WeBWorK::Utils::Sets qw(format_set_name_display);

sub new ($class) {
return bless {
Expand Down
4 changes: 2 additions & 2 deletions lib/WeBWorK/AchievementItems/DoubleSet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use Mojo::Base 'WeBWorK::AchievementItems', -signatures;

# Item to make a homework set worth twice as much

use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils::DateTime qw(after);
use WeBWorK::Utils::Sets qw(format_set_name_display);
use WeBWorK::Utils::Sets qw(format_set_name_display);

sub new ($class) {
return bless {
Expand Down
4 changes: 2 additions & 2 deletions lib/WeBWorK/AchievementItems/DuplicateProb.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ use Mojo::Base 'WeBWorK::AchievementItems', -signatures;

use Mojo::JSON qw(encode_json);

use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils::DateTime qw(between);
use WeBWorK::Utils::Sets qw(format_set_name_display);
use WeBWorK::Utils::Sets qw(format_set_name_display);

sub new ($class) {
return bless {
Expand Down
4 changes: 2 additions & 2 deletions lib/WeBWorK/AchievementItems/ExtendDueDate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use Mojo::Base 'WeBWorK::AchievementItems', -signatures;

# Item to extend a close date by 24 hours.

use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils::DateTime qw(between);
use WeBWorK::Utils::Sets qw(format_set_name_display);
use WeBWorK::Utils::Sets qw(format_set_name_display);

sub new ($class) {
return bless {
Expand Down
4 changes: 2 additions & 2 deletions lib/WeBWorK/AchievementItems/ExtendDueDateGW.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use Mojo::Base 'WeBWorK::AchievementItems', -signatures;

# Item to extend the close date on a test

use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils::DateTime qw(between);
use WeBWorK::Utils::Sets qw(format_set_name_display);
use WeBWorK::Utils::Sets qw(format_set_name_display);

sub new ($class) {
return bless {
Expand Down
4 changes: 2 additions & 2 deletions lib/WeBWorK/AchievementItems/FullCreditProb.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ use Mojo::Base 'WeBWorK::AchievementItems', -signatures;

use Mojo::JSON qw(encode_json);

use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils::DateTime qw(after);
use WeBWorK::Utils::Sets qw(format_set_name_display);
use WeBWorK::Utils::Sets qw(format_set_name_display);

sub new ($class) {
return bless {
Expand Down
4 changes: 2 additions & 2 deletions lib/WeBWorK/AchievementItems/FullCreditSet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use Mojo::Base 'WeBWorK::AchievementItems', -signatures;

# Item to give half credit on all problems in a homework set.

use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils::DateTime qw(after);
use WeBWorK::Utils::Sets qw(format_set_name_display);
use WeBWorK::Utils::Sets qw(format_set_name_display);

sub new ($class) {
return bless {
Expand Down
4 changes: 2 additions & 2 deletions lib/WeBWorK/AchievementItems/HalfCreditProb.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ use Mojo::Base 'WeBWorK::AchievementItems', -signatures;

use Mojo::JSON qw(encode_json);

use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils::DateTime qw(after);
use WeBWorK::Utils::Sets qw(format_set_name_display);
use WeBWorK::Utils::Sets qw(format_set_name_display);

sub new ($class) {
return bless {
Expand Down
4 changes: 2 additions & 2 deletions lib/WeBWorK/AchievementItems/HalfCreditSet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use Mojo::Base 'WeBWorK::AchievementItems', -signatures;

# Item to give half credit on all problems in a homework set.

use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils::DateTime qw(after);
use WeBWorK::Utils::Sets qw(format_set_name_display);
use WeBWorK::Utils::Sets qw(format_set_name_display);

sub new ($class) {
return bless {
Expand Down
4 changes: 2 additions & 2 deletions lib/WeBWorK/AchievementItems/ReducedCred.pm
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ use Mojo::Base 'WeBWorK::AchievementItems', -signatures;
# Item to extend a close date by 24 hours for reduced credit
# Reduced scoring needs to be enabled for this item to work.

use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils::DateTime qw(between);
use WeBWorK::Utils::Sets qw(format_set_name_display);
use WeBWorK::Utils::Sets qw(format_set_name_display);

sub new ($class) {
return bless {
Expand Down
4 changes: 2 additions & 2 deletions lib/WeBWorK/AchievementItems/ResetIncorrectAttempts.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ use Mojo::Base 'WeBWorK::AchievementItems', -signatures;

use Mojo::JSON qw(encode_json);

use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils::DateTime qw(between);
use WeBWorK::Utils::Sets qw(format_set_name_display);
use WeBWorK::Utils::Sets qw(format_set_name_display);

sub new ($class) {
return bless {
Expand Down
4 changes: 2 additions & 2 deletions lib/WeBWorK/AchievementItems/ResurrectGW.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ use Mojo::Base 'WeBWorK::AchievementItems', -signatures;

# Item to extend the due date on a gateway

use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils qw(x nfreeze_base64 thaw_base64);
use WeBWorK::Utils::DateTime qw(after);
use WeBWorK::Utils::Sets qw(format_set_name_display);
use WeBWorK::Utils::Sets qw(format_set_name_display);

sub new ($class) {
return bless {
Expand Down
Loading