Skip to content

fix: reduce false positives in checkpoints#18

Merged
CybotTM merged 1 commit intomainfrom
fix/checkpoint-false-positives
Mar 15, 2026
Merged

fix: reduce false positives in checkpoints#18
CybotTM merged 1 commit intomainfrom
fix/checkpoint-false-positives

Conversation

@CybotTM
Copy link
Copy Markdown
Member

@CybotTM CybotTM commented Mar 15, 2026

Summary

  • PM-01/PM-02: Changed PHPStan config checks from file_exists/regex with brace expansion to command type, supporting phpstan.neon, Build/phpstan.neon, and phpstan.neon.dist
  • PM-07/PM-08: Changed strict_types checks from regex to contains type, removing implicit line-position requirement that caused false negatives when declaration wasn't on expected line
  • PM-16/PM-17: Changed dev dependency checks from json_path on composer.json to composer show --dev command, catching both direct and transitive dependencies (e.g., via shared CI packages)

Test plan

  • Verify PM-01 passes when Build/phpstan.neon exists but root phpstan.neon does not
  • Verify PM-07/PM-08 pass regardless of where declare(strict_types=1) appears in the file
  • Verify PM-16/PM-17 pass when phpstan/php-cs-fixer are transitive dependencies (not in require-dev directly)

…eckpoints

PM-01/PM-02: Use command type to check multiple PHPStan config paths
(phpstan.neon, Build/phpstan.neon, phpstan.neon.dist) instead of
file_exists/regex with brace expansion.

PM-07/PM-08: Change from regex to contains type for strict_types check,
removing implicit line-position requirement.

PM-16/PM-17: Use composer show --dev to detect both direct and transitive
dev dependencies instead of checking composer.json require-dev directly.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
@CybotTM CybotTM merged commit 864ad7f into main Mar 15, 2026
6 checks passed
@CybotTM CybotTM deleted the fix/checkpoint-false-positives branch March 15, 2026 09:22
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines several checkpoint definitions within the PHP modernization skill to significantly reduce false positives and negatives. The changes involve migrating from less flexible checking mechanisms like file_exists, regex, and json_path to more robust command and contains types. This ensures more accurate detection of PHPStan configurations, strict type declarations, and development dependencies, improving the reliability of the automated checks.

Highlights

  • PHPStan Configuration Checks: Migrated PM-01 and PM-02 from file_exists and regex types to command type checks. This change enhances the flexibility of PHPStan configuration detection by supporting phpstan.neon, Build/phpstan.neon, and phpstan.neon.dist files, and accurately verifying the PHPStan level.
  • Strict Types Declaration Checks: Updated PM-07 and PM-08 from regex to contains type for declare(strict_types=1) checks. This modification removes the implicit line-position requirement, preventing false negatives when the declaration is not on an expected line.
  • Dev Dependency Checks: Refactored PM-16 and PM-17 from json_path checks on composer.json to command type checks using composer show --dev. This allows for the detection of both direct and transitive development dependencies like phpstan/phpstan and friendsofphp/php-cs-fixer.
Changelog
  • skills/php-modernization/checkpoints.yaml
    • Changed PHPStan configuration checks (PM-01, PM-02) from file_exists/regex to command type to support multiple file names and more robust pattern matching.
    • Modified strict_types declaration checks (PM-07, PM-08) from regex to contains type for improved flexibility in declaration placement.
    • Updated dev dependency checks (PM-16, PM-17) from json_path to command type using composer show --dev to include transitive dependencies.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves several checks in the checkpoints.yaml file to reduce false positives and make them more robust. The changes to use command type for checking PHPStan configuration (PM-01, PM-02) and dev dependencies (PM-16, PM-17) are solid improvements that correctly handle more project structures and transitive dependencies.

However, the change for strict_types checks (PM-07, PM-08) from regex to contains introduces a new risk of false negatives due to its rigid string matching. I've added comments with suggestions to use a command-based check instead, which would provide a more robust solution by allowing for flexible pattern matching across entire files.

Comment thread skills/php-modernization/checkpoints.yaml
Comment thread skills/php-modernization/checkpoints.yaml
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