1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
// SPDX-License-Identifier: Apache-2.0
//! The palette of [`headwater_paint`], re-exported, plus the three functions
//! that read a [`Severity`] and so could not move down with it.
//!
//! # Where the primitives went, and why they left
//!
//! [`ColorMode`], [`Role`], [`ROLES`], [`color_of`], [`paint`] and [`dim`]
//! lived in this file until #479. They sat here, beside [`crate::fill`],
//! because every renderer that wanted color sat above this crate:
//! [`Finding::render`](crate::finding::Finding::render) and
//! [`Run::render`](crate::Run::render) are here, and `headwater-query`'s
//! `explain` and `headwater-sweep`'s `plan` and `intake` all depend on this
//! crate already.
//!
//! That reasoning was sound and it had an edge nobody had read. This crate
//! depends on `headwater-census`, `headwater-resolve` and `headwater-lock`, so
//! a renderer inside any of those three could never name this module: cargo
//! refuses the cycle. Six of the eleven command lines whose interface contract
//! promises terminal sensing render in exactly those crates, starting with
//! `headwater derived`. So the primitives moved to `headwater-paint`, a leaf
//! with no dependencies, and this module re-exports them under the paths they
//! already had. No import anywhere in this workspace moved.
//!
//! # What stayed
//!
//! [`glyph`], [`severity_role`] and [`severity_word`] read [`Severity`], which
//! is a type of the check layer. Moving them would have moved `Severity` into
//! a crate about a terminal palette, which is the swap the move was avoiding
//! in the other direction.
//!
//! `engine/crates/cli/src/paint.rs` re-exports this module in turn, so
//! `headwater_cli::paint::*` still answers, and `main.rs` stays the one place
//! that decides *whether* a stream renders color at all — `stdout_color` and
//! its `stderr` twin stay in `headwater-cli`, because the terminal a process
//! is attached to is a fact about the binary rather than about a corpus.
//!
//! # `Plain` writes no escape sequence, ever
//!
//! [`glyph`] is the half of that fallback this module still owns: a literal
//! character, never wrapped in an escape sequence, that a caller prints beside
//! a severity word so the distinction survives where hue cannot carry it.
use crateSeverity;
pub use ;
/// The role a severity renders under, so a caller never hand-maps the three
/// [`Severity`] variants onto [`Role`] a second time.
/// The literal glyph a severity prints beside its word under [`ColorMode::Plain`].
///
/// `✗`, `▲` and `·`, in [`Severity`]'s own order. Never wrapped in an escape
/// sequence: the character alone is the whole of what carries the
/// distinction where hue cannot.
/// A severity word, in the shape every renderer prints it: colored under
/// `Ansi`, and a glyph beside the bare word under `Plain`.
///
/// One function rather than a `paint`/`glyph` pair at every call site, because
/// [`Finding::render`](crate::finding::Finding::render) and
/// [`crate::Run::render`]'s severity counts both need exactly this pairing and
/// a third copy of the pairing is the drift this module exists to refuse.