Skip to content

builtins: add bats filetype to shfmt - #353

Draft
nertzy wants to merge 1 commit into
nvimtools:mainfrom
nertzy:shfmt-bats
Draft

nertzy wants to merge 1 commit into
nvimtools:mainfrom
nertzy:shfmt-bats

Conversation

@nertzy

@nertzy nertzy commented Oct 12, 2026 •

Copy link
Copy Markdown

What does this PR do?

Adds the bats filetype to shfmt. I've proposed giving *.bats files their own bats filetype in Vim (vim/vim#21516) rather than sh; if that lands and reaches Neovim, shfmt would stop running on Bats files without this. shfmt already formats them with its bats dialect, chosen from the .bats name passed via -filename.

This is part of a broader effort to improve Bats support across editors. I maintain tree-sitter-bats.

Checklist

  • If I'm adding a new builtin (linter, formatter, code action, etc.), I
    understand it should be contributed to
    nvimtools/none-ls-extras.nvim
    instead
  • I've written tests for these changes — one-line filetype addition; formatting builtins have no tests. Checked by hand that shfmt formats a bats buffer through none-ls.

shfmt formats Bats test files using its bats dialect, which it selects
from the .bats name this builtin passes with -filename.
Copilot AI balanced review requested due to automatic review settings October 12, 2026 16:25
@coderabbitai

coderabbitai Bot commented Oct 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f111108c-a542-439e-8c43-78c7ba7f05f3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI 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.

🟢 Approval recommended

The focused metadata change correctly enables existing filename-based Bats formatting behavior.

0 open findings

What changed in this PR

Adds Bats filetype support to the existing shfmt formatter.

Changes:

  • Enables shfmt for bats buffers.
File Description
lua/​null-ls/​builtins/​formatting/​shfmt.lua Adds bats to supported filetypes.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jfly jfly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, but please mark as draft until vim/vim#21516 lands. Unless there's some value to this even if vim/vim#21516 never lands?

@nertzy
nertzy marked this pull request as draft October 14, 2026 23:22
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.

3 participants