magus v0.4.3 is out. See what's new
¶ View markdown source · ✎ Suggest an edit
1 min read

symbol-search

A deny rule: it refuses a recursive text search for names the graph answers exactly: symbols or diagnostic codes, and names what to run instead.

What it catches

A recursive text search for names the graph answers exactly: symbols or diagnostic codes.

Why

It fires only when the graph can VOUCH for every name the pattern looks for: each symbol is defined here and no project's index is older than its sources, and each diagnostic code is one the graph carries a node for. On those terms magus refs <symbol> --occurrences knows every definition and reference, including the generated and cross-language ones a pattern misses, and magus explain diagnostic:<code> knows the code's page and what documents and emits it. An alternation (A\|B, -e A -e B, A|B under -E) is answered with one command per name, and a definition lookup (func X, func (r *T) X, type X) with refs on X. A single name the index cannot vouch for, a BZZ code, a case-insensitive search, or a search of a tree outside the workspace stays advice or nothing. Searching raw TEXT is untouched and has its own answer: magus refs --text <pattern> [<path>...] is a literal substring search with grep's exit codes, scoped by the same trailing paths.

Seeing it

A verdict names its rule in brackets, which is how you got here:

deny [symbol-search]: ...

magus describe rule symbol-search prints the same entry at a terminal, and magus describe rules lists every rule this workspace enforces.

See also

  • All rules - what this workspace enforces, deny first
  • The guard - how a verdict is reached and wired
guardrulessymbol-searchdeny
Last updated (a9ff8609)
Earlier changes on this page (1)

Full history ↗ · Blame source ↗

Glossary

Workspace

The magus root directory that owns a set of projects and shared config; the unit magus operates over. See workspace.

Project

A directory magus recognizes as a unit of work (it has a magusfile); the unit of caching, scheduling, and dependency tracking. See workspace.

Op

A single tool-native command a target composes (long form: operation); the middle of the work hierarchy (Spell to Op to Target). See operations.

Diagnostic code

A stable MGSxxxx identifier attached to a magus warning or error, so it can be referenced and looked up; some are guardrails (see wards), others hard errors.

Run

One target executing under one magus invocation, such as magus run test web or magus affected ci. A run keeps its captured output behind an output reference. Every magus run is a run whether or not any job asked for it; see Job for how the two relate.

Conventions

Placeholders

Angle brackets mark a value you replace with your own - never type the brackets:

magus run <target>
magus completion <shell>    # e.g. bash, zsh, fish

<target>, <path>, <shell>, <name> and the like are stand-ins, not literal text.