-
Notifications
You must be signed in to change notification settings - Fork 0
Precommit linting setup #338
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
base: 3.0.x
Are you sure you want to change the base?
Conversation
- Add phpstan.neon configuration for static analysis - Add pre-commit hook to check staged PHP files - Configured to use main project's vendor directory - Level 5 analysis for good balance of strictness
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR sets up precommit linting infrastructure using PHPStan for static analysis of PHP code. The setup includes configuration files, a baseline to ignore existing issues, and integration with git pre-commit hooks.
- Adds PHPStan configuration with baseline to manage existing issues
- Creates script for running PHPStan analysis with proper Drupal autoloading
- Replaces deprecated Drupal renderer methods and updates API usage
- Sets up pre-commit hooks to run PHPStan automatically on PHP file changes
Reviewed Changes
Copilot reviewed 17 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
scripts/run-phpstan.sh | Script to execute PHPStan with correct Drupal paths and configuration |
phpstan.neon | Main PHPStan configuration including baseline and analysis parameters |
phpstan-simple.neon | Alternative PHPStan config ignoring specific error types |
phpstan-baseline.neon | Baseline file containing 435 existing issues to be ignored |
.pre-commit-config.yaml | Pre-commit hook configuration to run PHPStan on PHP files |
composer.json | Adds PHPStan dependencies and lint scripts |
Multiple module files | Updates deprecated renderer methods and API calls |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
modules/ticketing/src/Plugin/WebformHandler/TicketingSendEmailHandler.php
Show resolved
Hide resolved
modules/ticketing/src/Plugin/WebformHandler/RequestOrgsListAddHandler.php
Show resolved
Hide resolved
…Handler.php Co-authored-by: Copilot <[email protected]>
…Handler.php Co-authored-by: Copilot <[email protected]>
…ler.php Co-authored-by: Copilot <[email protected]>
This reverts commit 55b42aa.
Any other related PRs?
necyberteam/cyberteam_drupal#1613
Checklist for PR author