diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 83df1878e..ec15e73a1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -58,10 +58,17 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/setup_evap + with: + npm-ci: 'true' + - name: Run ruff run: ruff check . - name: Run pylint run: pylint evap tools + - name: Run ESLint + run: | + cd evap/static/ts + npx eslint --quiet formatter: runs-on: ubuntu-22.04 diff --git a/evap/evaluation/management/commands/lint.py b/evap/evaluation/management/commands/lint.py index f5045417f..1933e1f6d 100644 --- a/evap/evaluation/management/commands/lint.py +++ b/evap/evaluation/management/commands/lint.py @@ -9,7 +9,9 @@ class Command(BaseCommand): requires_migrations_checks = False def handle(self, *args, **options): - self.stdout.write("Executing ruff .") + self.stdout.write("Executing ruff check .") subprocess.run(["ruff", "check", "."], check=False) # nosec self.stdout.write("Executing pylint evap") subprocess.run(["pylint", "evap", "tools"], check=False) # nosec + self.stdout.write("Executing npx eslint --quiet") + subprocess.run(["npx", "eslint", "--quiet"], cwd="evap/static/ts", check=False) # nosec diff --git a/evap/evaluation/tests/test_commands.py b/evap/evaluation/tests/test_commands.py index fc378f288..a7bc6b1b9 100644 --- a/evap/evaluation/tests/test_commands.py +++ b/evap/evaluation/tests/test_commands.py @@ -453,9 +453,10 @@ class TestLintCommand(TestCase): @patch("subprocess.run") def test_pylint_called(self, mock_subprocess_run: MagicMock): management.call_command("lint", stdout=StringIO()) - self.assertEqual(mock_subprocess_run.call_count, 2) + self.assertEqual(mock_subprocess_run.call_count, 3) mock_subprocess_run.assert_any_call(["ruff", "check", "."], check=False) mock_subprocess_run.assert_any_call(["pylint", "evap", "tools"], check=False) + mock_subprocess_run.assert_any_call(["npx", "eslint", "--quiet"], cwd="evap/static/ts", check=False) class TestFormatCommand(TestCase):