Skip to content

Commit 8162da3

Browse files
committed
run pylint AND ruff
1 parent d0db4b9 commit 8162da3

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

.github/workflows/tests.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@ jobs:
8888
- name: Setup python
8989
uses: ./.github/setup_python
9090

91-
- name: Run linter
92-
run: ruff evap
91+
- name: Run linters
92+
run: |
93+
pylint evap -j0
94+
ruff evap
9395
9496
9597
formatter:

evap/evaluation/management/commands/lint.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ class Command(BaseCommand):
99
requires_migrations_checks = False
1010

1111
def handle(self, *args, **options):
12-
subprocess.run(["ruff", "evap/"], check=False) # nosec
12+
subprocess.run(["pylint", "evap"], check=False) # nosec
13+
subprocess.run(["ruff", "evap"], check=False) # nosec

evap/evaluation/tests/test_commands.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from datetime import date, datetime, timedelta
55
from io import StringIO
66
from itertools import chain, cycle
7-
from unittest.mock import call, patch
7+
from unittest.mock import MagicMock, call, patch
88

99
from django.conf import settings
1010
from django.core import mail, management
@@ -366,11 +366,12 @@ def test_send_text_answer_review_reminder(self):
366366

367367

368368
class TestLintCommand(TestCase):
369-
@staticmethod
370369
@patch("subprocess.run")
371-
def test_pylint_called(mock_subprocess_run):
370+
def test_pylint_called(self, mock_subprocess_run: MagicMock):
372371
management.call_command("lint")
373-
mock_subprocess_run.assert_called_once_with(["pylint", "evap"], check=False)
372+
self.assertListEqual(
373+
mock_subprocess_run.mock_calls, [call(["pylint", "evap"], check=False), call(["ruff", "evap"], check=False)]
374+
)
374375

375376

376377
class TestFormatCommand(TestCase):

0 commit comments

Comments
 (0)