From d4839d31d3246f9fcff656ed700d1edb80fc4d99 Mon Sep 17 00:00:00 2001 From: Spill-Tea Date: Fri, 22 May 2026 21:45:12 -0700 Subject: [PATCH] feat(main): Support .bats file types. --- main.go | 2 +- main_test.go | 2 +- testdata/expected/file.bats | 19 +++++++++++++++++++ testdata/initial/file.bats | 5 +++++ 4 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 testdata/expected/file.bats create mode 100644 testdata/initial/file.bats diff --git a/main.go b/main.go index 18bb5a4..be6c92a 100644 --- a/main.go +++ b/main.go @@ -334,7 +334,7 @@ func licenseHeader(path string, tmpl *template.Template, data licenseData) ([]by ".py", ".pyx", ".pxd", ".raku", ".rb", ".ru", "gemfile", - ".sh", ".bash", ".zsh", + ".sh", ".bash", ".zsh", ".bats", ".tcl", ".tf", ".toml", diff --git a/main_test.go b/main_test.go index 5adb4ed..09457ce 100644 --- a/main_test.go +++ b/main_test.go @@ -358,7 +358,7 @@ func TestLicenseHeader(t *testing.T) { "f.py", "f.pyx", "f.pxd", "f.raku", "f.rb", "f.ru", "gemfile", - "f.sh", "f.bash", "f.zsh", + "f.sh", "f.bash", "f.zsh", "f.bats", "f.tcl", "f.tf", "f.toml", diff --git a/testdata/expected/file.bats b/testdata/expected/file.bats new file mode 100644 index 0000000..d6a4f98 --- /dev/null +++ b/testdata/expected/file.bats @@ -0,0 +1,19 @@ +#!/usr/bin/env bats +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +setup() { + +} \ No newline at end of file diff --git a/testdata/initial/file.bats b/testdata/initial/file.bats new file mode 100644 index 0000000..fdb7190 --- /dev/null +++ b/testdata/initial/file.bats @@ -0,0 +1,5 @@ +#!/usr/bin/env bats + +setup() { + +} \ No newline at end of file