Skip to content

Commit b78c417

Browse files
committed
Blog post about output
1 parent 1075e84 commit b78c417

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

docs/_posts/2025-04-13-output.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: Output from namelint
3+
h1: Output
4+
---
5+
6+
We are designing what running namelint should produce. Criteria:
7+
8+
* Guaranteed UTF-8: no invalid Unicode UTF-8 byte sequences
9+
* Nothing unsafe: looking at the output shouldn't mess up your terminal
10+
* Separate results (ex: lint errors) from tooling messages (ex: errors loading rules)
11+
* Distinct: filenames should be as close to actual as possible, but still show what is going on behind the scenes
12+
* Nice output for humans looking at a tty
13+
* Nice output when running in CI
14+
15+
## What goes where
16+
17+
* Stdout: Progress updates (controlled by a `--progress` option)
18+
* Stdout: human-readable lint results
19+
* Stderr: tooling messages (controlled by a `--loglevel` option)
20+
* File: machine-readable (=JSON) lint results (controlled by a `--output` option)
21+
22+
## Details
23+
24+
Progress is one of `none`, `dots` or `bar`. If stdout is a tty, the default is `bar`. Otherwise the default is `dots`.
25+
26+
The JSON output has:
27+
* the `filename` if the filename is UTF-8 and has no null bytes. All non-ASCII characters will use the escaped form (`\uXXXX`), so the file should be 7-bit ASCII safe.
28+
* a `bytes` version of the filename if there are any non-Posix characters.
29+
* a `display` version of the filename, with non-Posix characters replaced by `?`

0 commit comments

Comments
 (0)