From eee1378b698a89bd9ebd25e3a99085bcb19181d7 Mon Sep 17 00:00:00 2001 From: Spill-Tea Date: Mon, 30 Jun 2025 21:20:24 -0700 Subject: [PATCH 1/3] feat(cython): Support cython files. Include test data. --- main.go | 2 +- main_test.go | 2 +- testdata/expected/file.pxd | 16 ++++++++++++++++ testdata/expected/file.pyx | 16 ++++++++++++++++ testdata/initial/file.pxd | 2 ++ testdata/initial/file.pyx | 2 ++ 6 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 testdata/expected/file.pxd create mode 100644 testdata/expected/file.pyx create mode 100644 testdata/initial/file.pxd create mode 100644 testdata/initial/file.pyx diff --git a/main.go b/main.go index 3fc60e1..5d31350 100644 --- a/main.go +++ b/main.go @@ -329,7 +329,7 @@ func licenseHeader(path string, tmpl *template.Template, data licenseData) ([]by ".nix", ".pl", ".pp", - ".py", + ".py", ".pyx", ".pxd", ".raku", ".rb", ".ru", "gemfile", ".sh", ".bash", ".zsh", diff --git a/main_test.go b/main_test.go index 48bd8c4..ffd25ef 100644 --- a/main_test.go +++ b/main_test.go @@ -354,7 +354,7 @@ func TestLicenseHeader(t *testing.T) { "f.nix", "f.pl", "f.pp", - "f.py", + "f.py", "f.pyx", "f.pxd", "f.raku", "f.rb", "f.ru", "gemfile", "f.sh", "f.bash", "f.zsh", diff --git a/testdata/expected/file.pxd b/testdata/expected/file.pxd new file mode 100644 index 0000000..0ffbcc7 --- /dev/null +++ b/testdata/expected/file.pxd @@ -0,0 +1,16 @@ +# 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. + +cdef void main(): + print("Hello World!") diff --git a/testdata/expected/file.pyx b/testdata/expected/file.pyx new file mode 100644 index 0000000..693aa92 --- /dev/null +++ b/testdata/expected/file.pyx @@ -0,0 +1,16 @@ +# 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. + +def main() -> None: + print("Hello World!") diff --git a/testdata/initial/file.pxd b/testdata/initial/file.pxd new file mode 100644 index 0000000..48bbf91 --- /dev/null +++ b/testdata/initial/file.pxd @@ -0,0 +1,2 @@ +cdef void main(): + print("Hello World!") diff --git a/testdata/initial/file.pyx b/testdata/initial/file.pyx new file mode 100644 index 0000000..122d9b0 --- /dev/null +++ b/testdata/initial/file.pyx @@ -0,0 +1,2 @@ +def main() -> None: + print("Hello World!") From 16cdd872ef9930585ff480b58d07b8a9ca5e9775 Mon Sep 17 00:00:00 2001 From: Spill-Tea Date: Tue, 1 Jul 2025 15:50:42 -0700 Subject: [PATCH 2/3] fix(ci): Update goreleaser api to replace deprecated --rm-dist option with --clean arg #190 --- .github/workflows/release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 12181f7..ec2278b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -29,7 +29,7 @@ jobs: with: distribution: goreleaser version: '~> v1' - args: release --rm-dist + args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 30e64751dd5aacfa0cf45ec46313d7718ff4386b Mon Sep 17 00:00:00 2001 From: Spill-Tea Date: Tue, 1 Jul 2025 15:52:43 -0700 Subject: [PATCH 3/3] fix(.goreleaser): Fix goreleaser config file to use name_template key instead of replacements #190. --- .goreleaser.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index b06b10e..a7c502f 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -15,12 +15,16 @@ archives: - format_overrides: - goos: windows format: zip - replacements: - darwin: macOS - linux: Linux - windows: Windows - 386: i386 - amd64: x86_64 + name_template: >- + {{- .ProjectName }}_ + {{- .Tag }}_ + {{- if eq .Os "darwin" }}macOS + {{- else if eq .Os "windows" }}Windows + {{- else if eq .Os "linux" }}Linux + {{- else }}{{ .Os }}{{ end }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} files: - LICENSE checksum: