Skip to content

Add 3 Perl compatibility rules for cPanel plugins#4

Open
mladenovic-13 wants to merge 1 commit into
mainfrom
feat/perl-compat-rules
Open

Add 3 Perl compatibility rules for cPanel plugins#4
mladenovic-13 wants to merge 1 commit into
mainfrom
feat/perl-compat-rules

Conversation

@mladenovic-13

Copy link
Copy Markdown
Collaborator

Add three Perl compatibility rules that were referenced in
deprecated_syntax.pl examples but not yet implemented.

Summary

  • perl-compat-two-arg-open — detects insecure two-argument open() (comma-counting approach)
  • perl-compat-indirect-object — detects deprecated new ClassName() syntax (Perl 5.36+)
  • perl-compat-bareword-filehandle — detects bareword filehandles, excludes STDIN/STDOUT/STDERR
  • 12 new tests (4 per rule: 2 positive + 2 negative)
  • Updated RULES.md (32 → 35 rules, Perl section 7 → 10)

Type of Change

  • New rule
  • Documentation update

Checklist

  • npm run validate passes (lint + typecheck + tests + build)
  • New rules have positive and negative test cases
  • Documentation updated if needed
  • No any types introduced

Add perl-compat-two-arg-open, perl-compat-indirect-object, and
perl-compat-bareword-filehandle rules. These were already referenced
in deprecated_syntax.pl examples but not implemented. Two-arg open
uses comma-counting for robust detection, bareword-filehandle excludes
standard handles (STDIN/STDOUT/STDERR), indirect-object uses negative
lookbehind to skip ->new() method calls.
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