Skip to content

Commit e7cdf54

Browse files
joebowbeeralexellis
authored andcommittedMar 7, 2025·
Add dotenv-linter tool
Signed-off-by: Joe Bowbeer <joe.bowbeer@gmail.com>
1 parent c7ccc13 commit e7cdf54

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed
 

‎README.md

+1
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@ There are 52 apps that you can install on your cluster.
791791
| [dive](https://github.com/wagoodman/dive) | A tool for exploring each layer in a docker image |
792792
| [docker-compose](https://github.com/docker/compose) | Define and run multi-container applications with Docker. |
793793
| [doctl](https://github.com/digitalocean/doctl) | Official command line interface for the DigitalOcean API. |
794+
| [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) | Dotenv-linter is a lightning-fast linter for .env files. Written in Rust. |
794795
| [duplik8s](https://github.com/Telemaco019/duplik8s) | kubectl plugin to duplicate resources in a Kubernetes cluster. |
795796
| [eks-node-viewer](https://github.com/awslabs/eks-node-viewer) | eks-node-viewer is a tool for visualizing dynamic node usage within an EKS cluster. |
796797
| [eksctl](https://github.com/eksctl-io/eksctl) | Amazon EKS Kubernetes cluster management |

‎pkg/get/get_test.go

+58
Original file line numberDiff line numberDiff line change
@@ -8293,3 +8293,61 @@ func Test_Download_alloy(t *testing.T) {
82938293
}
82948294
}
82958295
}
8296+
8297+
func Test_DownloadDotenvLinter(t *testing.T) {
8298+
tools := MakeTools()
8299+
name := "dotenv-linter"
8300+
8301+
tool := getTool(name, tools)
8302+
8303+
const toolVersion = "v3.3.0"
8304+
8305+
tests := []test{
8306+
{
8307+
os: "darwin",
8308+
arch: arch64bit,
8309+
version: toolVersion,
8310+
url: `https://github.com/dotenv-linter/dotenv-linter/releases/download/v3.3.0/dotenv-linter-darwin-x86_64.tar.gz`,
8311+
},
8312+
{
8313+
os: "darwin",
8314+
arch: archDarwinARM64,
8315+
version: toolVersion,
8316+
url: `https://github.com/dotenv-linter/dotenv-linter/releases/download/v3.3.0/dotenv-linter-darwin-arm64.tar.gz`,
8317+
},
8318+
{
8319+
os: "linux",
8320+
arch: arch64bit,
8321+
version: toolVersion,
8322+
url: `https://github.com/dotenv-linter/dotenv-linter/releases/download/v3.3.0/dotenv-linter-linux-x86_64.tar.gz`,
8323+
},
8324+
{
8325+
os: "linux",
8326+
arch: archARM64,
8327+
version: toolVersion,
8328+
url: `https://github.com/dotenv-linter/dotenv-linter/releases/download/v3.3.0/dotenv-linter-linux-aarch64.tar.gz`,
8329+
},
8330+
{
8331+
os: "ming",
8332+
arch: arch64bit,
8333+
version: toolVersion,
8334+
url: "https://github.com/dotenv-linter/dotenv-linter/releases/download/v3.3.0/dotenv-linter-win-x64.zip",
8335+
},
8336+
{
8337+
os: "ming",
8338+
arch: archARM64,
8339+
version: toolVersion,
8340+
url: "https://github.com/dotenv-linter/dotenv-linter/releases/download/v3.3.0/dotenv-linter-win-aarch64.zip",
8341+
},
8342+
}
8343+
8344+
for _, tc := range tests {
8345+
got, err := tool.GetURL(tc.os, tc.arch, tc.version, false)
8346+
if err != nil {
8347+
t.Fatal(err)
8348+
}
8349+
if got != tc.url {
8350+
t.Errorf("want: %s, got: %s", tc.url, got)
8351+
}
8352+
}
8353+
}

‎pkg/get/tools.go

+25
Original file line numberDiff line numberDiff line change
@@ -4549,5 +4549,30 @@ https://github.com/grafana/alloy/releases/download/{{.Version}}/{{$fileName}}`,
45494549
{{- end -}}
45504550
`,
45514551
})
4552+
4553+
tools = append(tools,
4554+
Tool{
4555+
Owner: "dotenv-linter",
4556+
Repo: "dotenv-linter",
4557+
Name: "dotenv-linter",
4558+
VersionStrategy: GitHubVersionStrategy,
4559+
Description: "A lightning-fast linter for .env files.",
4560+
BinaryTemplate: `
4561+
{{$os := .OS}}
4562+
{{$arch := .Arch}}
4563+
{{$ext := "tar.gz"}}
4564+
4565+
{{- if HasPrefix .OS "ming" -}}
4566+
{{$os = "win"}}
4567+
{{- if eq .Arch "x86_64" -}}
4568+
{{$arch = "x64"}}
4569+
{{- end -}}
4570+
{{$ext = "zip"}}
4571+
{{- end -}}
4572+
4573+
dotenv-linter-{{$os}}-{{$arch}}.{{$ext}}
4574+
`,
4575+
})
4576+
45524577
return tools
45534578
}

0 commit comments

Comments
 (0)
Please sign in to comment.