Clojure version is declared
clojure/version-declared@v1
The project depends on the Clojure release it is built against, and that release is no older than the configured floor.
| Id | clojure/version-declared |
| Version | v1 |
| Category | clojure |
| Default severity | warning |
| Interpreter | python3 |
| Timeout | 30 seconds |
| Violations tolerated | 0 |
| Collects | clojure |
Collectors
This guardrail gathers nothing itself. It depends on the collectors below, which the CLI runs once per build before any check, and reads what they found out of GUARDRAIL_FACTS. A collector that collects nothing skips this guardrail rather than failing it.
| Collector | Gathers | Inputs it is given |
|---|---|---|
clojure | The Clojure build in the project directory: which tool it uses, the Clojure version it depends on, the source paths and aliases it declares, the repositories it resolves from, and every dependency with its alias, origin and whether it is pinned. | projectDir |
The inputs above are this guardrail's own, passed straight through. Configuring one in buildnote.json changes what is collected, and two guardrails configured the same way share the one collection.
Configuration
{
"guardrails": {
"failOn": "error",
"comment": true,
"checks": [
{
"use": "clojure/version-declared@v1",
"severity": "warning",
"with": {
"projectDir": ".",
"minVersion": "1.11"
},
"exemptions": []
}
]
}
}Inputs
| Input | Description | Default | Environment variable |
|---|---|---|---|
projectDir | Directory holding the project, relative to the directory the CLI runs in. | . | GUARDRAIL_INPUT_PROJECTDIR |
minVersion | Oldest Clojure version accepted. A declared version below this is a violation. | 1.11 | GUARDRAIL_INPUT_MINVERSION |
How to fix
Depend on Clojure where the project already declares its dependencies:
{:deps {org.clojure/clojure {:mvn/version "1.12.0"}}}Leiningen takes the same coordinates in :dependencies. A project that names none compiles against whichever release the installed tool falls back to, so the language version a build ran under is a property of the runner rather than of the commit.
More in clojure
clojure/dependencies-pinned. Every dependency the manifests declare names one released version, or the exact commit a git dependency builds from.clojure/no-local-dependencies. No dependency is taken from a:local/root, so the build resolves everything from this commit rather than from the machine it runs on.clojure/repositories-allowed. Every Maven repository the manifest adds beyond the defaults resolves from a host on the allowed list.