Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,9 @@
# It is the industry-standard location, and the About tab will read the release
# history from it once docs/changelog.txt is retired.
# /CHANGELOG.md export-ignore

# Qodana development configuration
/.qodana export-ignore
/qodana.yaml export-ignore
/docs/QODANA.md export-ignore

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Release guide link breaks

The new README link points to docs/QODANA.md, but this rule removes that file from release archives. Anyone reading the packaged README gets a broken link. Keep the guide in the archive or link to its hosted copy.

Suggested change
/docs/QODANA.md export-ignore

/.github/workflows/qodana.yml export-ignore
44 changes: 44 additions & 0 deletions .github/workflows/qodana.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Optional Qodana analysis; shared PHP tooling remains configured separately.
name: Qodana

on:
workflow_dispatch:
pull_request:
push:
branches: [master, main, 'releases/*']

permissions: {}

concurrency:
group: qodana-${{ github.ref }}
cancel-in-progress: true

jobs:
qodana:
runs-on: ubuntu-22.04
timeout-minutes: 30
permissions:
contents: read
checks: write
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
steps:
- name: Explain skipped scan
if: env.QODANA_TOKEN == ''
run: echo "::notice::QODANA_TOKEN is not available; configure this repository's Qodana project token to enable analysis."

- name: Checkout
if: env.QODANA_TOKEN != ''
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 0
persist-credentials: false

- name: Qodana scan
if: env.QODANA_TOKEN != ''
uses: JetBrains/qodana-action@3e8d76ff0e0241618abd808682f426afe84bab3f # v2026.2.2
with:
upload-result: true
post-pr-comment: false
push-fixes: none
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,7 @@ psalm.xml
# cache/*.php

# --- Baseline / overlay installer conflict artifacts ---
*.overlay-new
*.overlay-new

# Local Qodana results and caches
/.qodana/
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,10 @@ GNU General Public License 2.0 or later. See the license information in `xoops_v
## Credits

Based on the earlier XOOPS DebugBar integration by Richard Griffith and trabis, with subsequent XOOPS 2.7 compatibility, diagnostics, analytics, logging, and security work maintained by the XOOPS community.

## Qodana inspections

The optional Qodana workflow runs alongside existing quality checks. Add this
repository's `QODANA_TOKEN` secret to enable it; runs without the token print a
skip notice. See [Qodana setup and scope](docs/QODANA.md). No module-local
development vendor directory is required.
47 changes: 47 additions & 0 deletions docs/QODANA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Qodana inspections

Qodana adds PhpStorm-based PHP, JavaScript and TypeScript inspections alongside
the existing tests and static analysis. The module uses Qodana PHP 2026.2 and the
`qodana.recommended` profile. `qodana.yaml` sets the module's supported PHP level.

## Enable analysis

1. Create a Qodana Cloud project for this repository, or connect it through the
Qodana GitHub App. Qodana PHP requires an appropriate Qodana license.
2. Save that project's token as the repository Actions secret `QODANA_TOKEN`.
Use a separate project/token for each module; do not reuse the core project's
token for every repository or commit tokens to configuration files.
3. Run **Actions > Qodana > Run workflow** after the workflow reaches the default
branch. It also runs for pushes to `master`, `main` and `releases/*`, and PRs.
4. Review the Qodana Cloud report and the `qodana-report` workflow artifact.

When the secret is unavailable, including ordinary fork and Dependabot PRs,
the workflow prints a skip notice. Do not use `pull_request_target` to expose
tokens to untrusted code. PR comments and automatic code fixes are disabled.

## Scope and dependencies

The scan excludes vendor packages, generated output, uploads and private
`docs/00` notes. It does not create a Composer manifest or install module-local
development tools. Keep normal tests and quality tools in the shared
`xoops_lib/vendor` installation.
Comment on lines +26 to +27

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Setup advice conflicts with checks

The guide tells developers to keep normal tests and quality tools in xoops_lib/vendor, but this repository runs them from a module-local Composer installation. phpstan.neon.dist also loads rules from relative vendor/ paths. Following this advice can leave existing checks unable to find their required files. Limit the advice to Qodana and keep the module-local setup for existing checks.

Suggested change
development tools. Keep normal tests and quality tools in the shared
`xoops_lib/vendor` installation.
development tools. Existing tests and quality checks still use the module-local
Composer installation; run `composer install` from the module root for those checks.


A standalone module checkout may lack XOOPS core classes and external libraries.
Review unresolved-symbol findings in that context; do not disable all such
inspections or generate a blanket baseline. For full dependency analysis, use a
checkout containing the appropriate core/library sources, or add a reviewed
`bootstrap` command for the module's unique runtime dependencies. The baseline
deliberately does not install every module's Composer development requirements.

## Maintenance

Keep the Qodana action and image on matching release lines. GitHub Actions
Dependabot entries, where configured, track the pinned action. Review linter
image updates separately. Change `php.version` when the module's supported PHP
level changes. Generated `.qodana/` files are ignored and excluded from releases.

No new issue-count threshold or baseline is imposed by this configuration.
Agree on a gate after reviewing the first report; existing tests remain required.

See JetBrains' [GitHub integration](https://www.jetbrains.com/help/qodana/github.html)
and [PHP configuration](https://www.jetbrains.com/help/qodana/php.html).
22 changes: 22 additions & 0 deletions qodana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: "1.0"

image: jetbrains/qodana-php:2026.2

profile:
name: qodana.recommended

php:
version: "8.2"

# Analyse module code without installing another development vendor tree.
exclude:
- name: All
paths:
- vendor
- node_modules
- .build
- .qodana
- coverage
- docs/00
- templates_c
- uploads
Comment on lines +15 to +22

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Copied files clutter reports

The exclusions omit generated browser files under assets/, including assets/dist, while the guide says generated output is excluded. These files are copied from PHP DebugBar or mirrored from assets-custom/. Scanning them adds third-party and duplicate findings against files developers should not edit. Exclude the generated paths while keeping module-owned files in scope.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Loading