Expand description
Small helpers shared by core and first-party plugins, so each rule has one implementation.
Functions§
- parse_
cell - Parse a cell reference (
B12,$B$12) into zero-based(row, col).$may only appear directly before the column letters and before the row number. - percent_
encode - Percent-encode everything except RFC 3986 unreserved characters and, if
keep_slash,/. - scaled_
decimal - Parse decimal text (
"-12.30") into an integer scaled by10^scalefor an Arrow decimal. Negative scales are allowed ("1200"at scale -2 is12). Digits that the scale would drop must be zero: a value that doesn’t fit the scale is an error, never silently cut. - summarize
- One line, at most
maxcharacters, for quoting SQL in messages. - write_
atomic - Write
bytestopathso that a reader, or a crash, sees either the old file or the new one, never a part: write a temporary file (.<name>.<pid>.<random>.tmp) in the same folder, flush it to disk, rename it overpath, then flush the folder (Unix; a folder that can’t be flushed, such as some network mounts, is logged at debug and ignored). For DRE’s durable state (run_results.json, the drift snapshot, the manifest,dre.lock, sessions), not report outputs. - write_
atomic_ mode write_atomic, creating the file with Unix permissionsmode(e.g.0o600for secrets).