blob: fa6a7a48a8a56b3ef458663363d76307b2326935 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
"""Ruff linter support module."""
from typing import List
from . import base
class RuffChecker(base.LinterBase):
"""Ruff linter."""
def __init__(self):
# type: () -> None
"""Create a Ruff linter."""
super(RuffChecker, self).__init__("ruff", "0.4.4")
def get_lint_version_cmd_args(self) -> list[str]:
"""Get the command to run a version check."""
return ["--version"]
def get_lint_cmd_args(self, files: list[str]) -> list[str]:
"""Get the command to run a check."""
if not files:
return ["check"]
files = " ".join(files)
return ["check", files]
def get_fix_cmd_args(self, files: list[str]) -> list[str]:
"""Get the command to run a fix."""
if not files:
return ["check", "--fix"]
files = " ".join(files)
return ["check", "--fix", files]
|