[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v2 01/35] do-not-merge
From: |
John Snow |
Subject: |
[RFC PATCH v2 01/35] do-not-merge |
Date: |
Thu, 12 Dec 2024 20:12:30 -0500 |
Signed-off-by: John Snow <jsnow@redhat.com>
---
scripts/qapi-lint.sh | 55 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
create mode 100755 scripts/qapi-lint.sh
diff --git a/scripts/qapi-lint.sh b/scripts/qapi-lint.sh
new file mode 100755
index 00000000000..5a8c798001e
--- /dev/null
+++ b/scripts/qapi-lint.sh
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+set -e
+
+if [[ -f qapi/.flake8 ]]; then
+ echo "flake8 --config=qapi/.flake8 qapi/"
+ flake8 --config=qapi/.flake8 qapi/
+fi
+if [[ -f qapi/pylintrc ]]; then
+ echo "pylint --rcfile=qapi/pylintrc qapi/"
+ pylint --rcfile=qapi/pylintrc qapi/
+fi
+if [[ -f qapi/mypy.ini ]]; then
+ echo "mypy --config-file=qapi/mypy.ini qapi/"
+ mypy --config-file=qapi/mypy.ini qapi/
+fi
+
+if [[ -f qapi/.isort.cfg ]]; then
+ pushd qapi
+ echo "isort -c ."
+ isort -c .
+ popd
+fi
+
+if [[ -f ../docs/sphinx/qapi-domain.py ]]; then
+ files="qapi-domain.py"
+fi
+if [[ -f ../docs/sphinx/compat.py ]]; then
+ files="${files} compat.py"
+fi
+if [[ -f ../docs/sphinx/collapse.py ]]; then
+ files="${files} collapse.py"
+fi
+
+if [[ -f ../docs/sphinx/qapi-domain.py ]]; then
+ pushd ../docs/sphinx
+
+ set -x
+ mypy --strict $files
+ flake8 --max-line-length=80 $files qapidoc.py
+ isort -c $files qapidoc.py
+ black --line-length 80 --check $files qapidoc.py
+ PYTHONPATH=../scripts/ pylint \
+ --rc-file ../../scripts/qapi/pylintrc \
+ qapidoc.py
+ set +x
+
+ popd
+fi
+
+pushd ../build
+make -j13
+make check-qapi-schema
+make docs
+make sphinxdocs
+popd
--
2.47.0
- [RFC PATCH v2 00/35] Add qapi-domain Sphinx extension, John Snow, 2024/12/12
- [RFC PATCH v2 01/35] do-not-merge,
John Snow <=
- [RFC PATCH v2 02/35] pylint touchups, John Snow, 2024/12/12
- [RFC PATCH v2 03/35] docs/sphinx: create QAPI domain extension stub, John Snow, 2024/12/12
- [RFC PATCH v2 04/35] docs/sphinx: add compat.py module and nested_parse helper, John Snow, 2024/12/12
- [RFC PATCH v2 05/35] docs/qapi-domain: add qapi:module directive, John Snow, 2024/12/12
- [RFC PATCH v2 08/35] docs/qapi-domain: add resolve_any_xref(), John Snow, 2024/12/12
- [RFC PATCH v2 07/35] docs/qapi-domain: add QAPI index, John Snow, 2024/12/12
- [RFC PATCH v2 09/35] docs/qapi-domain: add QAPI xref roles, John Snow, 2024/12/12
- [RFC PATCH v2 06/35] docs/qapi-domain: add QAPI domain object registry, John Snow, 2024/12/12
- [RFC PATCH v2 10/35] docs/qapi-domain: add compatibility node classes, John Snow, 2024/12/12
- [RFC PATCH v2 11/35] docs/qapi-domain: add qapi:command directive, John Snow, 2024/12/12