Skip to content

Add formatter = false opt-out for autoformat on save#24

Merged
Mathijs-Bakker merged 28 commits intomasterfrom
feat/optional_formatter
Mar 30, 2026
Merged

Add formatter = false opt-out for autoformat on save#24
Mathijs-Bakker merged 28 commits intomasterfrom
feat/optional_formatter

Conversation

@Mathijs-Bakker
Copy link
Copy Markdown
Owner

@Mathijs-Bakker Mathijs-Bakker commented Mar 30, 2026

Summary

This change adds an explicit way to disable formatter execution on save by setting:

formatter = false

Previously, falsey values like nil or "" still fell back to gdformat, which caused warning notifications on every save for users who do not want plugin-managed formatting.

Changes

  • Treat formatter = false as an explicit opt-out in the formatting codepath
  • Skip formatter health warnings when formatting is intentionally disabled
  • Document formatter = false in the README and help docs
  • Add tests covering the disabled formatter behavior

Result

Users who do not use gdformat can now disable autoformat-on-save cleanly without repeated error messages.

Testing

  • Ran nvim --headless -u NONE -c "luafile tests/run.lua" -c "qa!"
  • All 25 tests passed

Related Issues

Closes: #23

  Alternative with more detail:

  refactor(core): harden formatting and command registration

  - replace shell-based GDScript formatting with vim.system
  - read formatter config at execution time instead of module load
  - normalize editor server and reconnect command setup
  - make autocmd registration idempotent with augroups
  Alternative with more detail:

  refactor(formatting): support argv formatter commands

  - document formatter_cmd as string or argv list
  - align health checks with list-style formatter commands
  - recommend argv usage for formatter flags in README and help docs
  - extract docs config/url helpers into a common module
  - extract fetch/cache/index lookup into a dedicated fetch module
  - extract rst-to-markdown parsing into a renderer-neutral parser module
  - extract float/browser/buffer rendering into a render module
  - preserve reload/reset behavior across split docs state
  - run the Neovim headless test suite on pull requests and pushes to master
  - install Neovim 0.11.4 in CI
  - document the CI-backed test command in README and CONTRIBUTING
@Mathijs-Bakker Mathijs-Bakker added the enhancement New feature or request label Mar 30, 2026
@Mathijs-Bakker Mathijs-Bakker merged commit a8fad35 into master Mar 30, 2026
1 check passed
@Mathijs-Bakker Mathijs-Bakker deleted the feat/optional_formatter branch March 30, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add option to disable the auto-formatting

1 participant