Expand description
The post-edit check: which symbols changed shape against a base revision, and which sites of each the diff did not reach.
The base symbols come from a scan of the base revision of the changed files into a side index
under <root>/.code-kb/check/<pid>/, which is removed when the check ends. The current symbols
and the sites come from the main index, after the changed files are refreshed in it.
Structs§
- Blocked
Site - A site that a Stop hook listed: the hash of its trimmed line text and how many lines of its file had that text. An edit above a site moves it, so the next Stop counts lines, not places.
- Edit
Check - The answer of one check.
diff_hashnames the state of the changed files, so a caller can tell a repeated check of the same diff. - Edit
Limits - The cuts that bound one check.
- Edit
Site - One site of a changed symbol: where it is, the function that holds it, and a note on the argument count it passes.
- Pending
Check - A check up to its diff hash: the base, the changed files, and the hash of their content, with
no scan of the base. A caller that remembers the hash of an earlier check can drop a repeat
before
PendingCheck::runpays for the scan and the report. - Session
Lock - The lock of one session. Dropping it removes the lock file.
- Session
State - What the hooks remember about one session.
- Shape
Change - A symbol whose shape changed, with its sites sorted by whether the diff reached them.
Enums§
- Base
Request - The revision a check compares the working tree with.
- Base
Source - Where the base revision of a check comes from.
- Edit
Check Error
Functions§
- any_
site_ edited - True when an edit changed a marked site: its file now has fewer lines with its text.
- head_
commit - The commit
HEADnames in the repository that holdsroot:Noneoutside a repository and before the first commit. - is_
session_ id - True for a session id that is safe in a file name: letters, digits,
_and-only. - latest_
session_ base - The base of the session file written last within the past day, for a caller that has no session id.
- lock_
session - Takes the lock of a session by creating
{session_id}.lockexclusively, polling for up towait.Nonewhen the lock stays held, or the id or the folder is unusable. A lock file older than the hook timeout belongs to a hook that died, and the next caller takes it over. - mark_
sites - Marks each
(path, line)site with the text of its line in the working tree. A site whose line cannot be read gets no mark. - prune_
sessions - Removes the session files that no session can still use.
- read_
session - record_
session_ base - Records
headas the base of a session whose file has none, and keeps the other fields of the file. A session that has a base keeps it, so a resume or a compaction does not move it. The caller holds the session lock, because aStophook rewrites the whole file. - write_
session