Skip to content

Commit

Permalink
Static checks: introduce usage of "avocado-static-checks" project
Browse files Browse the repository at this point in the history
This enables the bare minimum of the avocado-static-checks usage, adds
the submodule switches the "isort" check, one of the most simplistic,
to the one provided by the avocado-static-checks repo.

Fixes: #5991
Signed-off-by: Cleber Rosa <[email protected]>
  • Loading branch information
clebergnu committed Sep 16, 2024
1 parent 536b6f7 commit 8639fdb
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "static-checks"]
path = static-checks
url = https://github.com/avocado-framework/avocado-static-checks
8 changes: 7 additions & 1 deletion docs/source/guides/contributor/chapters/how.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ Git workflow

- Clone from your fork::

$ git clone [email protected]:<username>/avocado.git
$ git clone --recurse-submodules [email protected]:<username>/avocado.git

.. note:: The ``--recurse-submodules`` option is used to checkout the
contents from the `avocado-static-checks
<https://github.com/avocado-framework/avocado-static-checks>`_
repository, which is not needed for general Avocado installations,
but which is very important for development purposes.

- Enter the directory::

Expand Down
3 changes: 3 additions & 0 deletions selftests/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,9 @@ 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"
)
suites.append(TestSuite.from_config(config_check_static, "static-checks"))

# ========================================================================
Expand Down
3 changes: 0 additions & 3 deletions selftests/isort.sh

This file was deleted.

1 change: 1 addition & 0 deletions static-checks
Submodule static-checks added at 2f53ec

0 comments on commit 8639fdb

Please sign in to comment.