forked from albertas/deadcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_types.py
More file actions
45 lines (37 loc) · 1.33 KB
/
Copy pathdata_types.py
File metadata and controls
45 lines (37 loc) · 1.33 KB
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
import ast
from dataclasses import dataclass
from typing import Iterable, NamedTuple
AbstractSyntaxTree = ast.Module # Should be module instead of ast
FileContent = bytes
Filename = str # Contains full path to existing file
Pathname = str # Can contain wildewards
@dataclass
class Args:
fix: bool = False
verbose: bool = False
version: bool = False
dry: bool = False
only: Iterable[Pathname] = ()
paths: Iterable[Pathname] = ()
exclude: Iterable[Pathname] = ()
ignore_definitions: Iterable[Pathname] = ()
ignore_definitions_if_decorated_with: Iterable[Pathname] = ()
ignore_definitions_if_inherits_from: Iterable[Pathname] = ()
ignore_bodies_of: Iterable[Pathname] = ()
ignore_bodies_if_decorated_with: Iterable[Pathname] = ()
ignore_bodies_if_inherits_from: Iterable[Pathname] = ()
ignore_if_decorated_with: Iterable[Pathname] = ()
ignore_if_inherits_from: Iterable[Pathname] = ()
ignore_names: Iterable[Pathname] = ()
ignore_names_if_decorated_with: Iterable[Pathname] = ()
ignore_names_if_inherits_from: Iterable[Pathname] = ()
ignore_names_in_files: Iterable[Pathname] = ()
no_color: bool = False
quiet: bool = False
count: bool = False
class Part(NamedTuple):
"""Code file part"""
line_start: int
line_end: int
col_start: int
col_end: int