diff --git a/.bake.toml b/.bake.toml new file mode 100644 index 0000000000..fa7d458674 --- /dev/null +++ b/.bake.toml @@ -0,0 +1,25 @@ +# mbake configuration file + +debug = false +gnu_error_format = true +verbose = false +wrap_error_messages = false + +[formatter] +align_across_comments = false +align_variable_assignments = false +auto_insert_phony_declarations = false +ensure_final_newline = true +fix_missing_recipe_tabs = true +group_phony_declarations = false +indent_nested_conditionals = false +max_consecutive_empty_lines = 2 +max_line_length = 120 +normalize_empty_lines = true +normalize_line_continuations = true +phony_at_top = false +remove_trailing_whitespace = true +space_after_colon = true +space_around_assignment = true +space_before_colon = false +tab_width = 2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2b4251f567..5740d9019c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,17 @@ repos: + - repo: https://github.com/EbodShojaei/bake + rev: v1.4.5 + hooks: + - id: mbake-format + args: + - --config + - .bake.toml + - id: mbake-validate + args: + - --config + - .bake.toml + exclude: ^backend/ + - repo: https://github.com/adrienverge/yamllint.git rev: v1.38.0 hooks: diff --git a/Makefile b/Makefile index 0527fabe30..a13dc34b8e 100644 --- a/Makefile +++ b/Makefile @@ -83,36 +83,36 @@ security-scan-code-semgrep: -w /src \ $$(grep -E '^FROM semgrep/semgrep:' docker/semgrep/Dockerfile | sed 's/^FROM //') \ semgrep \ - --config p/ci \ - --config p/command-injection \ - --config p/cwe-top-25 \ - --config p/default \ - --config p/django \ - --config p/docker \ - --config p/docker-compose \ - --config p/dockerfile \ - --config p/javascript \ - --config p/nextjs \ - --config p/nginx \ - --config p/nodejs \ - --config p/owasp-top-ten \ - --config p/python \ - --config p/r2c-security-audit \ - --config p/react \ - --config p/secrets \ - --config p/secure-defaults \ - --config p/security-audit \ - --config p/security-headers \ - --config p/sql-injection \ - --config p/terraform \ - --config p/typescript \ - --error \ - --skip-unknown-extensions \ - --timeout 10 \ - --timeout-threshold 3 \ - --text \ - --text-output=semgrep-security-report.txt \ - . + --config p/ci \ + --config p/command-injection \ + --config p/cwe-top-25 \ + --config p/default \ + --config p/django \ + --config p/docker \ + --config p/docker-compose \ + --config p/dockerfile \ + --config p/javascript \ + --config p/nextjs \ + --config p/nginx \ + --config p/nodejs \ + --config p/owasp-top-ten \ + --config p/python \ + --config p/r2c-security-audit \ + --config p/react \ + --config p/secrets \ + --config p/secure-defaults \ + --config p/security-audit \ + --config p/security-headers \ + --config p/sql-injection \ + --config p/terraform \ + --config p/typescript \ + --error \ + --skip-unknown-extensions \ + --timeout 10 \ + --timeout-threshold 3 \ + --text \ + --text-output=semgrep-security-report.txt \ + . SCANNERS ?= misconfig,vuln diff --git a/backend/Makefile b/backend/Makefile index f102846b4c..a16919b6b8 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -143,7 +143,7 @@ recreate-schema: @echo "Recreating Nest schema" @CMD="psql -U nest_user_dev -d nest_db_dev -c \ 'DROP SCHEMA public CASCADE; CREATE SCHEMA public; GRANT ALL ON SCHEMA public TO nest_user_dev'" \ - $(MAKE) exec-db-command-it 2>/dev/null + $(MAKE) exec-db-command-it 2>/dev/null @$(MAKE) migrate restore-backup: @@ -176,11 +176,11 @@ security-scan-backend-image: --rm \ -e TRIVY_SCANNERS="$(IMAGE_SCANNERS)" \ -v $(CURDIR)/trivyignore.yaml:/trivyignore.yaml:ro \ - -v /var/run/docker.sock:/var/run/docker.sock \ - -v $(CURDIR)/trivy.yaml:/trivy.yaml:ro \ - -v $(CURDIR)/.trivy-cache:/root/.cache/trivy \ - $$(grep -E '^FROM aquasec/trivy:' docker/trivy/Dockerfile | sed 's/^FROM //') \ - image --config /trivy.yaml $(BACKEND_IMAGE_NAME) + -v /var/run/docker.sock:/var/run/docker.sock \ + -v $(CURDIR)/trivy.yaml:/trivy.yaml:ro \ + -v $(CURDIR)/.trivy-cache:/root/.cache/trivy \ + $$(grep -E '^FROM aquasec/trivy:' docker/trivy/Dockerfile | sed 's/^FROM //') \ + image --config /trivy.yaml $(BACKEND_IMAGE_NAME) SBOM_VERSION := $(if $(RELEASE_VERSION),$(RELEASE_VERSION),local) diff --git a/backend/apps/slack/Makefile b/backend/apps/slack/Makefile index eb907f4807..1ed9e78328 100644 --- a/backend/apps/slack/Makefile +++ b/backend/apps/slack/Makefile @@ -11,7 +11,6 @@ slack-export-data: @CMD="sed -E -i 's/(\"[^\"]*email\"): *\"([^\"]|\\\")*\"/\1: \"\"/g' data/slack-data.json" $(MAKE) exec-backend-command @CMD="gzip data/slack-data.json" $(MAKE) exec-backend-command - slack-set-conversation-sync-messages-flags: @echo "Setting conversation sync messages flags" @CMD="python manage.py slack_set_conversation_sync_messages_flags" $(MAKE) exec-backend-command diff --git a/cspell/Makefile b/cspell/Makefile index f4053feb27..7c3e8fa42f 100644 --- a/cspell/Makefile +++ b/cspell/Makefile @@ -1,3 +1,5 @@ +.PHONY: check-spelling cspell-install cspell-check cspell-run update-cspell-dependencies + check-spelling: cspell-check cspell-install: diff --git a/frontend/Makefile b/frontend/Makefile index fc3a431180..ea80689c12 100644 --- a/frontend/Makefile +++ b/frontend/Makefile @@ -5,10 +5,10 @@ SHELL := /bin/bash build-frontend-local-image: @DOCKER_BUILDKIT=1 NEXT_PUBLIC_ENVIRONMENT=local docker build \ --build-arg FORCE_STANDALONE=yes \ - --no-cache \ - -f docker/frontend/Dockerfile \ - -t nest-frontend-local \ - frontend + --no-cache \ + -f docker/frontend/Dockerfile \ + -t nest-frontend-local \ + frontend check-frontend: \ format-frontend-code \