Inspect a monorepo project
A monorepo is a repository containing several projects, for example:
In this example, the backend/
folder contains a Java project, the frontend/
folder contains a JavaScript project, and the .git/
folder contains VCS-related information.
This section explains how to prepare the projects from this example monorepo so that Qodana can inspect them using either the Docker images or the Qodana Scan GitHub Action.
Prepare your project
Qodana provides several linters, and each linter can inspect a specific set of programming languages. Because there is no linter that can inspect Java and JavaScript at the same time, Qodana needs to be run twice over the repository, once for each project.
To configure Qodana for inspecting two projects, you need to create two separate qodana.yaml
files. Qodana also expects qodana.yaml
to be contained in the root folder. This means that before running Qodana on the project from the backend/
folder, that project's qodana.yaml
file needs to be copied to the root folder. If you run Qodana using Docker, you can copy files using the bootstrap
configuration option in qodana.yaml
, for example:
When Qodana runs, it uses the .git/
folder for linking detected problems to the corresponding source code in a Git repository, and for exploring inspection reports from within your IDE.
The qodana-backend.sarif.json
and qodana-frontend.sarif.json
files can contain baseline data for the backend
and frontend
projects.
Here are the contents of the root/
folder:
Run Qodana
After preparing the project, you can inspect your code using Docker or GitHub Actions.
Docker
You can inspect your monorepo in the root/
folder using either Docker or Qodana CLI.
GitHub Actions
You can use the Qodana Scan GitHub action for running Qodana on GitHub. Here is the GitHub action configuration for inspecting the monorepo: