From 177d8d7e55670d36a63cb2e6e280cfcce51769b8 Mon Sep 17 00:00:00 2001 From: Evan Fiordeliso Date: Fri, 14 Apr 2023 12:01:06 -0400 Subject: [PATCH] Add trunk configs and fix lint issues --- .trunk/.gitignore | 7 +++++++ .trunk/configs/.hadolint.yaml | 4 ++++ .trunk/configs/.yamllint.yaml | 10 ++++++++++ .trunk/trunk.yaml | 23 +++++++++++++++++++++++ Dockerfile | 9 ++++----- 5 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 .trunk/.gitignore create mode 100644 .trunk/configs/.hadolint.yaml create mode 100644 .trunk/configs/.yamllint.yaml create mode 100644 .trunk/trunk.yaml diff --git a/.trunk/.gitignore b/.trunk/.gitignore new file mode 100644 index 0000000..cf2f254 --- /dev/null +++ b/.trunk/.gitignore @@ -0,0 +1,7 @@ +*out +*logs +*actions +*notifications +plugins +user_trunk.yaml +user.yaml diff --git a/.trunk/configs/.hadolint.yaml b/.trunk/configs/.hadolint.yaml new file mode 100644 index 0000000..98bf0cd --- /dev/null +++ b/.trunk/configs/.hadolint.yaml @@ -0,0 +1,4 @@ +# Following source doesn't work in most setups +ignored: + - SC1090 + - SC1091 diff --git a/.trunk/configs/.yamllint.yaml b/.trunk/configs/.yamllint.yaml new file mode 100644 index 0000000..4d44466 --- /dev/null +++ b/.trunk/configs/.yamllint.yaml @@ -0,0 +1,10 @@ +rules: + quoted-strings: + required: only-when-needed + extra-allowed: ["{|}"] + empty-values: + forbid-in-block-mappings: true + forbid-in-flow-mappings: true + key-duplicates: {} + octal-values: + forbid-implicit-octal: true diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml new file mode 100644 index 0000000..b547829 --- /dev/null +++ b/.trunk/trunk.yaml @@ -0,0 +1,23 @@ +version: 0.1 +cli: + version: 1.7.0 +plugins: + sources: + - id: trunk + ref: v0.0.15 + uri: https://github.com/trunk-io/plugins +lint: + enabled: + - git-diff-check + - gitleaks@8.16.2 + - gofmt@1.19.3 + - golangci-lint@1.52.2 + - hadolint@2.12.0 + - prettier@2.8.7 + - taplo@0.7.0 + - yamllint@1.30.0 +runtimes: + enabled: + - go@1.19.5 + - node@18.12.1 + - python@3.10.8 diff --git a/Dockerfile b/Dockerfile index 3a2b9cf..cacf3c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,18 +2,17 @@ FROM golang:1.20-alpine3.17 as builder WORKDIR /usr/src/ytdl-web -ADD . . +COPY . . -RUN go mod download - -RUN go build -o ytdl-web . +RUN go mod download \ + && go build -o ytdl-web . FROM alpine:3.17 WORKDIR /app -RUN apk add --no-cache yt-dlp ffmpeg +RUN apk add --no-cache yt-dlp==2023.03.04 ffmpeg==5.1.3 COPY --from=builder /usr/src/ytdl-web/ytdl-web ./ytdl-web