Skip to content

Commit

Permalink
add ESLint check
Browse files Browse the repository at this point in the history
  • Loading branch information
Kakadus committed Nov 18, 2024
1 parent 1a4c144 commit 2b052be
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion evap/evaluation/management/commands/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion evap/evaluation/tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 2b052be

Please sign in to comment.