Skip to content

anodize-inc/flowmark-pre-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

flowmark-pre-commit

A pre-commit hook for flowmark, a Markdown auto-formatter.

Usage

Add to your .pre-commit-config.yaml:

repos:
  - repo: https://github.com/patricklittle/flowmark-pre-commit
    rev: v0.1.0
    hooks:
      - id: flowmark

By default, the hook runs flowmark -i --auto, which enables semantic line breaks, safe cleanups, and in-place formatting.

The -i (inplace) flag is always applied via the hook entry and cannot be overridden.

Configuration

Override the default --auto by passing args in your hook config. When args is specified, it replaces the default --auto flag entirely — the -i flag remains since it's part of the hook entry.

For example, to match a Makefile target like flowmark -w 100 -i:

hooks:
  - id: flowmark
    args: ['-w', '100']

To restrict which files are formatted:

hooks:
  - id: flowmark
    args: ['-w', '100']
    files: ^(README\.md|docs/.*\.md)$

All available flags

hooks:
  - id: flowmark
    args: ['--width', '100', '--semantic', '--cleanups', '--nobackup']

Available flags

Flag Description
--auto Convenience flag: enables --semantic --cleanups --inplace --nobackup
-w, --width WIDTH Line width in columns (default: 88, 0 = no wrapping)
-s, --semantic Sentence-based line breaks
-c, --cleanups Safe Markdown normalizations
-i, --inplace Edit files in place (always passed as noted above)
--nobackup Skip .orig backup files with --inplace
--smartquotes Convert straight quotes to typographic quotes
--ellipses Convert ... to
-p, --plaintext Process as plain text, not Markdown

See flowmark --help for the full list of options.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors