Skip to content

Commit 250c00d

Browse files
add revewdog
Signed-off-by: Bernhard Kaindl <[email protected]>
1 parent 84d5e8b commit 250c00d

File tree

8 files changed

+64
-182
lines changed

8 files changed

+64
-182
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ exclude_lines =
2828
precision = 1
2929
include =
3030
xcp/*
31+
omit =
32+
xcp/dmv.py

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- uses: pre-commit-ci/[email protected]
3737
if: always()
3838

39+
3940
test:
4041
needs: pre-commit
4142
strategy:
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Reviewdog PR Review comments
2+
3+
#
4+
# The reviewdog steps use reporter: github-pr-review, which submits the results
5+
# as a review comment on the pull request. It needs a GitHub token with
6+
# public_repo scope to post the comments and can only be used in the context
7+
# of a pull request.
8+
#
9+
on: pull_request
10+
11+
#
12+
# Checks can be skipped by adding "skip-checks: true" to a commit message,
13+
# or requested by adding "request-checks: true" if disabled by default for pushes:
14+
# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks#skipping-and-requesting-checks-for-individual-commits
15+
#
16+
17+
concurrency: # On new workflow, cancel old workflows from the same PR, branch or tag:
18+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
reviewdog:
23+
runs-on: ubuntu-24.04
24+
env:
25+
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_GITHUB_API_TOKEN }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-python@v5
29+
with:
30+
python-version: 3.13
31+
32+
- name: Install uv and activate the environment
33+
uses: astral-sh/setup-uv@v6
34+
with:
35+
activate-environment: true
36+
37+
- run: uv pip install pylint types-setuptools -r pyproject.toml --extra mypy
38+
39+
- uses: dciborow/[email protected]
40+
name: Run pylint with reviewdog to submit GitHub checks for warnings
41+
if: ${{ github.actor != 'nektos/act' }}
42+
with:
43+
reporter: github-pr-review
44+
glob_pattern: "xcp tests"
45+
46+
- uses: tsuyoshicho/action-mypy@v4
47+
name: Run mypy with reviewdog to submit GitHub checks for warnings
48+
if: ${{ github.actor != 'nektos/act' }}
49+
with:
50+
install_types: false
51+
mypy_flags: --exclude python-libs-*/stubs/
52+
reporter: github-pr-review
53+
level: warning

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ repos:
101101
name: pytest unit tests and static analysis using tox
102102
types: [python]
103103
# entry: sh -c "pytest -x -rf --new-first --show-capture=all >/dev/tty"
104-
entry: sh -c "tox >/dev/tty"
104+
entry: sh -c "tox -e py311-cov-check-pytype-pyright-lint-mdreport >/dev/tty"
105105
verbose: true
106106
language: python
107107
require_serial: true

stubs/parameterized/__init__.pyi

Lines changed: 0 additions & 1 deletion
This file was deleted.

stubs/parameterized/parameterized.pyi

Lines changed: 0 additions & 76 deletions
This file was deleted.

stubs/parameterized/test.pyi

Lines changed: 0 additions & 100 deletions
This file was deleted.

xcp/dmv.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@
2121
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2222
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2323

24-
import os
25-
import subprocess
24+
import errno
25+
import glob
2626
import json
27+
import os
2728
import re
2829
import struct
29-
import glob
30-
import errno
30+
import subprocess
31+
from typing import Any, Dict
3132

3233
from .compat import open_with_codec_handling
3334

@@ -236,6 +237,8 @@ def parse_dmv_info(self, fpath):
236237
return json_data, json_formatted
237238

238239
class DriverMultiVersionManager(object):
240+
# dmv_list = {} # type: Dict[str, Any]
241+
239242
def __init__(self, runtime=False):
240243
self.runtime = runtime
241244
self.dmv_list = {

0 commit comments

Comments
 (0)