From be08862109caa1b2252bb6e6f9e2cc7242d1e300 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 18 Dec 2025 21:45:43 -0500 Subject: [PATCH] CI: Add format-yaml (#6838) --- .github/workflows/reusable-lint-py.yml | 2 +- Makefile.in | 12 ++++++++++-- python-dev-requirements.txt | 3 ++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/reusable-lint-py.yml b/.github/workflows/reusable-lint-py.yml index ae7ab1e1b..53fbcf256 100644 --- a/.github/workflows/reusable-lint-py.yml +++ b/.github/workflows/reusable-lint-py.yml @@ -45,6 +45,6 @@ jobs: make venv - name: Lint - run: | + run: |- source .venv/bin/activate make -k lint-py diff --git a/Makefile.in b/Makefile.in index e18f6af2c..15134ab35 100644 --- a/Makefile.in +++ b/Makefile.in @@ -535,11 +535,18 @@ PY_FILES = \ # Python files, test_regress tests PY_TEST_FILES = test_regress/t/*.py +# YAML files +YAML_FILES = \ + .*.yaml \ + .*.yml \ + .github/*.yml \ + .github/*/*.yml \ + ###################################################################### # Format format: - $(MAKE) -j 5 format-c format-cmake format-exec format-py + $(MAKE) -j 5 format-c format-cmake format-exec format-py format-yaml BEAUTYSH = beautysh BEAUTYSH_FLAGS = --indent-size 2 @@ -583,10 +590,11 @@ format-py yapf: $(YAPF) $(YAPF_FLAGS) $(PY_FILES) YAMLFIX = YAMLFIX_WHITELINES=1 YAMLFIX_LINE_LENGTH=200 YAMLFIX_preserve_quotes=true yamlfix +YAMLFIX_FLAGS = format-yaml yamlfix: $(YAMLFIX) --version - $(YAMLFIX) . + $(YAMLFIX) $(YAMLFIX_FLAGS) $(YAML_FILES) ###################################################################### # Lint diff --git a/python-dev-requirements.txt b/python-dev-requirements.txt index 74aece139..07d1d3624 100644 --- a/python-dev-requirements.txt +++ b/python-dev-requirements.txt @@ -25,9 +25,10 @@ mypy==1.19.0 pylint==3.0.2 ruff==0.14.8 sarif-tools==3.0.5 -sphinx_rtd_theme==3.0.2 sphinx==8.1.3 +sphinx_rtd_theme==3.0.2 sphinxcontrib-spelling==8.0.2 +yamlfix==1.19.1 yapf==0.43.0 git+https://github.com/antmicro/astsee.git