diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c0b8641ccb..999c442a8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,7 @@ jobs: with: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} + submodules: true - name: Allow git to operate on directory checked out by GH Actions run: git config --global --add safe.directory `pwd` - name: Installing Avocado development dependencies diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..d9445cc719 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "static-checks"] + path = static-checks + url = https://github.com/avocado-framework/avocado-static-checks diff --git a/avocado-static-checks.conf b/avocado-static-checks.conf new file mode 100644 index 0000000000..1248049bef --- /dev/null +++ b/avocado-static-checks.conf @@ -0,0 +1,2 @@ +[lint] +.:.pylintrc diff --git a/docs/source/guides/contributor/chapters/how.rst b/docs/source/guides/contributor/chapters/how.rst index 93feece2cf..e5daa41474 100644 --- a/docs/source/guides/contributor/chapters/how.rst +++ b/docs/source/guides/contributor/chapters/how.rst @@ -63,7 +63,13 @@ Git workflow - Clone from your fork:: - $ git clone git@github.com:/avocado.git + $ git clone --recurse-submodules git@github.com:/avocado.git + +.. note:: The ``--recurse-submodules`` option is used to checkout the + contents from the `avocado-static-checks + `_ + repository, which is not needed for general Avocado installations, + but which is very important for development purposes. - Enter the directory:: diff --git a/selftests/check.py b/selftests/check.py index ea81932dfa..29a3e9f815 100755 --- a/selftests/check.py +++ b/selftests/check.py @@ -597,6 +597,11 @@ def create_suites(args): # pylint: disable=W0621 if args.dict_tests["static-checks"]: config_check_static = copy.copy(config_check) config_check_static["resolver.references"] = glob.glob("selftests/*.sh") + config_check_static["resolver.references"].append( + "static-checks/check-import-order" + ) + config_check_static["resolver.references"].append("static-checks/check-style") + config_check_static["resolver.references"].append("static-checks/check-lint") suites.append(TestSuite.from_config(config_check_static, "static-checks")) # ======================================================================== diff --git a/selftests/isort.sh b/selftests/isort.sh deleted file mode 100755 index c257898c87..0000000000 --- a/selftests/isort.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -e - -isort --check-only --profile black . diff --git a/selftests/lint.sh b/selftests/lint.sh deleted file mode 100755 index 561b669440..0000000000 --- a/selftests/lint.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -e -echo "** Running lint..." - -# Those are files from our main packages, we should follow the .pylintrc file with all -# enabled by default. Some are disabled, we are working to reduce this list. -FILES=$(git ls-files '*.py') -python3 -m pylint ${PYLINT_OPTIONS} ${FILES} diff --git a/selftests/style.sh b/selftests/style.sh deleted file mode 100755 index 511bccf09a..0000000000 --- a/selftests/style.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -e -echo "** Running black..." - -python3 -m black --check --diff --color . diff --git a/static-checks b/static-checks new file mode 160000 index 0000000000..2f53ec2948 --- /dev/null +++ b/static-checks @@ -0,0 +1 @@ +Subproject commit 2f53ec2948d33e45bc7ecbbb8bf248426aae81d8