Skip to content

Chore finished#7

Merged
lloc merged 3 commits into
masterfrom
chore/code-style
Oct 12, 2025
Merged

Chore finished#7
lloc merged 3 commits into
masterfrom
chore/code-style

Conversation

@lloc

@lloc lloc commented Oct 12, 2025

Copy link
Copy Markdown
Owner

No description provided.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @lloc, 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 streamlines the development workflow by integrating robust code quality tools. It sets up PHP CodeSniffer with WordPress standards, automates code formatting via a Git pre-commit hook, and refines existing static analysis configurations. These changes aim to ensure consistent code style and higher code quality across the project.

Highlights

  • Introduced PHP CodeSniffer: Integrated wp-coding-standards/wpcs as a development dependency and configured .phpcs.xml.dist to enforce WordPress coding standards, with specific exclusions for documentation and file naming.
  • Automated Code Formatting: Added a pre-commit Git hook script (bin/githooks/pre-commit) that automatically runs phpcbf on staged PHP files, ensuring consistent code style before commits. This hook is automatically installed via Composer's post-install-cmd and post-update-cmd.
  • Updated Static Analysis Configuration: Renamed the PHPStan configuration file from phpstan.neon to .phpstan.neon.dist and updated the corresponding Composer script from analyze to phpstan for clarity and consistency.
  • Code Style Refinements: Applied minor code style adjustments in MslsSelect.php, including converting array short syntax [] to array(), adding an @package docblock, and reformatting parameter type hints and add_action calls for consistency.
  • Improved Build Process: Updated .distignore and .gitignore files to include new development-related files (like .phpcs.cache, .phpstan.neon.dist, .phpcs.xml.dist) and reordered existing entries for better organization and cleaner distribution packages.
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.

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

Copy link
Copy Markdown
Contributor

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 introduces PHP CodeSniffer for code style enforcement, along with a pre-commit git hook to automatically format PHP files. The changes include adding development dependencies, configuring phpcs with WordPress standards, updating PHP code to match these standards, and setting up scripts in composer.json to manage the tooling. Overall, this is a great improvement for code quality and consistency. I have one suggestion to improve the clarity and robustness of the new pre-commit hook script.

Comment thread bin/githooks/pre-commit Outdated
lloc and others added 2 commits October 12, 2025 21:00
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@lloc lloc merged commit d4bf33b into master Oct 12, 2025
3 of 4 checks passed
@lloc lloc deleted the chore/code-style branch October 12, 2025 19:07
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