Skip to content

Commit

Permalink
Add TOML format check to stages.yml
Browse files Browse the repository at this point in the history
Change-Id: I378d45be14389a53720e7f01d256ad4ba4dc2495
  • Loading branch information
LarsMichelsen authored and TimotheusBachinger committed Jan 13, 2025
1 parent 1378676 commit 8c76e75
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
7 changes: 7 additions & 0 deletions buildscripts/scripts/stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,13 @@ STAGES:
TEXT_ON_SKIP: "No SW Documentation files changed"
RESULT_CHECK_FILE_PATTERN: "results/sw-documentation.txt"

- NAME: "TOML Format"
ONLY_WHEN_NOT_EMPTY: CHANGED_REFERENCE_IMAGE,CHANGED_PYPROJECT_TOML_FILE,CHANGED_TESTS_MAKEFILE
DIR: "tests"
COMMAND: "make --quiet test-format-toml-docker &> ${RESULTS}/toml-format.txt"
BAZEL_LOCKS_AMOUNT: 1
RESULT_CHECK_FILE_PATTERN:

########## packages ########################################################

- NAME: "Package check-cert"
Expand Down
16 changes: 15 additions & 1 deletion tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ THREE_TO_TWO := $(UVENV) 3to2
BANDIT := $(UVENV) bandit
SEMGREP := $(realpath semgrep)/run-semgrep
SHELLCHECK := bazel run --ui_event_filters=-info,-stderr //bazel/tools:shellcheck_bin --
SHFMT := $(SCRIPTS)/run-bazel.sh run --ui_event_filters=-info,-stderr //bazel/tools:shfmt_bin --
SHFMT := $(SCRIPTS)/run-bazel.sh run --ui_event_filters=-info,-stderr //bazel/tools:shfmt_bin --
TAPLO := $(SCRIPTS)/run-bazel.sh run --ui_event_filters=-info,-stderr //bazel/tools:taplo_bin --
FIND_INVALID_TEST_FILES := $(SCRIPTS)/find-invalid-autogen-files
ADDITIONAL_MYPY_ARGS := $(JUNIT_XML)
# Please note: We can currently not include defines.make as it would override
Expand Down Expand Up @@ -67,6 +68,7 @@ AGENT_PLUGIN_UNIT_TEST_FILES_PY2 := $(subst agent-plugin-unit,agent-plugin-unit/
test-docker-sit test-docker-sit-docker \
test-format-python test-format-python-docker \
test-format-shell test-format-shell-docker \
format-toml test-format-toml test-format-toml-docker \
$(SYSTEM_TESTS) \
$(foreach TEST,$(SYSTEM_TESTS),$(TEST)-docker) \
container-debug \
Expand All @@ -85,6 +87,7 @@ clean:
help:
@echo "container-debug - Run container for manual test debugging"
@echo "format-shell - Format shell agents"
@echo "format-toml - Format toml files"
@for i in $(AGENT_PLUGIN_PYTHON_VERSIONS); do \
echo "test-agent-plugin-unit-py$${i}-docker - Run Agent plugin tests in container with Python $${i}"; \
done
Expand All @@ -108,6 +111,8 @@ help:
@echo "test-format-python - Run formatting tests"
@echo "test-format-python-docker - Run formatting tests in docker"
@echo "test-format-shell - Run the shell formatting"
@echo "test-format-toml - Run the toml formatting"
@echo "test-format-toml-docker - Run the toml formatting in docker"
@echo "test-gui-e2e - Run GUI End-to-End locally"
@echo "test-gui-e2e-docker - Run GUI End-to-End in container"
@echo "test-license-headers - Run license headers tests"
Expand Down Expand Up @@ -261,6 +266,15 @@ test-format-shell:
test-format-shell-docker:
../scripts/run-in-docker.sh make --quiet test-format-shell

format-toml:
$(TAPLO) format ../pyproject.toml

test-format-toml:
$(TAPLO) format --check --diff ../pyproject.toml

test-format-toml-docker:
../scripts/run-in-docker.sh make --quiet test-format-toml

test-lint-bazel:
../scripts/run-buildifier --lint=warn --mode=check

Expand Down

0 comments on commit 8c76e75

Please sign in to comment.