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
//! Shared update-check helper for `info` and `doctor`.
//!
//! Never call this from `serve`: stdio is the MCP channel and any stray
//! output corrupts the protocol stream. Never call it from `analyze`, `lint`,
//! `tokens`, `readability`, `completeness`, `grammar`, or `custom` either —
//! those are hot paths that must stay offline.
//!
//! `main` is the only caller, so the whole set of commands that touch the
//! network is visible in one `match`. Commands receive the resulting notice as
//! an argument, which also keeps their unit tests off the network.
/// Check for a newer release, returning a human-readable notice.
///
/// Returns `None` when up to date, suppressed via `BITO_NO_UPDATE_CHECK`, or
/// when the check fails for any reason. A failed update check must never fail
/// the command that requested it — a GitHub outage is not a reason for
/// `bito doctor` to stop working.