From a5cbe2941a88216addd37f03b4d7c1ccdf14df6f Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Tue, 12 Nov 2024 14:25:43 +0100 Subject: [PATCH] chore(docs): fix lint issues Signed-off-by: Emilien Escalle --- .github/ISSUE_TEMPLATE/bug_report.md | 4 +- .github/ISSUE_TEMPLATE/feature_request.md | 6 +-- .../examples/1_environment-variables.md | 4 +- .github/ghadocs/examples/2_services.md | 2 +- .github/ghadocs/examples/5_compose-flags.md | 2 +- Dockerfile | 11 +++++ Makefile | 42 +++++++++++++++++++ 7 files changed, 62 insertions(+), 9 deletions(-) create mode 100644 Dockerfile create mode 100644 Makefile diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 9022eb1..2031bfb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,9 +1,9 @@ --- name: Bug report about: Create a bug report -title: '' +title: "" labels: bug, needs triage -assignees: '' +assignees: "" --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 2866f79..7c87193 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,9 +1,9 @@ --- name: Feature request about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' +title: "" +labels: "" +assignees: "" --- **Is your feature request related to a problem? Please describe.** A clear and diff --git a/.github/ghadocs/examples/1_environment-variables.md b/.github/ghadocs/examples/1_environment-variables.md index 3b1f649..9b7bee6 100644 --- a/.github/ghadocs/examples/1_environment-variables.md +++ b/.github/ghadocs/examples/1_environment-variables.md @@ -6,7 +6,7 @@ steps: - uses: actions/checkout@v4 - uses: hoverkraft-tech/compose-action@v1.5.1 with: - compose-file: './docker/docker-compose.yml' + compose-file: "./docker/docker-compose.yml" env: - CUSTOM_VARIABLE: 'test' + CUSTOM_VARIABLE: "test" ``` diff --git a/.github/ghadocs/examples/2_services.md b/.github/ghadocs/examples/2_services.md index 49f8506..21325f6 100644 --- a/.github/ghadocs/examples/2_services.md +++ b/.github/ghadocs/examples/2_services.md @@ -9,7 +9,7 @@ steps: - uses: actions/checkout@v3 - uses: hoverkraft-tech/compose-action@v1.5.1 with: - compose-file: './docker/docker-compose.yml' + compose-file: "./docker/docker-compose.yml" services: | helloworld2 helloworld3 diff --git a/.github/ghadocs/examples/5_compose-flags.md b/.github/ghadocs/examples/5_compose-flags.md index a6a0edd..9ea49bf 100644 --- a/.github/ghadocs/examples/5_compose-flags.md +++ b/.github/ghadocs/examples/5_compose-flags.md @@ -11,7 +11,7 @@ steps: - uses: actions/checkout@v3 - uses: hoverkraft-tech/compose-action@v1.5.1 with: - compose-file: './docker/docker-compose.yml' + compose-file: "./docker/docker-compose.yml" services: | helloworld2 helloworld3 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d10658a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +#checkov:skip=CKV_DOCKER_2: required +FROM ghcr.io/super-linter/super-linter:slim-v7 + +ARG UID=1000 +ARG GID=1000 +USER ${UID}:${GID} + +ENV RUN_LOCAL=true +ENV USE_FIND_ALGORITHM=true +ENV LOG_LEVEL=WARN +ENV LOG_FILE="../logs" \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c94b8a2 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +.PHONY: help + +help: ## Display help + @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +lint: ## Execute linting + $(call run_linter,) + +lint-fix: ## Execute linting and fix + $(call run_linter, \ + -e FIX_YAML_PRETTIER=true \ + -e FIX_MARKDOWN=true \ + -e FIX_JSON_PRETTIER=true \ + -e FIX_MARKDOWN_PRETTIER=true \ + -e FIX_NATURAL_LANGUAGE=true) + +define run_linter + DEFAULT_WORKSPACE="$(CURDIR)"; \ + LINTER_IMAGE="linter:latest"; \ + VOLUME="$$DEFAULT_WORKSPACE:$$DEFAULT_WORKSPACE"; \ + docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) --tag $$LINTER_IMAGE .; \ + docker run \ + -e DEFAULT_WORKSPACE="$$DEFAULT_WORKSPACE" \ + -e FILTER_REGEX_INCLUDE="$(filter-out $@,$(MAKECMDGOALS))" \ + -e FILTER_REGEX_EXCLUDE=dist/**/* \ + -e VALIDATE_JSCPD=false \ + -e VALIDATE_TYPESCRIPT_STANDARD=false \ + -e VALIDATE_TYPESCRIPT_ES=false \ + -e VALIDATE_TYPESCRIPT_PRETTIER=false \ + -e VALIDATE_JAVASCRIPT_ES=false \ + -e VALIDATE_JAVASCRIPT_STANDARD=false \ + $(1) \ + -v $$VOLUME \ + --rm \ + $$LINTER_IMAGE +endef + +############################# +# Argument fix workaround +############################# +%: + @: \ No newline at end of file