Skip to content

Commit

Permalink
Add dotenv-linter tool
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Bowbeer <[email protected]>
  • Loading branch information
joebowbeer authored and alexellis committed Mar 7, 2025
1 parent c7ccc13 commit e7cdf54
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,7 @@ There are 52 apps that you can install on your cluster.
| [dive](https://github.com/wagoodman/dive) | A tool for exploring each layer in a docker image |
| [docker-compose](https://github.com/docker/compose) | Define and run multi-container applications with Docker. |
| [doctl](https://github.com/digitalocean/doctl) | Official command line interface for the DigitalOcean API. |
| [dotenv-linter](https://github.com/dotenv-linter/dotenv-linter) | Dotenv-linter is a lightning-fast linter for .env files. Written in Rust. |
| [duplik8s](https://github.com/Telemaco019/duplik8s) | kubectl plugin to duplicate resources in a Kubernetes cluster. |
| [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. |
| [eksctl](https://github.com/eksctl-io/eksctl) | Amazon EKS Kubernetes cluster management |
Expand Down
58 changes: 58 additions & 0 deletions pkg/get/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8293,3 +8293,61 @@ func Test_Download_alloy(t *testing.T) {
}
}
}

func Test_DownloadDotenvLinter(t *testing.T) {
tools := MakeTools()
name := "dotenv-linter"

tool := getTool(name, tools)

const toolVersion = "v3.3.0"

tests := []test{
{
os: "darwin",
arch: arch64bit,
version: toolVersion,
url: `https://github.com/dotenv-linter/dotenv-linter/releases/download/v3.3.0/dotenv-linter-darwin-x86_64.tar.gz`,
},
{
os: "darwin",
arch: archDarwinARM64,
version: toolVersion,
url: `https://github.com/dotenv-linter/dotenv-linter/releases/download/v3.3.0/dotenv-linter-darwin-arm64.tar.gz`,
},
{
os: "linux",
arch: arch64bit,
version: toolVersion,
url: `https://github.com/dotenv-linter/dotenv-linter/releases/download/v3.3.0/dotenv-linter-linux-x86_64.tar.gz`,
},
{
os: "linux",
arch: archARM64,
version: toolVersion,
url: `https://github.com/dotenv-linter/dotenv-linter/releases/download/v3.3.0/dotenv-linter-linux-aarch64.tar.gz`,
},
{
os: "ming",
arch: arch64bit,
version: toolVersion,
url: "https://github.com/dotenv-linter/dotenv-linter/releases/download/v3.3.0/dotenv-linter-win-x64.zip",
},
{
os: "ming",
arch: archARM64,
version: toolVersion,
url: "https://github.com/dotenv-linter/dotenv-linter/releases/download/v3.3.0/dotenv-linter-win-aarch64.zip",
},
}

for _, tc := range tests {
got, err := tool.GetURL(tc.os, tc.arch, tc.version, false)
if err != nil {
t.Fatal(err)
}
if got != tc.url {
t.Errorf("want: %s, got: %s", tc.url, got)
}
}
}
25 changes: 25 additions & 0 deletions pkg/get/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -4549,5 +4549,30 @@ https://github.com/grafana/alloy/releases/download/{{.Version}}/{{$fileName}}`,
{{- end -}}
`,
})

tools = append(tools,
Tool{
Owner: "dotenv-linter",
Repo: "dotenv-linter",
Name: "dotenv-linter",
VersionStrategy: GitHubVersionStrategy,
Description: "A lightning-fast linter for .env files.",
BinaryTemplate: `
{{$os := .OS}}
{{$arch := .Arch}}
{{$ext := "tar.gz"}}
{{- if HasPrefix .OS "ming" -}}
{{$os = "win"}}
{{- if eq .Arch "x86_64" -}}
{{$arch = "x64"}}
{{- end -}}
{{$ext = "zip"}}
{{- end -}}
dotenv-linter-{{$os}}-{{$arch}}.{{$ext}}
`,
})

return tools
}

0 comments on commit e7cdf54

Please sign in to comment.