Skip to content

Qodana image wrappers that are needed to work around some shortcomings with monorepos

Notifications You must be signed in to change notification settings

expandigroup/qodana-hacks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Qodana linters (with hacks)

Qodana linters, with a few hacks to make them work with monorepos containing multiple projects.

Usage

qodana.yml:

version: 1
linter: ghcr.io/expandigroup/qodana-$LANGUAGE:$VERSION

Available patched images:

For instance, to use the latest JVM linter on a Java project:

version: 1
linter: ghcr.io/expandigroup/qodana-jvm:latest

In a monorepo, place the qodana.yml file in the project directory, and specify the hacked linter in the GitHub Actions workflow.

You can specify -e SUBPROJECT_DIR=path/to/project to specify a project to be scanned. It will be scanned while keeping still mounting the entire repository.

For instance:

qodana scan \
    -l ghcr.io/expandigroup/qodana-jvm:2024.1 \
    -i . \
    -e SUBPROJECT_DIR=backend \
    -e QODANA_TOKEN="$QODANA_TOKEN"

Sample GitHub Actions workflow:

name: Qodana
on:
  workflow_dispatch:
  pull_request:
  push:
    branches:
      - main
      - 'releases/*'

jobs:
  qodana:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
      checks: write
    steps:
      - uses: actions/checkout@v3
        with:
          ref: ${{ github.event.pull_request.head.sha }}  # to check out the actual pull request commit, not the merge commit
          fetch-depth: 0  # a full history is required for pull request analysis
      - name: 'Qodana Scan'
        uses: JetBrains/[email protected]
        env:
          QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
        with:
            args: -l,ghcr.io/expandigroup/qodana-jvm:2024.1,-e,SUBPROJECT_DIR=backend

About

Qodana image wrappers that are needed to work around some shortcomings with monorepos

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages