Repository navigation
Performing automated checks
clif check is the one command a CI pipeline needs. It runs the checks a project chooses, prints what each
found with a summary line per check, and fails the build when any check finds more than it allows.
| Command | Purpose |
|---|---|
clif check |
Run the configured checks; fail on findings |
clif scan |
Report files the tree-sitter grammar cannot parse |
clif parse |
Parse files and report timing and counts (diagnostics, benchmarking) |
clif check [options] <path> [...]
The config is the .clif.json above the first path. With no configuration it runs CFLint exactly as
clif lint does (the pinned CFLint, .cflintrc, linting.minSeverity).
Checks run in the order named.
| Check | What it counts | Equivalent command |
|---|---|---|
lint (legacy name cflint) |
CFLint findings. The default check. | clif lint |
unresolved |
Calls clif cannot resolve | clif unresolved |
scan |
Files the grammar cannot parse | clif scan |
format |
Files clif format -w would change. A file the formatter refuses (grammar or safety) is listed on stderr and not counted; scan is the check for those |
clif format |
| Option | Description |
|---|---|
--checks <list> |
Comma-separated checks to run, replacing check.checks
|
--format text |
Default. Findings, then a summary line per check |
--format json |
One document: {"passed": …, "checks": [ … ]} with each finding |
--format github |
GitHub Actions ::error annotations, then the summary |
--min-severity <level> |
The lint severity floor, replacing check.lint.minSeverity
|
--no-baseline |
Count every finding, whatever the baselines say |
-q, --quiet
|
No progress on stderr |
Every key is optional.
{
"check": {
"checks": ["lint", "unresolved", "format"],
"lint": { "minSeverity": "WARNING", "maxFindings": 0 },
"unresolved": { "maxFindings": 25 },
"scan": { "maxFindings": 0 },
"format": { "maxFindings": 0 }
}
}| Key | Default | Description |
|---|---|---|
checks |
["lint"] |
The checks to run. --checks replaces it |
<check>.maxFindings |
0 |
How many findings the check may have and still pass |
<check>.baseline |
The generated reports |
lint and unresolved only: a known-issues file, relative to the config, whose entries are not counted. Without one, the reports the config's knownIssues entries generate (what clif lint --write and clif unresolved --write keep current) are the baseline, so committing them gates CI on new findings only. "none" (or --no-baseline) counts everything. Matching is by file and message, not line |
lint.minSeverity |
linting.minSeverity |
The least severe CFLint level counted |
A child config's check block merges into its parent's key by key, so a child naming only a threshold keeps
the parent's list of checks.
clif check . # lint only
clif check --checks lint,unresolved,format . # choose on the command line
clif check --format github . # GitHub Actions annotations
clif check --format json . > check.json # one document for other toolsText output:
page.cfm:12:5: [lint MISSING_VAR] Variable x is not declared with a var statement.
lint FAIL 1 findings in 240 files
format pass 0 findings in 240 files
check failed
JSON output shape:
{
"passed": false,
"checks": [
{
"name": "lint",
"status": "fail",
"findings": [
{ "file": "page.cfm", "rule": "MISSING_VAR", "severity": "WARNING",
"message": "Variable x is not declared with a var statement.", "line": 12, "column": 5 }
],
"baselined": 3,
"maxFindings": 0,
"files": 240
},
{ "name": "format", "status": "pass", "findings": [], "maxFindings": 0, "files": 240 }
]
}| Field | Description |
|---|---|
name |
The check |
status |
pass, fail or error
|
error |
Why the check could not run (with status: "error") |
findings[] |
{file, rule, severity, message, line, column}; line/column are 1-based, column 0 when unknown |
baselined |
Findings a baseline listed and so were not counted |
maxFindings |
The threshold applied |
files |
Files the check looked at |
skipped |
Files the check could not judge (format refusals) |
| Code | Meaning |
|---|---|
0 |
Every check passed |
1 |
A check found more than it allows |
2 |
A check could not run (CFLint unavailable, an unparseable .cflintrc, a missing baseline, unreadable inputs), a path that does not exist, or a usage error |
name: CFML checks
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install clif
run: |
curl -L https://github.com/cfmleditor/clif/releases/latest/download/clif-linux-amd64.tar.gz | tar xz
sudo mv clif /usr/local/bin/
- name: Check
run: clif check --format github .clif scan [options] <file-or-dir> [...]
Parses CFML files with the tree-sitter grammar and reports every file it could not parse, with the position of each error.
| Option | Description |
|---|---|
--out <file> |
Write the report here instead of stdout |
--format <f> |
text, md or json (defaults from the --out extension, else text) |
--json |
Shorthand for --format json
|
clif scan src/
clif scan --out parse-errors.md src/ # markdown, from the extension
clif scan --json src/ > parse-errors.jsonThe editor offers the same scan as the code action "Scan workspace for parse errors"
(clif.scanWorkspace).
clif parse <file-or-dir> [...]
Parses CFML files and reports, per file, how long the parse took and how many functions and component references it found, then the totals. Useful for diagnosing slow files and for benchmarking.
clif parse src/models/