Skip to main content
A build gate checks your code each time you run your build command, before anything is compiled. If a file scores below the minimum your project has set, the build stops and lists what needs attention. It hooks into the build process you already have, so the check runs wherever the project is built, with or without an editor open.
The build gate requires Iris Code Pro.

Installing

Run Iris Code: Install Build Hook from the command palette. Iris Code works out what kind of project you have and adds the check for you. You do not need to edit any files by hand.

What it does

1

Detects your project type

Looks for package.json (Node), go.mod (Go), Cargo.toml (Rust), pyproject.toml / requirements.txt (Python), Gemfile (Ruby), a .csproj / .sln (.NET), or pom.xml / build.gradle (Java).
2

Installs the hook

  • Node: adds a prebuild entry to package.json. If you already have a prebuild command, the Iris Code check runs first and your command still runs after it.
  • Everything else: adds an iris-check target to your Makefile and makes the build or all target run it first. If there is no Makefile, Iris Code creates one with a build command that matches the project: go build ./..., cargo build, dotnet build, or, for Java, ./gradlew build, gradle build or mvn test depending on which wrapper and build files are present.
3

Runs on every build

If any file scores below minHealthScore, the build stops with exit code 1 and lists the files that failed. Otherwise the build carries on as normal.
Every file is checked before the build stops, so you see the complete list at once rather than one problem per run.

Configuring the threshold

The threshold is the minimum health score a file must reach. Set it with minHealthScore in .irisconfig.json. It defaults to 70.
On Node projects, your existing prebuild command is kept, and uninstalling puts the file back the way it was.

Analytics tracking

Each time the build gate runs, the result is recorded as a pass or fail in your account Analytics, so you can see how often it stops a build without reading build logs. See iriscode.co/account/analytics.

Uninstalling

Run Iris Code: Uninstall Build Hook. Only the Iris Code entry is removed. On Node projects, if no other prebuild commands remain, the prebuild key is deleted rather than left empty.