-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregister.py
53 lines (47 loc) · 1.58 KB
/
register.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import itertools
from pants.backend.byolinter.lib import ByoTool, SystemBinaryExecutable, PythonToolExecutable, collect_byo_rules
from pants.backend.python.target_types import ConsoleScript
confs = [
ByoTool(
goal="lint",
options_scope='byo_markdownlint',
name="MarkdownLint",
help="A markdown linter based on your installed markdown lint.",
executable=SystemBinaryExecutable("markdownlint", tools=["node"]),
file_glob_include=["**/*.md"],
file_glob_exclude=["README.md"],
),
ByoTool(
goal="lint",
options_scope='byo_flake8',
name="byo_Flake8",
help="Flake8 linter using the flake8 you have specified in a resolve",
executable=PythonToolExecutable(
main=ConsoleScript("flake8"),
requirements=["flake8>=5.0.4,<7"],
resolve="byo_flake8",
),
file_glob_include=["**/*.py"],
file_glob_exclude=["pants-plugins/**"],
),
ByoTool(
goal="fmt",
options_scope='byo_black',
name="byo_Black",
help="Black formatter using the black you have specified in a resolve",
executable=PythonToolExecutable(
main=ConsoleScript("black"),
requirements=[
"black>=22.6.0,<24",
'typing-extensions>=3.10.0.0; python_version < "3.10"',
],
resolve="byo_black",
),
file_glob_include=["**/*.py"],
file_glob_exclude=["pants-plugins/**"],
)
]
def target_types():
return []
def rules():
return collect_byo_rules(confs)