Extract sigil-format from sigil monorepo
Sigil's code formatter (paren-inference + AST-aware reflow), now its own repo. History under packages/sigil-format/ in the monorepo is preserved here as master via git filter-repo.
Scaffolding: - README with usage, module table (sigil format + sigil format json), build/test commands. - .gitignore for build/ + .sigil/. - manifest.scm minimal Scheme guix-shell environment. - dev-redirects.sgl wires from-git deps to local sibling checkouts (../sigil for sigil-stdlib via monorepo, ../sigil-json). - sigil.lock from sigil deps install (2 entries).
package.sgl: - Added version 0.13.1. - Fixed description to accurately describe the code formatter (was copy-paste "String formatting utilities" — wrong). - url -> codeberg:sigil/sigil-format. - sigil-stdlib swapped from-workspace -> from-git monorepo-resident ^0.13.1; sigil-json stays at ^0.13.1 (already external).
sigil build clean. sigil test --report 19/19 passed.
Per procedures/sigil-package-extraction.
.gitignore | 2 ++
README.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
dev-redirects.sgl | 9 +++++++++
manifest.scm | 7 +++++++
package.sgl | 12 +++++++-----
sigil.lock | 13 +++++++++++++
6 files changed, 103 insertions(+), 5 deletions(-).gitignoreadded
build/.sigil/README.mdadded
# sigil-formatCode formatter for [Sigil](https://codeberg.org/sigil/sigil) withparen-inference and AST-aware reflow.Sigil's formatter reads a source file, tokenizes it, and uses indentationas a hint to infer missing or surplus parentheses. Where indentation andparens disagree, the indentation wins — the formatter rewrites the parensto match. The output is canonically formatted with consistent indentation.This package was extracted from the sigil monorepo — the in-tree historyunder `packages/sigil-format/` is preserved here as `master`.It backs the `sigil format` CLI subcommand and is used by editor / LSPplugins for in-place formatting.## Usage```scheme(import (sigil format));; Format a file on disk(format-file "src/example.sgl"); => <format-result>;; Format a string in memory(format-string "(define (foo\n x\n (+ x 1))" "test.sgl"); => <format-result>```The result record exposes the formatted output along with diagnostics:```scheme(let ((result (format-file "src/example.sgl"))) (format-result-success result) ; #t/#f (format-result-output result) ; formatted source string (format-result-errors result) ; list of <format-error> (format-result-warnings result) ; list of <format-warning> (format-result-inferences result)) ; list of inferred-paren records```## Modules| Module | Purpose ||--------|---------|| `(sigil format)` | Core formatter — `format-file`, `format-string`, result + diagnostic records || `(sigil format json)` | JSON output of format results, used by `sigil format --format json` (lazy-loaded post-bootstrap) |## Dependencies- `sigil-stdlib`- `sigil-json` — only used by the `(sigil format json)` submodule for the `--format json` CLI output## Build & Test```bashsigil deps installsigil buildsigil test --report```## LicenseBSD-3-Clausedev-redirects.sgladded
;; Development redirects — point dependencies at local Sigil checkouts(redirects repos: (list (for-repo url: "codeberg:sigil/sigil" use: (from-path dir: "../sigil")) (for-repo url: "codeberg:sigil/sigil-json" use: (from-path dir: "../sigil-json"))))manifest.scmadded
;; sigil-format Development Environment;; Use with: guix shell -m manifest.scm(specifications->manifest '("gcc-toolchain" "make" "pkg-config"))package.sglmodified
;;; sigil-format - String formatting utilities;;; sigil-format - Sigil code formatter;;;;;; Provides string formatting facilities for Sigil.;;; Code formatter for Sigil with paren-inference and AST-aware reflow.;;; Backs the `sigil format` CLI subcommand and editor/LSP plugins.(package name: "sigil-format" description: "String formatting utilities for Sigil" url: "https://codeberg.org/sigil/sigil" version: "0.13.1" description: "Sigil code formatter (paren-inference + AST-aware reflow)" url: "https://codeberg.org/sigil/sigil-format" license: "BSD-3-Clause" authors: (list "David Wilson <[email protected]>") dependencies: (list (from-workspace name: "sigil-stdlib") (from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.13.1") (from-git url: "codeberg:sigil/sigil-json" version: "^0.13.1")))sigil.lockadded
;; Auto-generated by sigil deps install. Do not edit.(lock (package name: "sigil-stdlib" url: "codeberg:sigil/sigil" ref: "^0.13.1" sha: "1aea1cecd3487bf07d071da2c1e7eb3cf4bbdb21" package-selector: "sigil-stdlib") (package name: "sigil-json" url: "codeberg:sigil/sigil-json" ref: "^0.13.1" sha: "811b63925399a663e4b7dd25fb0813d59d33f557" version: "0.13.1"))