emit

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package emit serializes a fingerprint as canonical JSON, a human "pretty" report, or a one-line summary. Human output sanitizes control characters in attacker-controlled strings (filenames) to prevent terminal injection (security-audit finding #2).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(w io.Writer, v any) error

JSON writes v as compact canonical JSON followed by a newline.

func JSONIndent

func JSONIndent(w io.Writer, v any) error

JSONIndent writes v as indented JSON (for humans reading files / --pretty-json).

func Pretty

func Pretty(w io.Writer, out codeprint.Output, root string, dur time.Duration, useColor bool) error

Pretty writes a human-readable report. useColor enables ANSI styling; dur is the wall-clock scan time (human output only — never in the JSON).

func Sanitize

func Sanitize(s string) string

Sanitize removes control characters (except tab) from s so untrusted filenames cannot inject terminal escape sequences.

func Summary

func Summary(w io.Writer, out codeprint.Output) error

Summary writes a one-line digest, e.g.: Go 62% • Python 28% • 48,212 LOC • 412 files • 3 frameworks

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL