Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
4e403fa
Copy changes from original PerlCritic branch
dchansen06 Feb 1, 2026
ebabc10
Update Perl Critic workflow and configuration for improved linting ou…
dchansen06 Feb 1, 2026
6bae9b1
Fix backticks of doom
dchansen06 Feb 1, 2026
463992c
TEMPORARY --- Add perl files from `Base_Urca` to evaluate process
dchansen06 Feb 1, 2026
d881381
Fix Perl Critic command to include current directory for linting
dchansen06 Feb 1, 2026
58545ed
Implement file path finding
dchansen06 Feb 1, 2026
bae2fcd
Attempt to use annotations
dchansen06 Feb 1, 2026
34d56bb
Verbosity++
dchansen06 Feb 1, 2026
a01c687
Make sure to run on job failure
dchansen06 Feb 1, 2026
eb01752
Fix how perl critic handles failure
dchansen06 Feb 1, 2026
63e33f4
Revert "TEMPORARY --- Add perl files from `Base_Urca` to evaluate pro…
dchansen06 Feb 1, 2026
89779f2
Add fix if no perlcritic
dchansen06 Feb 1, 2026
01b07e4
Add normal output too
dchansen06 Feb 1, 2026
bdf0a10
Revert "Revert "TEMPORARY --- Add perl files from `Base_Urca` to eval…
dchansen06 Feb 1, 2026
76bf0ae
Oops fix fail fall through
dchansen06 Feb 1, 2026
edb7c03
Fix formatting of output further for clarity
dchansen06 Feb 1, 2026
6a2b261
Refactor Perl Critic output formatting for better detail presentation
dchansen06 Feb 1, 2026
a5ee4b1
Formatting!
dchansen06 Feb 1, 2026
ac4e2ab
Formatting fix
dchansen06 Feb 1, 2026
2b31a82
Naming fixes
dchansen06 Feb 1, 2026
25fabb6
Use different cpan cache scheme
dchansen06 Feb 1, 2026
d3f75c1
Add violation tracking to Perl Critic output and update .gitignore fo…
dchansen06 Feb 1, 2026
36e09f3
Sketchy script gets worse
dchansen06 Feb 1, 2026
c3364f3
Fix hirearchy
dchansen06 Feb 1, 2026
e12cb9f
Make slightly nicer and better formatted
dchansen06 Feb 1, 2026
b394652
Fix naming convention
dchansen06 Feb 1, 2026
96f357b
Add trivial change to verify
dchansen06 Feb 1, 2026
aa379f7
Make annotations appear under perl critic
dchansen06 Feb 1, 2026
b52aecc
Sadly cannot make it better as github limits to 10 native annotations
dchansen06 Feb 1, 2026
6e48cf1
Be more verbose in output
dchansen06 Feb 1, 2026
7acbed0
Verify all diagnostics are actually helpful
dchansen06 Feb 1, 2026
429a6c7
Add more exemptions
dchansen06 Feb 1, 2026
9a2adc2
Add rule that says 8 is okay
dchansen06 Feb 1, 2026
63a814c
Revert "Revert "Revert "TEMPORARY --- Add perl files from `Base_Urca`…
dchansen06 Feb 1, 2026
e0500d3
Allow any number 0 throgh 10
dchansen06 Feb 1, 2026
81f4278
Update condition for uploading Perl Critic annotations to trigger onl…
dchansen06 Feb 1, 2026
516e9d3
Update condition for uploading Perl Critic annotations to trigger onl…
dchansen06 Feb 1, 2026
6109e30
Revert "Revert "Revert "Revert "TEMPORARY --- Add perl files from `Ba…
dchansen06 Feb 1, 2026
bb19f69
Revert "Revert "Revert "Revert "Revert "TEMPORARY --- Add perl files …
dchansen06 Feb 1, 2026
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
6 changes: 3 additions & 3 deletions .github/workflows/AutoFormat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ jobs:
token: ${{ secrets.AUTOFORMAT_COMMIT_TOKEN }}
fetch-depth: 1

- name: Install Perl Tidy
uses: perl-actions/install-with-cpanm@v1
- name: Setup Perl
uses: shogo82148/actions-setup-perl@v1
with:
install: 'Perl::Tidy'
install-modules: 'Perl::Tidy'

- name: Format Perl Files
run: |
Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/PerlCritic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Perl Critic
run-name: Perl Critic Linting - ${{ github.ref_name }}

on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.run_id }}
cancel-in-progress: true

jobs:
perllinter:
name: Perl Linter
runs-on: ubuntu-slim
permissions:
contents: read
checks: write
steps:
- name: Checkout Repository
uses: actions/checkout@v6
with:
fetch-depth: 1

- name: Setup Perl
uses: shogo82148/actions-setup-perl@v1
with:
install-modules: 'Perl::Critic'

- name: Perl Critic Output
run: |
set -o pipefail
violations_found=0
while IFS= read -r file; do
echo "<details>" >> $GITHUB_STEP_SUMMARY
echo "<summary><code>$file</code></summary>" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
if ! perlcritic "$file" 2>&1 | tee -a $GITHUB_STEP_SUMMARY; then
violations_found=1
fi
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "</details>" >> $GITHUB_STEP_SUMMARY
done < <(git ls-files '*.pl' '*.pm')
exit $violations_found

- name: Perl Critic Annotations
if: always()
run: |
set -o pipefail
git ls-files '*.pl' '*.pm' \
| xargs -r perlcritic --verbose '%f:%l:%c:%s:%m (%p)\n' \
| jq -R -s '
split("\n")
| map(
select(length > 0)
| match("^([^:]+):([^:]+):([^:]+):([^:]+):(.+)$")
| (.captures[3].string | tonumber) as $severity
| {
file: .captures[0].string,
line: (.captures[1].string | tonumber),
start_column: (.captures[2].string | tonumber),
end_column: (.captures[2].string | tonumber),
annotation_level: (
if $severity == 5 then "failure"
elif $severity >= 3 then "warning"
else "notice"
end
),
message: .captures[4].string
}
)
' \
| tee perlcritic_annotations.json

- name: Upload Annotations
if: failure() && github.event_name == 'pull_request'
uses: yuzutech/annotations-action@v0.5.0
with:
title: 'Perl Linter Findings'
repo-token: ${{ github.token }}
input: 'perlcritic_annotations.json'
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ Icon\r
# Other Editors
.*.swp
.ccls-cache

# Perl
local
11 changes: 11 additions & 0 deletions .perlcriticrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
severity = brutal
verbose = 10

[-ErrorHandling::RequireCarping]
[-RegularExpressions::RequireExtendedFormatting]
[-Modules::RequireVersionVar]
[-RegularExpressions::RequireDotMatchAnything]
[-RegularExpressions::RequireLineBoundaryMatching]

[ValuesAndExpressions::ProhibitMagicNumbers]
allowed_values = 0..10