Skip to content

Tooling: Automate word wrapping #841

@hukkin

Description

@hukkin

The Markdown spec seems to have lines wrapped at 80 characters. It's a bit tedious to do the wrapping manually when editing. It is possible to automate this with https://pre-commit.ci/ and mdformat hook.

By adding a .pre-commit-config.yaml

repos:
- repo: https://github.com/executablebooks/mdformat
  rev: '0.7.8'
  hooks:
  - id: mdformat
    args: ['--wrap=80', '--number']

and enabling pre-commit.ci we have a bot pushing correct word wrap changes to PRs. It is also trivial to make this setup automatically fix the ToC if so desired.

I'll happily make a PR if this is something that maintainers want to see.

Disclaimer: I've developed mdformat

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions