FLOOXS » TclLib » lint.tcl

lint.tcl — TclLib Procs

10 documented proc(s) in TclLib/lint.tcl/.

flooxs::__all_procs · flooxs::__chunks · flooxs::__compact · flooxs::__expand_targets · flooxs::__first_nonempty · flooxs::__glob_tcl · flooxs::__proc_syntax_issue · flooxs::__report · flooxs::lint · flooxs::lint_files

flooxs::__all_procs

file: TclLib/lint.tcl

flooxs::__all_procs
  Fully-qualified names of every proc defined in the interp, across all
  namespaces. Diffed around the sandboxed source so only file-defined
  procs get disassembled (library procs auto-loaded during the source
  are clean and not the file's responsibility).

flooxs::__chunks

file: TclLib/lint.tcl

flooxs::__chunks src
  Split a script into complete top-level command strings. Lines are
  accumulated until `info complete`, so each chunk is one whole command
  (balanced braces/brackets) eval'able on its own — the boundary the
  sandboxed source needs so a sentinel return can't abort the rest.

flooxs::__compact

file: TclLib/lint.tcl

flooxs::__compact s
  Collapse a multi-line message to one line, joining non-blank lines
  with an em dash. Keeps the ParamParse diagnostic (which names the
  offending keyword on its own line) on the single reported line.

flooxs::__expand_targets

file: TclLib/lint.tcl

flooxs::__expand_targets paths -> flat list of files to lint
  A directory target expands to its *.tcl files (recursive, sorted); a
  file target passes through unchanged.

flooxs::__first_nonempty

file: TclLib/lint.tcl

flooxs::__first_nonempty s
  First non-blank, trimmed line of a (possibly multi-line) message.

flooxs::__glob_tcl

file: TclLib/lint.tcl

flooxs::__glob_tcl dir
  Every *.tcl file under `dir`, recursing into subdirectories. Each
  level is sorted so the lint order (and any aggregate output) is
  deterministic across runs and filesystems.

flooxs::__proc_syntax_issue

file: TclLib/lint.tcl

flooxs::__proc_syntax_issue name
  Disassemble proc `name` and return a one-line description if its body
  has a compile-time syntax error, else "". Tcl 8.6 does not fail the
  compile on a body parse error; it emits a `syntax` opcode that throws
  at runtime, with the diagnostic pushed as the bytecode's first
  literal. Detect that opcode and recover the message.

flooxs::__report

file: TclLib/lint.tcl

flooxs::__report file issues -> issue count (prints the summary)

flooxs::lint

file: TclLib/lint.tcl

flooxs::lint file
  Lint a single Tcl deck. Prints exactly one structured summary line
  (plus an indented bullet per issue on failure) and returns the number
  of issues found (0 = clean). Never throws for a lint-able file; an
  unreadable file is itself reported as one issue.

flooxs::lint_files

file: TclLib/lint.tcl

flooxs::lint_files file/dir...
  Multi-target entry point (P0.7). Expands directory targets to their
  *.tcl files, lints each via flooxs::lint, and returns the TOTAL issue
  count (0 = all clean) — the value the C++ side maps to the process
  exit status, so a non-zero exit means at least one file failed. A
  single resolved target keeps the exact single-file behavior (no extra
  summary line); two or more print one aggregate LINT SUMMARY line after
  the per-file LINT lines.