Skip to content

Conversation

a-pasquale
Copy link
Contributor

Any other related PRs?

necyberteam/cyberteam_drupal#1613

Checklist for PR author

  • I have checked that the PR is ready to be merged
  • I have reviewed the DIFF and checked that the changes are as expected
  • I have assigned myself or someone else to review the PR

- 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
Copy link
Contributor

@Copilot Copilot AI left a 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.

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