Skip to content

chore(sonar): add XOOPS-convention exclusions to the baseline template - #12

Merged
mambax7 merged 3 commits into
XoopsModules27x:masterfrom
mambax7:master
Aug 10, 2026
Merged

mambax7 merged 3 commits into
XoopsModules27x:masterfrom
mambax7:master

Conversation

@mambax7

@mambax7 mambax7 commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Ship the sonar.issue.ignore.multicriteria block in the DevOps baseline so every module that adopts it inherits the suppression for the SonarPHP rules that clash with mandated XOOPS conventions and with test doubles: S115 (constants start with '_'), S100 (snake_case lifecycle hooks), S1172/S1186 (a stub matches a signature it does not use), and S1142 (guard-clause early returns).

Binds only under the CI scanner; SonarCloud Automatic Analysis must be off for it to take effect.

Summary by Sourcery

Chores:

  • Configure SonarCI to permanently ignore specific SonarPHP rules (S115, S100, S1172, S1186, S1142) that conflict with XOOPS coding conventions and test double patterns.

Summary by CodeRabbit

  • Chores
    • Updated code-quality analysis settings to suppress designated naming, test-double, empty-method, and guard-clause findings.
    • Added guidance that CI-based scanning should be used for analysis.

Ship the sonar.issue.ignore.multicriteria block in the DevOps baseline so
every module that adopts it inherits the suppression for the SonarPHP
rules that clash with mandated XOOPS conventions and with test doubles:
S115 (constants start with '_'), S100 (snake_case lifecycle hooks),
S1172/S1186 (a stub matches a signature it does not use), and S1142
(guard-clause early returns).

Binds only under the CI scanner; SonarCloud Automatic Analysis must be
off for it to take effect.
Copilot AI lite review requested due to automatic review settings August 10, 2026 13:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sourcery-ai

sourcery-ai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds a SonarPHP multi-criteria ignore block to the shared sonar-project.properties baseline so all modules inherit explicit exclusions for rules that conflict with XOOPS conventions and test-double patterns, effective only when using the CI scanner instead of SonarCloud Automatic Analysis.

File-Level Changes

Change Details Files
Introduce a CI-scanner-only SonarPHP ignore.multicriteria configuration that suppresses specific rules producing systematic false positives for XOOPS modules and tests.
  • Extend the baseline sonar-project.properties with a sonar.issue.ignore.multicriteria key referencing five exclusion entries (x1–x5).
  • Configure x1 and x2 to ignore global naming rules S115 and S100 for all PHP files, aligning Sonar with XOOPS constant and lifecycle-hook naming conventions.
  • Configure x3 and x4 to ignore unused-parameter and empty-method rules S1172 and S1186 for files under tests/**, matching test double signatures and stub behavior.
  • Configure x5 to ignore the "too many return statements" rule S1142 for all PHP files to permit guard-clause heavy provider/install hooks without noise.
  • Document in comments that these settings live in-repo for reviewability and that they only apply when SonarCloud Automatic Analysis is disabled in favor of CI-based scanning.
sonar-project.properties

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@mambax7, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 23 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c38f08a7-8210-4cd0-a142-c714ee07a876

📥 Commits

Reviewing files that changed from the base of the PR and between 2e83716 and b27e711.

📒 Files selected for processing (3)
  • .gitattributes
  • .gitignore
  • sonar-project.properties
📝 Walkthrough

Walkthrough

The SonarCloud configuration adds documented exclusions for selected XOOPS naming rules, test-double patterns, and intentional guard-clause returns. The exclusions apply to PHP files and test paths.

Changes

SonarCloud issue exclusions

Layer / File(s) Summary
Configure documented SonarCloud exclusions
sonar-project.properties
Adds multicriteria exclusions for rules S115, S100, S1172, S1186, and S1142. The exclusions target PHP files and tests/** paths.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding SonarCloud exclusions for XOOPS conventions to the baseline template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai sourcery-ai 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.

Hey - I've left some high level feedback:

  • Consider narrowing some of the broader resourceKey patterns (e.g. **/*.php for S115, S100, S1142) to the specific XOOPS modules or language/installer directories where these conventions are required, so that you don’t hide genuine issues in unrelated PHP files.
  • It may be worth adding a brief inline comment mapping each xN ID to its rule (e.g. x1 -> S115) directly beside sonar.issue.ignore.multicriteria=x1,x2,... to make it easier to keep the list in sync if rules are added or removed in future.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider narrowing some of the broader `resourceKey` patterns (e.g. `**/*.php` for S115, S100, S1142) to the specific XOOPS modules or language/installer directories where these conventions are required, so that you don’t hide genuine issues in unrelated PHP files.
- It may be worth adding a brief inline comment mapping each `xN` ID to its rule (e.g. `x1 -> S115`) directly beside `sonar.issue.ignore.multicriteria=x1,x2,...` to make it easier to keep the list in sync if rules are added or removed in future.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@sonar-project.properties`:
- Around line 44-49: Restrict the x3 (php:S1172) and x4 (php:S1186) Sonar
exclusions from the broad tests/** pattern to the specific test-double files or
dedicated test-double directory containing the intentional unused parameters and
empty methods. Keep real test files covered by these rules.
- Around line 34-42: N​​arrow the resourceKey patterns for Sonar exclusions x1,
x2, and x5 from **/*.php to the exact files or smallest directories containing
the documented XOOPS constants, lifecycle hooks, and provider/install guard
clauses; preserve each ruleKey while ensuring unrelated PHP files remain subject
to S115, S100, and S1142.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cd02d18c-f6f1-4dda-9bef-6fc96f9ab9bd

📥 Commits

Reviewing files that changed from the base of the PR and between 33fc685 and 2e83716.

📒 Files selected for processing (1)
  • sonar-project.properties

Comment thread sonar-project.properties Resolved
Comment thread sonar-project.properties Resolved
…ar sources

Bring the DevOps baseline template in line with the xtracy PR-review
fixes so modules that adopt it inherit the corrected scaffolding:
- .gitattributes: do not export-ignore CHANGELOG.md (docs already ship),
  so release archives keep the user-facing changelog.
- .gitignore: anchor phpstan.neon / phpunit.xml / psalm.xml with a leading
  slash, so only the root local-override copies are ignored.
- sonar-project.properties: add tests/** to sonar.exclusions so tests are
  not indexed as analysis sources; sonar.tests still exposes them for test
  analysis.
Answer PR XoopsModules27x#12 review on the ignore scopes:

- S115: narrowed to language/**/*.php -- the mandated home of
  _MI_/_MA_/_AM_ constants; every other PHP file keeps the rule.
- S100: narrowed to include/**/*.php and blocks/**/*.php, where XOOPS
  mandates snake_case entry points (lifecycle hooks, block callbacks);
  class code stays camelCase-checked. Split into two entries since a
  multicriteria item takes a single resourceKey.
- S1172/S1186 stay on tests/**: after tests were source-excluded, only
  tests/**/*Test.php is indexed at all, so a dedicated doubles directory
  would be invisible to the analyzer; doubles reach it as inline classes
  in *Test.php files, which path patterns cannot separate from the tests
  beside them. Documented in the comment instead.
- S1142 stays repo-wide: guard-clause early returns are the house style
  across module entry points, not a per-file exception; the comment now
  says so instead of implying a narrower scope.
@mambax7
mambax7 merged commit 9fa6b55 into XoopsModules27x:master Aug 10, 2026
7 checks passed
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.

2 participants