Skip to content

refactor: shared FS helpers, simpler CLI option parsing, and core API docs - #27

Merged
ikelaiah merged 6 commits into
mainfrom
quality/fs-helpers-and-polish
Sep 19, 2026
Merged

ikelaiah merged 6 commits into
mainfrom
quality/fs-helpers-and-polish

Conversation

@ikelaiah

@ikelaiah ikelaiah commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

Follow-up polish pass: shared filesystem helpers, a simpler CLI option parser, and API documentation across the core units.

Commits

Commit Change
refactor(fs): add a shared filesystem helper unit New leaf PasWeave.FS (src/support/) owns path normalization, whole-file reads, Pascal source detection, build-input extension detection, readability probing, and symlink checks. Duplicates removed from Parser, FPCAdapter.Symbols, Lazarus.Support, Compiler, Incremental, and Output.
refactor(cli): centralize option value handling New MatchValueOption helper handles --name value and --name=value in one place; ParseCommandLine drops from ~223 to ~111 lines with identical messages and precedence.
docs(api): ... (four commits) XMLDoc on the Parser public API, FPCAdapter.ParseUnitFile, CLI exit codes, Comments, Compiler options, the Model, and the HTML/Markdown renderer entry points.

Directory walkers intentionally remain specialized: discovery prunes excluded directories mid-walk, incremental fingerprints root-relative paths, and package scanning filters .lpk, so merging them would change pruning and ordering semantics. (PasWeave.FS documents this in the changelog entry.)

Verification

  • make test passes (CLI suite + functional suites) after every commit.
  • scripts/check-docs-links.ps1 passes (62 files).
  • Checked-in example goldens are byte-identical.
  • Full production build is clean.

Move path normalization, whole-file reads, Pascal source detection,
readability probing, and symlink checks into the leaf unit PasWeave.FS.
Parser, discovery, Lazarus, output, and symbol conversion now share one
definition of each helper instead of carrying local copies.

Directory walkers stay specialized because their filtering and pruning
semantics differ. No behavior changes.

Verified: make test (CLI and functional suites) and byte-identical checked-in
example output.
Add XMLDoc comments to the Parser public API (input error, discovery
options, and the BuildProject overloads), the FPCAdapter.ParseUnitFile
contract, and the complete CLI exit-code contract.
Replace the repeated --name and --name=value branch pairs with the
MatchValueOption helper, which also advances the argument index for the
separated form. ParseCommandLine drops from about 223 to 111 lines and the
value syntax is handled in one place; all error messages and precedence are
unchanged.

Verified: make test (CLI and functional suites) and byte-identical checked-in
example output.
Add XMLDoc comments to the Comments unit (comment forms, style parsing,
documentation extraction) and the Compiler unit (TCompilerOptions behavior,
target normalization, and validation errors).
Add XMLDoc comments to the model types, fields, constants, and helper
functions, including stable ID/anchor behavior, relationship resolution
state, and the branding validators.
Describe each public renderer function and the page sites written by
WriteHTMLDocumentation and WriteMarkdownDocumentation.
@ikelaiah ikelaiah self-assigned this Sep 19, 2026
@ikelaiah ikelaiah added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 19, 2026
@ikelaiah
ikelaiah merged commit b06239c into main Sep 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant