From e6749b5955adf9fe9fb35c159c7ce7c33c2fdbd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20BERSAC?= <542613+bersace@users.noreply.github.com> Date: Fri, 14 Feb 2025 23:34:43 +0100 Subject: [PATCH] Use shell script language for bats files (#24877) bats is a superset of bash. It's a common tool for writing TAP tests in bash. https://bats-core.readthedocs.io/en/stable/tutorial.html#your-first-test Release Notes: - Added recognition for `.bats` files as "Shell Script". --------- Co-authored-by: Marshall Bowers --- crates/languages/src/bash/config.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/languages/src/bash/config.toml b/crates/languages/src/bash/config.toml index 9f1cfe4a35..d8c348e492 100644 --- a/crates/languages/src/bash/config.toml +++ b/crates/languages/src/bash/config.toml @@ -1,9 +1,9 @@ name = "Shell Script" code_fence_block_name = "bash" grammar = "bash" -path_suffixes = ["sh", "bash", "bashrc", "bash_profile", "bash_aliases", "bash_logout", "profile", "zsh", "zshrc", "zshenv", "zsh_profile", "zsh_aliases", "zsh_histfile", "zlogin", "zprofile", ".env", "PKGBUILD"] +path_suffixes = ["sh", "bash", "bashrc", "bash_profile", "bash_aliases", "bash_logout", "bats", "profile", "zsh", "zshrc", "zshenv", "zsh_profile", "zsh_aliases", "zsh_histfile", "zlogin", "zprofile", ".env", "PKGBUILD"] line_comments = ["# "] -first_line_pattern = '^#!.*\b(?:ash|bash|dash|sh|zsh)\b' +first_line_pattern = '^#!.*\b(?:ash|bash|bats|dash|sh|zsh)\b' brackets = [ { start = "[", end = "]", close = true, newline = false }, { start = "(", end = ")", close = true, newline = true },