Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add static check with "avocado-static-checks" #129

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,13 @@ jobs:
python-version: ${{ matrix.python-version }}
- run: pip install -r requirements-travis.txt
- run: make check

static-checks:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: run static checks
uses: avocado-framework/avocado-ci-tools@main
Copy link
Contributor

@ldoktor ldoktor Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I expected to see something like this coming when I saw that new repo... Anyway currently there are 2 checks only and both of them already exist as GH action targets. What is the benefit of bundling them and using the avocado-ci-tools target instead? I mean I'd rather have 2 independent psf/black@stable and isort/isort-action@v1 pipelines to one combined avocado-framework/avocado-ci-tools@main one.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ldoktor, the reason for the avocado-ci-tools is to reduce the duplications in avocado workflows. Right now, it has static-checks and project. The project is for configuration of MR. Avocado bot which is automatization for avocado-project dashboard. And static-checks which is for running unified checks for all avocado related repos.

I understand that from your point the static-checks does the same work as psf/black@stable and isort/isort-action@v1, but the static-checks repo has one mayor advantage. We can use it as submodule for other repos and bring the same static-checks to CI and local environments for developers. I hope that this explanation will help you better understand why we use this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ldoktor, as @richtja explained, one of the goals is to allow for development time execution of those checks, that is, before it gets sent to a Git forge such as GitHub.

BTW, I'm keeping this as draft, because to be a fair request for change, this needs to implement at least as much as it's currently implemented in inspect checkall, OR, at least (transitionally) changing inspekt checkall to a combination of static-checks/check* and inspekt $SPECIFIC_CHECK_COMMAND.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I understand although I'm wondering if separate checks wouldn't be easier to post-process on failure. I mean looking into one single blob with multiple checks might be hard to process using human eyes and harder to reproduce unless the output is pretty damn simple. Something like:

::group::Running style check
...
::endgroup::
::group::Running import order check
...
::error::Import order failed, use `isort --profile black .` to reproduce locally
::endgroup::
...
::group::Report
Successful checks:
* Style check
Unsuccessful checks:
* Import order
::endgroup::

with:
avocado-static-checks: true
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "avocado-static-checks"]
path = static-checks
url = ../avocado-static-checks
branch = main
41 changes: 21 additions & 20 deletions aexpect/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,24 @@
entry-points.
"""

from .exceptions import ExpectError
from .exceptions import ExpectProcessTerminatedError
from .exceptions import ExpectTimeoutError
from .exceptions import ShellCmdError
from .exceptions import ShellError
from .exceptions import ShellProcessTerminatedError
from .exceptions import ShellStatusError
from .exceptions import ShellTimeoutError

from .client import Spawn
from .client import Tail
from .client import Expect
from .client import ShellSession
from .client import kill_tail_threads
from .client import run_tail
from .client import run_bg
from .client import run_fg

from . import remote
from . import rss_client
from . import remote, rss_client
from .client import (
Expect,
ShellSession,
Spawn,
Tail,
kill_tail_threads,
run_bg,
run_fg,
run_tail,
)
from .exceptions import (
ExpectError,
ExpectProcessTerminatedError,
ExpectTimeoutError,
ShellCmdError,
ShellError,
ShellProcessTerminatedError,
ShellStatusError,
ShellTimeoutError,
)
Loading
Loading