docs(mdformat): apply markdown table formatting to all docs#443
docs(mdformat): apply markdown table formatting to all docs#443ajalon1 wants to merge 2 commits into
Conversation
Add a new Go-based markdown table formatter tool using the fbiville/markdown-table-formatter library. The tool formats markdown tables to be readable in raw form by aligning columns with padding. New additions: - tools/mdformat/: Standalone Go tool that parses and formats markdown tables - format-md-tables task: Manually format markdown tables - lint task: Now checks markdown tables (with -check flag) - delint task: Now formats markdown tables as first step The tool recursively formats all .md files while skipping .factory and node_modules directories. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Run mdformat to align all markdown table columns for improved readability in raw form. This ensures consistent table formatting throughout the codebase, making tables easier to read and edit in plain text editors. Changes apply formatting to: - Project documentation - Command reference docs - Development guides - User guides - Factory configuration documentation - Component templates Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Reviewed by Cursor Bugbot for commit ef3d160. Configure here.
| func isTableLine(line string) bool { | ||
| trimmed := strings.TrimSpace(line) | ||
| return strings.Contains(trimmed, "|") | ||
| } |
There was a problem hiding this comment.
Table detector matches pipe characters inside code blocks
High Severity
The isTableLine function treats any line containing | as a table row, with no tracking of fenced code block boundaries (```). The formatMarkdown loop accumulates consecutive |-containing lines and reformats them via formatTable. If a markdown file contains two or more consecutive lines with | inside a code block (e.g., shell pipe commands, PowerShell pipelines, YAML multiline blocks), those lines get silently reformatted into a markdown table, corrupting the code block. Since this tool is wired into both lint and delint Taskfile tasks, it will automatically process all future markdown files added to the repository.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit ef3d160. Configure here.
| } | ||
| } | ||
|
|
||
| return strings.TrimSuffix(result.String(), "\n") |
There was a problem hiding this comment.
Formatter strips trailing newline from every processed file
Medium Severity
formatMarkdown ends with strings.TrimSuffix(result.String(), "\n"), which unconditionally strips the final newline. Since bufio.Scanner with ScanLines consumes the terminal \n without emitting an empty token, the result builder adds \n after each line, and TrimSuffix removes the last one. Every file that properly ends with a single \n (POSIX text file convention) loses it. This is visible in the diff where dozens of files show their last line "changed" despite identical content — only the trailing newline was removed.
Reviewed by Cursor Bugbot for commit ef3d160. Configure here.


Apply markdown table formatting to align all tables for improved readability in raw form.
What changed
Reformatted 46 markdown files to ensure consistent table column alignment:
Benefits
Dependencies
Requires PR #442 (feat(mdformat): add markdown table formatter tool and tasks)
Note
Low Risk
Primarily documentation reformatting plus a new dev-only formatting check in the lint pipeline; risk is limited to potential CI/lint failures or minor developer workflow friction if the formatter behaves unexpectedly.
Overview
Introduces a small Go-based
tools/mdformatutility to auto-format Markdown tables (with a-checkmode) and wires it intoTaskfile.yamlvia newformat-md-tables, plus table checks intask lintand auto-fix intask delint.Applies the formatter across many
.mdfiles (docs,.factory, GitHub templates, and READMEs), primarily adjusting table column alignment and a few whitespace/newline cleanups to make raw Markdown consistently readable.Reviewed by Cursor Bugbot for commit ef3d160. Bugbot is set up for automated code reviews on this repo. Configure here.