omdev 0.0.0.dev459__py3-none-any.whl → 0.0.0.dev460__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- omdev/__about__.py +1 -1
- omdev/precheck/imports.py +14 -1
- omdev/precheck/main.py +1 -1
- {omdev-0.0.0.dev459.dist-info → omdev-0.0.0.dev460.dist-info}/METADATA +4 -4
- {omdev-0.0.0.dev459.dist-info → omdev-0.0.0.dev460.dist-info}/RECORD +9 -9
- {omdev-0.0.0.dev459.dist-info → omdev-0.0.0.dev460.dist-info}/WHEEL +0 -0
- {omdev-0.0.0.dev459.dist-info → omdev-0.0.0.dev460.dist-info}/entry_points.txt +0 -0
- {omdev-0.0.0.dev459.dist-info → omdev-0.0.0.dev460.dist-info}/licenses/LICENSE +0 -0
- {omdev-0.0.0.dev459.dist-info → omdev-0.0.0.dev460.dist-info}/top_level.txt +0 -0
omdev/__about__.py
CHANGED
omdev/precheck/imports.py
CHANGED
@@ -3,6 +3,8 @@ import dataclasses as dc
|
|
3
3
|
import os.path
|
4
4
|
import typing as ta
|
5
5
|
|
6
|
+
from omlish.text.filecache import TextFileCache
|
7
|
+
|
6
8
|
from .base import Precheck
|
7
9
|
from .base import PrecheckContext
|
8
10
|
from .caches import AstCache
|
@@ -26,6 +28,7 @@ class RootRelativeImportPrecheck(Precheck['RootRelativeImportPrecheck.Config']):
|
|
26
28
|
dir_walk_cache: DirWalkCache,
|
27
29
|
headers_cache: HeadersCache,
|
28
30
|
ast_cache: AstCache,
|
31
|
+
text_file_cache: TextFileCache,
|
29
32
|
) -> None:
|
30
33
|
super().__init__(config)
|
31
34
|
|
@@ -34,6 +37,7 @@ class RootRelativeImportPrecheck(Precheck['RootRelativeImportPrecheck.Config']):
|
|
34
37
|
self._dir_walk_cache = dir_walk_cache
|
35
38
|
self._headers_cache = headers_cache
|
36
39
|
self._ast_cache = ast_cache
|
40
|
+
self._text_file_cache = text_file_cache
|
37
41
|
|
38
42
|
async def _run_py_file(self, py_file: str, src_root: str) -> ta.AsyncGenerator[Precheck.Violation]:
|
39
43
|
if isinstance(header_lines := self._headers_cache.get_file_headers(py_file), Exception):
|
@@ -41,11 +45,20 @@ class RootRelativeImportPrecheck(Precheck['RootRelativeImportPrecheck.Config']):
|
|
41
45
|
if any(hl.src.strip() == '# ruff: noqa' for hl in header_lines):
|
42
46
|
return
|
43
47
|
|
48
|
+
py_file_lines = self._text_file_cache.get_entry(py_file).lines()
|
49
|
+
|
44
50
|
py_file_ast = self._ast_cache.get_file_ast(py_file)
|
45
51
|
if not isinstance(py_file_ast, ast.Module):
|
46
52
|
return
|
47
53
|
|
48
|
-
for cur_node in py_file_ast
|
54
|
+
for cur_node in ast.walk(py_file_ast):
|
55
|
+
if not isinstance(cur_node, (ast.Import, ast.ImportFrom)):
|
56
|
+
continue
|
57
|
+
|
58
|
+
# FIXME: lame lol
|
59
|
+
if py_file_lines[cur_node.lineno - 1].strip().endswith('# noqa'):
|
60
|
+
continue
|
61
|
+
|
49
62
|
if isinstance(cur_node, ast.Import):
|
50
63
|
imp_alias: ast.alias
|
51
64
|
for imp_alias in cur_node.names:
|
omdev/precheck/main.py
CHANGED
@@ -134,12 +134,12 @@ def _check_cmd(args) -> None:
|
|
134
134
|
|
135
135
|
def _build_parser() -> argparse.ArgumentParser:
|
136
136
|
parser = argparse.ArgumentParser()
|
137
|
+
parser.add_argument('-v', '--verbose', action='store_true')
|
137
138
|
|
138
139
|
subparsers = parser.add_subparsers()
|
139
140
|
|
140
141
|
parser_check = subparsers.add_parser('check')
|
141
142
|
parser_check.add_argument('roots', nargs='+')
|
142
|
-
parser_check.add_argument('-v', '--verbose', action='store_true')
|
143
143
|
parser_check.set_defaults(func=_check_cmd)
|
144
144
|
|
145
145
|
return parser
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: omdev
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev460
|
4
4
|
Summary: omdev
|
5
5
|
Author: wrmsr
|
6
6
|
License-Expression: BSD-3-Clause
|
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
14
14
|
Requires-Python: >=3.13
|
15
15
|
Description-Content-Type: text/markdown
|
16
16
|
License-File: LICENSE
|
17
|
-
Requires-Dist: omlish==0.0.0.
|
17
|
+
Requires-Dist: omlish==0.0.0.dev460
|
18
18
|
Provides-Extra: all
|
19
19
|
Requires-Dist: black~=25.9; extra == "all"
|
20
20
|
Requires-Dist: pycparser~=2.23; extra == "all"
|
@@ -27,7 +27,7 @@ Requires-Dist: mypy~=1.18; extra == "all"
|
|
27
27
|
Requires-Dist: gprof2dot~=2025.4; extra == "all"
|
28
28
|
Requires-Dist: segno~=1.6; extra == "all"
|
29
29
|
Requires-Dist: rich~=14.2; extra == "all"
|
30
|
-
Requires-Dist: textual~=6.
|
30
|
+
Requires-Dist: textual~=6.3; extra == "all"
|
31
31
|
Provides-Extra: black
|
32
32
|
Requires-Dist: black~=25.9; extra == "black"
|
33
33
|
Provides-Extra: c
|
@@ -46,7 +46,7 @@ Provides-Extra: qr
|
|
46
46
|
Requires-Dist: segno~=1.6; extra == "qr"
|
47
47
|
Provides-Extra: tui
|
48
48
|
Requires-Dist: rich~=14.2; extra == "tui"
|
49
|
-
Requires-Dist: textual~=6.
|
49
|
+
Requires-Dist: textual~=6.3; extra == "tui"
|
50
50
|
Dynamic: license-file
|
51
51
|
|
52
52
|
# Overview
|
@@ -1,5 +1,5 @@
|
|
1
1
|
omdev/.omlish-manifests.json,sha256=YqhbZs4Wr3L9DAwcFfhTs8Zw8W8MxPLaxYXp2aqbyzQ,11671
|
2
|
-
omdev/__about__.py,sha256=
|
2
|
+
omdev/__about__.py,sha256=TwPTq6a1_K0K-oDBQf6x2VmkiD5hi6W8Q7CvmTW9Aic,1223
|
3
3
|
omdev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
omdev/cmake.py,sha256=gu49t10_syXh_TUJs4POsxeFs8we8Y3XTOOPgIXmGvg,4608
|
5
5
|
omdev/imgur.py,sha256=oqei705LhSnLWQTOMHMHwRecRXcpSEP90Sg4SVINPQ0,3133
|
@@ -219,9 +219,9 @@ omdev/precheck/base.py,sha256=fKdrfakq2u1UU1_JZFnl-non9bIAZMsSkVY1SMYn8xQ,662
|
|
219
219
|
omdev/precheck/blanklines.py,sha256=VG06NTcFoJjUBn46OXlx4qf5u3vx5l02XiNANBeuQBY,1882
|
220
220
|
omdev/precheck/caches.py,sha256=OZKP20DIj6OpUzdNwrjCufv1GzndEbsc7tLD-qHNv9g,1736
|
221
221
|
omdev/precheck/git.py,sha256=O8rNQZ_vlHec0pOFbK6LOkbly5ZIUYT_HXRMqQX8GaI,774
|
222
|
-
omdev/precheck/imports.py,sha256=
|
222
|
+
omdev/precheck/imports.py,sha256=KXNFCqDqBRUzRs1LFvKVSNDhoVWtNibFbmcqGPrqx9c,3016
|
223
223
|
omdev/precheck/lite.py,sha256=sseaKHMZgMhIEuifZvPJm0-wuRqRUrnyySJfHBMItOM,4737
|
224
|
-
omdev/precheck/main.py,sha256=
|
224
|
+
omdev/precheck/main.py,sha256=wwghmR8S17GpC5Jil3yg96LsIGUKH29HS0h2d4YZ8f0,4439
|
225
225
|
omdev/precheck/manifests.py,sha256=dxl7GSJHKjQrR6mbwvj6j92XDGHOpxxEEQ6smJkBEe4,810
|
226
226
|
omdev/precheck/scripts.py,sha256=6nb_lDgyX7u9kdF_BU6ubY01q_jGk96VH9q9gpOieng,1753
|
227
227
|
omdev/precheck/unicode.py,sha256=vMxGb4Kqg1NhFlw1kbgsPtXOnswjREH0ZPZExrrTwCU,3260
|
@@ -315,9 +315,9 @@ omdev/tui/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
315
315
|
omdev/tui/apps/markdown/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
316
316
|
omdev/tui/apps/markdown/__main__.py,sha256=Xy-G2-8Ymx8QMBbRzA4LoiAMZqvtC944mMjFEWd69CA,182
|
317
317
|
omdev/tui/apps/markdown/cli.py,sha256=ubm4UsMbkAvwsjxbQ82kxo1ku4657YLMQ1NVXv0DuRo,506
|
318
|
-
omdev-0.0.0.
|
319
|
-
omdev-0.0.0.
|
320
|
-
omdev-0.0.0.
|
321
|
-
omdev-0.0.0.
|
322
|
-
omdev-0.0.0.
|
323
|
-
omdev-0.0.0.
|
318
|
+
omdev-0.0.0.dev460.dist-info/licenses/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
319
|
+
omdev-0.0.0.dev460.dist-info/METADATA,sha256=Lf305_2gbqTzrg_NexxTd14ADMAYGl1opL-tuV5_5Yo,5170
|
320
|
+
omdev-0.0.0.dev460.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
321
|
+
omdev-0.0.0.dev460.dist-info/entry_points.txt,sha256=dHLXFmq5D9B8qUyhRtFqTGWGxlbx3t5ejedjrnXNYLU,33
|
322
|
+
omdev-0.0.0.dev460.dist-info/top_level.txt,sha256=1nr7j30fEWgLYHW3lGR9pkdHkb7knv1U1ES1XRNVQ6k,6
|
323
|
+
omdev-0.0.0.dev460.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|