Repository navigation
Qodana #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qodana #23
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The guide tells developers to keep normal tests and quality tools in
Suggested change
|
||||||||||
|
|
||||||||||
| 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). | ||||||||||
| 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The exclusions omit generated browser files under 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! |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.