Skip to content

docs(mdformat): apply markdown table formatting to all docs#443

Closed
ajalon1 wants to merge 2 commits into
datarobot-oss:mainfrom
ajalon1:aj/format-markdown-tables
Closed

docs(mdformat): apply markdown table formatting to all docs#443
ajalon1 wants to merge 2 commits into
datarobot-oss:mainfrom
ajalon1:aj/format-markdown-tables

Conversation

@ajalon1

@ajalon1 ajalon1 commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

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:

  • Project documentation
  • Command reference docs
  • Development guides
  • User guides
  • Factory configuration documentation
  • Component templates

Benefits

  • Tables are now readable in raw form (plain text editors)
  • Consistent formatting throughout the codebase
  • Easier to edit and maintain markdown files
  • Improves developer experience when viewing source files

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/mdformat utility to auto-format Markdown tables (with a -check mode) and wires it into Taskfile.yaml via new format-md-tables, plus table checks in task lint and auto-fix in task delint.

Applies the formatter across many .md files (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.

ajalon1 and others added 2 commits April 17, 2026 12:45
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>
@ajalon1 ajalon1 closed this Apr 17, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit ef3d160. Configure here.

Comment thread tools/mdformat/main.go
func isTableLine(line string) bool {
trimmed := strings.TrimSpace(line)
return strings.Contains(trimmed, "|")
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ef3d160. Configure here.

Comment thread tools/mdformat/main.go
}
}

return strings.TrimSuffix(result.String(), "\n")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ef3d160. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant