vim-eof-comment 0.5.3__py3-none-any.whl → 0.6.0__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.
- vim_eof_comment/args/completion.py +2 -2
- vim_eof_comment/args/completion.pyi +1 -2
- vim_eof_comment/args/parsing.py +3 -3
- vim_eof_comment/comments/generator.py +6 -6
- vim_eof_comment/comments/generator.pyi +4 -4
- vim_eof_comment/eof.py +10 -10
- vim_eof_comment/eof.pyi +1 -3
- vim_eof_comment/file.py +2 -1
- vim_eof_comment/file.pyi +3 -1
- vim_eof_comment/types.py +234 -26
- vim_eof_comment/types.pyi +168 -24
- vim_eof_comment/util.py +6 -6
- vim_eof_comment/util.pyi +4 -4
- vim_eof_comment/version.py +3 -4
- vim_eof_comment/version.pyi +2 -4
- {vim_eof_comment-0.5.3.dist-info → vim_eof_comment-0.6.0.dist-info}/METADATA +1 -1
- vim_eof_comment-0.6.0.dist-info/RECORD +39 -0
- {vim_eof_comment-0.5.3.dist-info → vim_eof_comment-0.6.0.dist-info}/WHEEL +1 -1
- vim_eof_comment-0.5.3.dist-info/RECORD +0 -39
- {vim_eof_comment-0.5.3.dist-info → vim_eof_comment-0.6.0.dist-info}/entry_points.txt +0 -0
- {vim_eof_comment-0.5.3.dist-info → vim_eof_comment-0.6.0.dist-info}/licenses/LICENSE +0 -0
- {vim_eof_comment-0.5.3.dist-info → vim_eof_comment-0.6.0.dist-info}/top_level.txt +0 -0
|
@@ -8,7 +8,7 @@ Copyright (c) 2025 Guennadi Maximov C. All Rights Reserved.
|
|
|
8
8
|
__all__ = ["complete_parser", "complete_validator"]
|
|
9
9
|
|
|
10
10
|
from argparse import ArgumentParser
|
|
11
|
-
from typing import List
|
|
11
|
+
from typing import List
|
|
12
12
|
|
|
13
13
|
from argcomplete import autocomplete
|
|
14
14
|
|
|
@@ -32,7 +32,7 @@ def complete_validator(completion_candidate: List[str], current_input: str) -> b
|
|
|
32
32
|
return current_input in completion_candidate
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
def complete_parser(parser: ArgumentParser, **kwargs) ->
|
|
35
|
+
def complete_parser(parser: ArgumentParser, **kwargs) -> None:
|
|
36
36
|
"""
|
|
37
37
|
Complete the script argument parser.
|
|
38
38
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
from argparse import ArgumentParser
|
|
2
|
-
from typing import NoReturn
|
|
3
2
|
|
|
4
3
|
__all__ = ['complete_parser', 'complete_validator']
|
|
5
4
|
|
|
@@ -19,7 +18,7 @@ def complete_validator(completion_candidate: list[str], current_input: str) -> b
|
|
|
19
18
|
bool
|
|
20
19
|
Whether the current input fits the completion candidates pool.
|
|
21
20
|
"""
|
|
22
|
-
def complete_parser(parser: ArgumentParser, **kwargs) ->
|
|
21
|
+
def complete_parser(parser: ArgumentParser, **kwargs) -> None:
|
|
23
22
|
"""
|
|
24
23
|
Complete the script argument parser.
|
|
25
24
|
|
vim_eof_comment/args/parsing.py
CHANGED
|
@@ -51,9 +51,9 @@ def bootstrap_args(parser: ArgumentParser, specs: List[ParserSpec]) -> Namespace
|
|
|
51
51
|
The generated ``argparse.Namespace`` object.
|
|
52
52
|
"""
|
|
53
53
|
for spec in specs:
|
|
54
|
-
opts, kwargs = spec
|
|
55
|
-
if spec
|
|
56
|
-
parser.add_argument(*opts, **kwargs).completer = spec
|
|
54
|
+
opts, kwargs = spec.opts, spec.kwargs
|
|
55
|
+
if spec.completer is not None:
|
|
56
|
+
parser.add_argument(*opts, **kwargs).completer = spec.completer
|
|
57
57
|
else:
|
|
58
58
|
parser.add_argument(*opts, **kwargs)
|
|
59
59
|
|
|
@@ -17,7 +17,7 @@ import json
|
|
|
17
17
|
import os
|
|
18
18
|
from io import TextIOWrapper
|
|
19
19
|
from os.path import exists, isdir, realpath
|
|
20
|
-
from typing import Dict, Iterator, List,
|
|
20
|
+
from typing import Dict, Iterator, List, Tuple
|
|
21
21
|
|
|
22
22
|
from colorama import Fore, Style
|
|
23
23
|
from colorama import init as color_init
|
|
@@ -119,9 +119,9 @@ class Comments():
|
|
|
119
119
|
if not (self.__is_available(lang)) or len(mapping) == 0:
|
|
120
120
|
continue
|
|
121
121
|
|
|
122
|
-
indent, expandtab = mapping
|
|
122
|
+
indent, expandtab = mapping.level, True
|
|
123
123
|
if len(mapping) > 1:
|
|
124
|
-
expandtab = mapping
|
|
124
|
+
expandtab = mapping.expandtab
|
|
125
125
|
|
|
126
126
|
langs[lang] = IndentMap(level=indent, expandtab=expandtab)
|
|
127
127
|
|
|
@@ -148,7 +148,7 @@ class Comments():
|
|
|
148
148
|
"""
|
|
149
149
|
return lang in self.__DEFAULT.keys()
|
|
150
150
|
|
|
151
|
-
def __fill_langs(self, langs: Dict[str, IndentMap]) ->
|
|
151
|
+
def __fill_langs(self, langs: Dict[str, IndentMap]) -> None:
|
|
152
152
|
"""
|
|
153
153
|
Fill languages dict.
|
|
154
154
|
|
|
@@ -242,7 +242,7 @@ def generate_list_items(ft: str, level: int, expandtab: str) -> str:
|
|
|
242
242
|
return txt
|
|
243
243
|
|
|
244
244
|
|
|
245
|
-
def list_filetypes() ->
|
|
245
|
+
def list_filetypes() -> None:
|
|
246
246
|
"""List all available filetypes."""
|
|
247
247
|
color_init()
|
|
248
248
|
|
|
@@ -262,7 +262,7 @@ def list_filetypes() -> NoReturn:
|
|
|
262
262
|
die(*txt, code=0, sep="\n")
|
|
263
263
|
|
|
264
264
|
|
|
265
|
-
def export_json() ->
|
|
265
|
+
def export_json() -> None:
|
|
266
266
|
"""Export default vars to JSON."""
|
|
267
267
|
if not (exists("./vim_eof_comment/comments") and isdir("./vim_eof_comment/comments")):
|
|
268
268
|
return
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Iterator
|
|
1
|
+
from typing import Iterator
|
|
2
2
|
|
|
3
3
|
from ..types import IndentMap
|
|
4
4
|
|
|
@@ -72,7 +72,7 @@ class Comments:
|
|
|
72
72
|
bool
|
|
73
73
|
Represents whether the file extension has been included in the defaults.
|
|
74
74
|
"""
|
|
75
|
-
def __fill_langs(self, langs: dict[str, IndentMap]) ->
|
|
75
|
+
def __fill_langs(self, langs: dict[str, IndentMap]) -> None:
|
|
76
76
|
"""
|
|
77
77
|
Fill languages dict.
|
|
78
78
|
|
|
@@ -132,9 +132,9 @@ def generate_list_items(ft: str, level: int, expandtab: str) -> str:
|
|
|
132
132
|
str
|
|
133
133
|
The generated string.
|
|
134
134
|
'''
|
|
135
|
-
def list_filetypes() ->
|
|
135
|
+
def list_filetypes() -> None:
|
|
136
136
|
"""List all available filetypes."""
|
|
137
|
-
def export_json() ->
|
|
137
|
+
def export_json() -> None:
|
|
138
138
|
"""Export default vars to JSON."""
|
|
139
139
|
|
|
140
140
|
# vim: set ts=4 sts=4 sw=4 et ai si sta:
|
vim_eof_comment/eof.py
CHANGED
|
@@ -9,7 +9,7 @@ Copyright (c) 2025 Guennadi Maximov C. All Rights Reserved.
|
|
|
9
9
|
__all__ = ["append_eof_comment", "eof_comment_search", "main"]
|
|
10
10
|
|
|
11
11
|
from io import TextIOWrapper
|
|
12
|
-
from typing import Dict, List,
|
|
12
|
+
from typing import Dict, List, Tuple
|
|
13
13
|
|
|
14
14
|
from colorama import Fore, Style
|
|
15
15
|
from colorama import init as color_init
|
|
@@ -67,17 +67,17 @@ def eof_comment_search(
|
|
|
67
67
|
|
|
68
68
|
verbose_print(f"{_RESET}Analyzing files...\n", verbose=verbose)
|
|
69
69
|
for path, file in files.items():
|
|
70
|
-
file_obj: TextIOWrapper = file
|
|
71
|
-
ext: str = file
|
|
70
|
+
file_obj: TextIOWrapper = file.file
|
|
71
|
+
ext: str = file.ft_ext
|
|
72
72
|
|
|
73
73
|
wrapper = get_last_line(file_obj)
|
|
74
|
-
last_line, had_nwl, crlf = wrapper
|
|
74
|
+
last_line, had_nwl, crlf = wrapper.line, wrapper.had_nwl, wrapper.crlf
|
|
75
75
|
|
|
76
76
|
verbose_print(f"{_RESET} - {path} ==> ", verbose=verbose, end="", sep="")
|
|
77
77
|
if last_line != comment_map[ext] or (newline and not had_nwl):
|
|
78
78
|
verbose_print(f"{_BRIGHT}{_RED}CHANGED", verbose=verbose)
|
|
79
79
|
result[path] = EOFCommentSearch(
|
|
80
|
-
state=IOWrapperBool(file=open(path, "r"), had_nwl=had_nwl),
|
|
80
|
+
state=IOWrapperBool(file=open(path, "r"), had_nwl=had_nwl, crlf=crlf),
|
|
81
81
|
lang=ext,
|
|
82
82
|
match=matches(last_line)
|
|
83
83
|
)
|
|
@@ -92,7 +92,7 @@ def append_eof_comment(
|
|
|
92
92
|
comments: Comments,
|
|
93
93
|
newline: bool,
|
|
94
94
|
crlf: bool
|
|
95
|
-
) ->
|
|
95
|
+
) -> None:
|
|
96
96
|
"""
|
|
97
97
|
Append a Vim EOF comment to files missing it.
|
|
98
98
|
|
|
@@ -109,10 +109,10 @@ def append_eof_comment(
|
|
|
109
109
|
"""
|
|
110
110
|
comment_map = comments.generate()
|
|
111
111
|
for path, file in files.items():
|
|
112
|
-
file_obj = file
|
|
113
|
-
had_nwl = file
|
|
114
|
-
matching = file
|
|
115
|
-
ext = file
|
|
112
|
+
file_obj = file.state.file
|
|
113
|
+
had_nwl = file.state.had_nwl
|
|
114
|
+
matching = file.match
|
|
115
|
+
ext = file.lang
|
|
116
116
|
|
|
117
117
|
txt = modify_file(
|
|
118
118
|
file_obj,
|
vim_eof_comment/eof.pyi
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import NoReturn
|
|
2
|
-
|
|
3
1
|
from .comments.generator import Comments
|
|
4
2
|
from .types import BatchPathDict, EOFCommentSearch
|
|
5
3
|
|
|
@@ -30,7 +28,7 @@ def eof_comment_search(files: dict[str, BatchPathDict], comments: Comments, **kw
|
|
|
30
28
|
vim_eof_comment.types.EOFCommentSearch
|
|
31
29
|
The object type for the returning dictionary values.
|
|
32
30
|
"""
|
|
33
|
-
def append_eof_comment(files: dict[str, EOFCommentSearch], comments: Comments, newline: bool, crlf: bool) ->
|
|
31
|
+
def append_eof_comment(files: dict[str, EOFCommentSearch], comments: Comments, newline: bool, crlf: bool) -> None:
|
|
34
32
|
"""
|
|
35
33
|
Append a Vim EOF comment to files missing it.
|
|
36
34
|
|
vim_eof_comment/file.py
CHANGED
|
@@ -6,6 +6,7 @@ File management utilities.
|
|
|
6
6
|
Copyright (c) 2025 Guennadi Maximov C. All Rights Reserved.
|
|
7
7
|
"""
|
|
8
8
|
__all__ = [
|
|
9
|
+
"EXCLUDED_DIRS",
|
|
9
10
|
"bootstrap_paths",
|
|
10
11
|
"get_last_line",
|
|
11
12
|
"modify_file",
|
|
@@ -108,7 +109,7 @@ def open_batch_paths(paths: List[BatchPairDict]) -> Dict[str, BatchPathDict]:
|
|
|
108
109
|
"""
|
|
109
110
|
result: Dict[str, BatchPathDict] = dict()
|
|
110
111
|
for path in paths:
|
|
111
|
-
fpath, ext = path
|
|
112
|
+
fpath, ext = path.fpath, path.ft_ext
|
|
112
113
|
if not try_open(fpath):
|
|
113
114
|
continue
|
|
114
115
|
|
vim_eof_comment/file.pyi
CHANGED
|
@@ -2,7 +2,9 @@ from io import TextIOWrapper
|
|
|
2
2
|
|
|
3
3
|
from .types import BatchPairDict, BatchPathDict, LineBool
|
|
4
4
|
|
|
5
|
-
__all__ = ['bootstrap_paths', 'get_last_line', 'modify_file', 'open_batch_paths', 'try_open']
|
|
5
|
+
__all__ = ['EXCLUDED_DIRS', 'bootstrap_paths', 'get_last_line', 'modify_file', 'open_batch_paths', 'try_open']
|
|
6
|
+
|
|
7
|
+
EXCLUDED_DIRS: list[str]
|
|
6
8
|
|
|
7
9
|
def try_open(fpath: str) -> bool:
|
|
8
10
|
"""
|
vim_eof_comment/types.py
CHANGED
|
@@ -23,7 +23,7 @@ from typing import Any, Dict, List, TextIO, Tuple, TypedDict
|
|
|
23
23
|
import argcomplete
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
class VersionInfo
|
|
26
|
+
class VersionInfo:
|
|
27
27
|
"""
|
|
28
28
|
A ``sys.version_info``-like object type.
|
|
29
29
|
|
|
@@ -142,7 +142,6 @@ class VersionInfo():
|
|
|
142
142
|
if not isinstance(b, VersionInfo):
|
|
143
143
|
return False
|
|
144
144
|
|
|
145
|
-
b: VersionInfo = b
|
|
146
145
|
return self.major == b.major and self.minor == b.minor and self.patch == b.patch
|
|
147
146
|
|
|
148
147
|
def get_current_version(self) -> Tuple[int, int, int]:
|
|
@@ -189,11 +188,18 @@ class VersionInfo():
|
|
|
189
188
|
return result
|
|
190
189
|
|
|
191
190
|
|
|
192
|
-
class ParserSpec
|
|
191
|
+
class ParserSpec:
|
|
193
192
|
"""
|
|
194
193
|
Stores the spec for ``argparse`` operations in a constant value.
|
|
195
194
|
|
|
196
|
-
|
|
195
|
+
Parameters
|
|
196
|
+
----------
|
|
197
|
+
opts : List[str]
|
|
198
|
+
A list containing all the relevant iterations of the same option.
|
|
199
|
+
kwargs : Dict[str, Any]
|
|
200
|
+
Extra arguments for ``argparse.ArgumentParser``.
|
|
201
|
+
completer : argcomplete.DirectoriesCompleter
|
|
202
|
+
An ``argcomplete`` completer object.
|
|
197
203
|
|
|
198
204
|
Attributes
|
|
199
205
|
----------
|
|
@@ -209,12 +215,40 @@ class ParserSpec(TypedDict):
|
|
|
209
215
|
kwargs: Dict[str, Any]
|
|
210
216
|
completer: argcomplete.DirectoriesCompleter
|
|
211
217
|
|
|
218
|
+
def __init__(
|
|
219
|
+
self,
|
|
220
|
+
opts: List[str],
|
|
221
|
+
kwargs: Dict[str, Any],
|
|
222
|
+
completer: argcomplete.DirectoriesCompleter
|
|
223
|
+
):
|
|
224
|
+
self.opts = opts
|
|
225
|
+
self.kwargs = kwargs
|
|
226
|
+
self.completer = completer
|
|
227
|
+
|
|
228
|
+
def __iterables(self) -> Tuple[List[str], Dict[str, Any], argcomplete.DirectoriesCompleter]:
|
|
229
|
+
"""
|
|
230
|
+
Generate iterables.
|
|
231
|
+
|
|
232
|
+
Returns
|
|
233
|
+
-------
|
|
234
|
+
Tuple[List[str], Dict[str, Any], argcomplete.DirectoriesCompleter]
|
|
235
|
+
The ``opts``, ``kwargs`` and ``completer`` attributes.
|
|
236
|
+
"""
|
|
237
|
+
return (self.opts, self.kwargs, self.completer)
|
|
238
|
+
|
|
239
|
+
def __iter__(self):
|
|
240
|
+
"""Iterate over objects."""
|
|
241
|
+
yield from self.__iterables()
|
|
212
242
|
|
|
213
|
-
|
|
243
|
+
|
|
244
|
+
class CommentMap:
|
|
214
245
|
"""
|
|
215
|
-
|
|
246
|
+
An object containing ``level``.
|
|
216
247
|
|
|
217
|
-
|
|
248
|
+
Parameters
|
|
249
|
+
----------
|
|
250
|
+
level : int
|
|
251
|
+
The indentation level.
|
|
218
252
|
|
|
219
253
|
Attributes
|
|
220
254
|
----------
|
|
@@ -224,12 +258,28 @@ class CommentMap(TypedDict):
|
|
|
224
258
|
|
|
225
259
|
level: int
|
|
226
260
|
|
|
261
|
+
def __init__(self, level: int):
|
|
262
|
+
self.level = level
|
|
263
|
+
|
|
264
|
+
def __iterables(self) -> Tuple[int]:
|
|
265
|
+
"""
|
|
266
|
+
Generate iterables.
|
|
267
|
+
|
|
268
|
+
Returns
|
|
269
|
+
-------
|
|
270
|
+
Tuple[int]
|
|
271
|
+
The ``opts`` attribute (inside a tuple).
|
|
272
|
+
"""
|
|
273
|
+
return (self.level,)
|
|
274
|
+
|
|
275
|
+
def __iter__(self):
|
|
276
|
+
"""Iterate over objects."""
|
|
277
|
+
yield from self.__iterables()
|
|
278
|
+
|
|
227
279
|
|
|
228
280
|
class IndentMap(TypedDict):
|
|
229
281
|
"""
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
This is a ``TypedDict``-like object.
|
|
282
|
+
An object containing ``level`` and ``expandtab``.
|
|
233
283
|
|
|
234
284
|
Attributes
|
|
235
285
|
----------
|
|
@@ -243,11 +293,18 @@ class IndentMap(TypedDict):
|
|
|
243
293
|
expandtab: bool
|
|
244
294
|
|
|
245
295
|
|
|
246
|
-
class IndentHandler
|
|
296
|
+
class IndentHandler:
|
|
247
297
|
"""
|
|
248
|
-
|
|
298
|
+
An object containing ``ft_ext``, ``level`` and ``expandtab``.
|
|
249
299
|
|
|
250
|
-
|
|
300
|
+
Parameters
|
|
301
|
+
----------
|
|
302
|
+
ft_ext : str
|
|
303
|
+
The file-extension/file-type.
|
|
304
|
+
level : str
|
|
305
|
+
The string representation of the indent level.
|
|
306
|
+
expandtab : bool
|
|
307
|
+
Whether to expand tabs or not.
|
|
251
308
|
|
|
252
309
|
Attributes
|
|
253
310
|
----------
|
|
@@ -263,12 +320,39 @@ class IndentHandler(TypedDict):
|
|
|
263
320
|
level: str
|
|
264
321
|
expandtab: bool
|
|
265
322
|
|
|
323
|
+
def __init__(self, ft_ext: str, level: str, expandtab: bool):
|
|
324
|
+
self.ft_ext = ft_ext
|
|
325
|
+
self.level = level
|
|
326
|
+
self.expandtab = expandtab
|
|
327
|
+
|
|
328
|
+
def __iterables(self) -> Tuple[str, str, bool]:
|
|
329
|
+
"""
|
|
330
|
+
Generate iterables.
|
|
331
|
+
|
|
332
|
+
Returns
|
|
333
|
+
-------
|
|
334
|
+
Tuple[str, str, bool]
|
|
335
|
+
The ``ft_ext``, ``level`` and ``expandtab`` attributes.
|
|
336
|
+
"""
|
|
337
|
+
return (self.ft_ext, self.level, self.expandtab)
|
|
338
|
+
|
|
339
|
+
def __iter__(self):
|
|
340
|
+
"""Iterate over objects."""
|
|
341
|
+
yield from self.__iterables()
|
|
266
342
|
|
|
267
|
-
|
|
343
|
+
|
|
344
|
+
class IOWrapperBool:
|
|
268
345
|
"""
|
|
269
|
-
|
|
346
|
+
An object containing ``file``, ``had_nwl`` and ``crlf``.
|
|
270
347
|
|
|
271
|
-
|
|
348
|
+
Parameters
|
|
349
|
+
----------
|
|
350
|
+
file : TextIO
|
|
351
|
+
The opened file as a ``TextIO`` wrapper.
|
|
352
|
+
had_nwl : bool
|
|
353
|
+
Whether the file has a newline or not.
|
|
354
|
+
crlf : bool
|
|
355
|
+
Whether the file is CRLF-terminated.
|
|
272
356
|
|
|
273
357
|
Attributes
|
|
274
358
|
----------
|
|
@@ -284,12 +368,39 @@ class IOWrapperBool(TypedDict):
|
|
|
284
368
|
had_nwl: bool
|
|
285
369
|
crlf: bool
|
|
286
370
|
|
|
371
|
+
def __init__(self, file: TextIO, had_nwl: bool, crlf: bool):
|
|
372
|
+
self.file = file
|
|
373
|
+
self.had_nwl = had_nwl
|
|
374
|
+
self.crlf = crlf
|
|
375
|
+
|
|
376
|
+
def __iterables(self) -> Tuple[TextIO, bool, bool]:
|
|
377
|
+
"""
|
|
378
|
+
Generate iterables.
|
|
379
|
+
|
|
380
|
+
Returns
|
|
381
|
+
-------
|
|
382
|
+
Tuple[TextIO, bool, bool]
|
|
383
|
+
The ``file``, ``had_nwl`` and ``crlf`` attributes.
|
|
384
|
+
"""
|
|
385
|
+
return (self.file, self.had_nwl, self.crlf)
|
|
386
|
+
|
|
387
|
+
def __iter__(self):
|
|
388
|
+
"""Iterate over objects."""
|
|
389
|
+
yield from self.__iterables()
|
|
390
|
+
|
|
287
391
|
|
|
288
|
-
class LineBool
|
|
392
|
+
class LineBool:
|
|
289
393
|
"""
|
|
290
|
-
|
|
394
|
+
An object containing ``line``, ``had_nwl`` and ``crlf``.
|
|
291
395
|
|
|
292
|
-
|
|
396
|
+
Parameters
|
|
397
|
+
----------
|
|
398
|
+
line : str
|
|
399
|
+
The last line of the target file.
|
|
400
|
+
had_nwl : bool
|
|
401
|
+
Whether the file has a newline or not.
|
|
402
|
+
crlf : bool
|
|
403
|
+
Whether the file is CRLF-terminated.
|
|
293
404
|
|
|
294
405
|
Attributes
|
|
295
406
|
----------
|
|
@@ -305,12 +416,37 @@ class LineBool(TypedDict):
|
|
|
305
416
|
had_nwl: bool
|
|
306
417
|
crlf: bool
|
|
307
418
|
|
|
419
|
+
def __init__(self, line: str, had_nwl: bool, crlf: bool):
|
|
420
|
+
self.line = line
|
|
421
|
+
self.had_nwl = had_nwl
|
|
422
|
+
self.crlf = crlf
|
|
423
|
+
|
|
424
|
+
def __iterables(self) -> Tuple[str, bool, bool]:
|
|
425
|
+
"""
|
|
426
|
+
Generate iterables.
|
|
427
|
+
|
|
428
|
+
Returns
|
|
429
|
+
-------
|
|
430
|
+
Tuple[str, bool, bool]
|
|
431
|
+
The ``line``, ``had_nwl`` and ``crlf`` attributes.
|
|
432
|
+
"""
|
|
433
|
+
return (self.line, self.had_nwl, self.crlf)
|
|
434
|
+
|
|
435
|
+
def __iter__(self):
|
|
436
|
+
"""Iterate over objects."""
|
|
437
|
+
yield from self.__iterables()
|
|
308
438
|
|
|
309
|
-
|
|
439
|
+
|
|
440
|
+
class BatchPathDict:
|
|
310
441
|
"""
|
|
311
|
-
|
|
442
|
+
An object containing ``file`` and ``ft_ext``.
|
|
312
443
|
|
|
313
|
-
|
|
444
|
+
Parameters
|
|
445
|
+
----------
|
|
446
|
+
file : TextIO
|
|
447
|
+
The opened file as a ``TextIO`` wrapper.
|
|
448
|
+
ft_ext : str
|
|
449
|
+
The file-type/file-extension.
|
|
314
450
|
|
|
315
451
|
Attributes
|
|
316
452
|
----------
|
|
@@ -323,12 +459,36 @@ class BatchPathDict(TypedDict):
|
|
|
323
459
|
file: TextIO
|
|
324
460
|
ft_ext: str
|
|
325
461
|
|
|
462
|
+
def __init__(self, file: TextIO, ft_ext: str):
|
|
463
|
+
self.file = file
|
|
464
|
+
self.ft_ext = ft_ext
|
|
465
|
+
|
|
466
|
+
def __iterables(self) -> Tuple[TextIO, str]:
|
|
467
|
+
"""
|
|
468
|
+
Generate iterables.
|
|
469
|
+
|
|
470
|
+
Returns
|
|
471
|
+
-------
|
|
472
|
+
Tuple[TextIO, str]
|
|
473
|
+
The ``file`` and ``ft_ext`` attributes.
|
|
474
|
+
"""
|
|
475
|
+
return (self.file, self.ft_ext)
|
|
476
|
+
|
|
477
|
+
def __iter__(self):
|
|
478
|
+
"""Iterate over objects."""
|
|
479
|
+
yield from self.__iterables()
|
|
480
|
+
|
|
326
481
|
|
|
327
|
-
class BatchPairDict
|
|
482
|
+
class BatchPairDict:
|
|
328
483
|
"""
|
|
329
|
-
|
|
484
|
+
An object containing ``fpath`` and ``ft_ext``.
|
|
330
485
|
|
|
331
|
-
|
|
486
|
+
Parameters
|
|
487
|
+
----------
|
|
488
|
+
fpath : str
|
|
489
|
+
The target file's path.
|
|
490
|
+
ft_ext : str
|
|
491
|
+
The file-type/file-extension.
|
|
332
492
|
|
|
333
493
|
Attributes
|
|
334
494
|
----------
|
|
@@ -341,13 +501,41 @@ class BatchPairDict(TypedDict):
|
|
|
341
501
|
fpath: str
|
|
342
502
|
ft_ext: str
|
|
343
503
|
|
|
504
|
+
def __init__(self, fpath: str, ft_ext: str):
|
|
505
|
+
self.fpath = fpath
|
|
506
|
+
self.ft_ext = ft_ext
|
|
507
|
+
|
|
508
|
+
def __iterables(self) -> Tuple[str, str]:
|
|
509
|
+
"""
|
|
510
|
+
Generate iterables.
|
|
511
|
+
|
|
512
|
+
Returns
|
|
513
|
+
-------
|
|
514
|
+
Tuple[str, str]
|
|
515
|
+
The ``fpath`` and ``ft_ext`` attributes.
|
|
516
|
+
"""
|
|
517
|
+
return (self.fpath, self.ft_ext)
|
|
518
|
+
|
|
519
|
+
def __iter__(self):
|
|
520
|
+
"""Iterate over objects."""
|
|
521
|
+
yield from self.__iterables()
|
|
344
522
|
|
|
345
|
-
|
|
523
|
+
|
|
524
|
+
class EOFCommentSearch:
|
|
346
525
|
"""
|
|
347
526
|
A dict containing ``state``, ``lang`` and ``match`` as keys.
|
|
348
527
|
|
|
349
528
|
This is a ``TypedDict``-like object.
|
|
350
529
|
|
|
530
|
+
Parameters
|
|
531
|
+
----------
|
|
532
|
+
state : IOWrapperBool
|
|
533
|
+
The target ``IOWrapperBool`` object.
|
|
534
|
+
lang : str
|
|
535
|
+
The file language.
|
|
536
|
+
match : bool
|
|
537
|
+
Whether it has a variation of an EOF comment at the end.
|
|
538
|
+
|
|
351
539
|
Attributes
|
|
352
540
|
----------
|
|
353
541
|
state : IOWrapperBool
|
|
@@ -362,4 +550,24 @@ class EOFCommentSearch(TypedDict):
|
|
|
362
550
|
lang: str
|
|
363
551
|
match: bool
|
|
364
552
|
|
|
553
|
+
def __init__(self, state: IOWrapperBool, lang: str, match: bool):
|
|
554
|
+
self.state = state
|
|
555
|
+
self.lang = lang
|
|
556
|
+
self.match = match
|
|
557
|
+
|
|
558
|
+
def __iterables(self) -> Tuple[IOWrapperBool, str, bool]:
|
|
559
|
+
"""
|
|
560
|
+
Generate iterables.
|
|
561
|
+
|
|
562
|
+
Returns
|
|
563
|
+
-------
|
|
564
|
+
Tuple[IOWrapperBool, str, bool]
|
|
565
|
+
The ``state``, ``lang`` and ``match`` attributes.
|
|
566
|
+
"""
|
|
567
|
+
return (self.state, self.lang, self.match)
|
|
568
|
+
|
|
569
|
+
def __iter__(self):
|
|
570
|
+
"""Iterate over objects."""
|
|
571
|
+
yield from self.__iterables()
|
|
572
|
+
|
|
365
573
|
# vim: set ts=4 sts=4 sw=4 et ai si sta:
|
vim_eof_comment/types.pyi
CHANGED
|
@@ -139,11 +139,18 @@ class VersionInfo:
|
|
|
139
139
|
0.0.3 (latest)
|
|
140
140
|
"""
|
|
141
141
|
|
|
142
|
-
class ParserSpec
|
|
142
|
+
class ParserSpec:
|
|
143
143
|
"""
|
|
144
144
|
Stores the spec for ``argparse`` operations in a constant value.
|
|
145
145
|
|
|
146
|
-
|
|
146
|
+
Parameters
|
|
147
|
+
----------
|
|
148
|
+
opts : List[str]
|
|
149
|
+
A list containing all the relevant iterations of the same option.
|
|
150
|
+
kwargs : Dict[str, Any]
|
|
151
|
+
Extra arguments for ``argparse.ArgumentParser``.
|
|
152
|
+
completer : argcomplete.DirectoriesCompleter
|
|
153
|
+
An ``argcomplete`` completer object.
|
|
147
154
|
|
|
148
155
|
Attributes
|
|
149
156
|
----------
|
|
@@ -157,12 +164,27 @@ class ParserSpec(TypedDict):
|
|
|
157
164
|
opts: list[str]
|
|
158
165
|
kwargs: dict[str, Any]
|
|
159
166
|
completer: argcomplete.DirectoriesCompleter
|
|
167
|
+
def __init__(self, opts: list[str], kwargs: dict[str, Any], completer: argcomplete.DirectoriesCompleter) -> None: ...
|
|
168
|
+
def __iterables(self) -> tuple[list[str], dict[str, Any], argcomplete.DirectoriesCompleter]:
|
|
169
|
+
"""
|
|
170
|
+
Generate iterables.
|
|
171
|
+
|
|
172
|
+
Returns
|
|
173
|
+
-------
|
|
174
|
+
Tuple[List[str], Dict[str, Any], argcomplete.DirectoriesCompleter]
|
|
175
|
+
The ``opts``, ``kwargs`` and ``completer`` attributes.
|
|
176
|
+
"""
|
|
177
|
+
def __iter__(self):
|
|
178
|
+
"""Iterate over objects."""
|
|
160
179
|
|
|
161
|
-
class CommentMap
|
|
180
|
+
class CommentMap:
|
|
162
181
|
"""
|
|
163
|
-
|
|
182
|
+
An object containing ``level``.
|
|
164
183
|
|
|
165
|
-
|
|
184
|
+
Parameters
|
|
185
|
+
----------
|
|
186
|
+
level : int
|
|
187
|
+
The indentation level.
|
|
166
188
|
|
|
167
189
|
Attributes
|
|
168
190
|
----------
|
|
@@ -170,12 +192,22 @@ class CommentMap(TypedDict):
|
|
|
170
192
|
The indentation level.
|
|
171
193
|
"""
|
|
172
194
|
level: int
|
|
195
|
+
def __init__(self, level: int) -> None: ...
|
|
196
|
+
def __iterables(self) -> tuple[int]:
|
|
197
|
+
"""
|
|
198
|
+
Generate iterables.
|
|
199
|
+
|
|
200
|
+
Returns
|
|
201
|
+
-------
|
|
202
|
+
Tuple[int]
|
|
203
|
+
The ``opts`` attribute (inside a tuple).
|
|
204
|
+
"""
|
|
205
|
+
def __iter__(self):
|
|
206
|
+
"""Iterate over objects."""
|
|
173
207
|
|
|
174
208
|
class IndentMap(TypedDict):
|
|
175
209
|
"""
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
This is a ``TypedDict``-like object.
|
|
210
|
+
An object containing ``level`` and ``expandtab``.
|
|
179
211
|
|
|
180
212
|
Attributes
|
|
181
213
|
----------
|
|
@@ -187,11 +219,18 @@ class IndentMap(TypedDict):
|
|
|
187
219
|
level: int
|
|
188
220
|
expandtab: bool
|
|
189
221
|
|
|
190
|
-
class IndentHandler
|
|
222
|
+
class IndentHandler:
|
|
191
223
|
"""
|
|
192
|
-
|
|
224
|
+
An object containing ``ft_ext``, ``level`` and ``expandtab``.
|
|
193
225
|
|
|
194
|
-
|
|
226
|
+
Parameters
|
|
227
|
+
----------
|
|
228
|
+
ft_ext : str
|
|
229
|
+
The file-extension/file-type.
|
|
230
|
+
level : str
|
|
231
|
+
The string representation of the indent level.
|
|
232
|
+
expandtab : bool
|
|
233
|
+
Whether to expand tabs or not.
|
|
195
234
|
|
|
196
235
|
Attributes
|
|
197
236
|
----------
|
|
@@ -205,12 +244,31 @@ class IndentHandler(TypedDict):
|
|
|
205
244
|
ft_ext: str
|
|
206
245
|
level: str
|
|
207
246
|
expandtab: bool
|
|
247
|
+
def __init__(self, ft_ext: str, level: str, expandtab: bool) -> None: ...
|
|
248
|
+
def __iterables(self) -> tuple[str, str, bool]:
|
|
249
|
+
"""
|
|
250
|
+
Generate iterables.
|
|
251
|
+
|
|
252
|
+
Returns
|
|
253
|
+
-------
|
|
254
|
+
Tuple[str, str, bool]
|
|
255
|
+
The ``ft_ext``, ``level`` and ``expandtab`` attributes.
|
|
256
|
+
"""
|
|
257
|
+
def __iter__(self):
|
|
258
|
+
"""Iterate over objects."""
|
|
208
259
|
|
|
209
|
-
class IOWrapperBool
|
|
260
|
+
class IOWrapperBool:
|
|
210
261
|
"""
|
|
211
|
-
|
|
262
|
+
An object containing ``file``, ``had_nwl`` and ``crlf``.
|
|
212
263
|
|
|
213
|
-
|
|
264
|
+
Parameters
|
|
265
|
+
----------
|
|
266
|
+
file : TextIO
|
|
267
|
+
The opened file as a ``TextIO`` wrapper.
|
|
268
|
+
had_nwl : bool
|
|
269
|
+
Whether the file has a newline or not.
|
|
270
|
+
crlf : bool
|
|
271
|
+
Whether the file is CRLF-terminated.
|
|
214
272
|
|
|
215
273
|
Attributes
|
|
216
274
|
----------
|
|
@@ -224,12 +282,31 @@ class IOWrapperBool(TypedDict):
|
|
|
224
282
|
file: TextIO
|
|
225
283
|
had_nwl: bool
|
|
226
284
|
crlf: bool
|
|
285
|
+
def __init__(self, file: TextIO, had_nwl: bool, crlf: bool) -> None: ...
|
|
286
|
+
def __iterables(self) -> tuple[TextIO, bool, bool]:
|
|
287
|
+
"""
|
|
288
|
+
Generate iterables.
|
|
289
|
+
|
|
290
|
+
Returns
|
|
291
|
+
-------
|
|
292
|
+
Tuple[TextIO, bool, bool]
|
|
293
|
+
The ``file``, ``had_nwl`` and ``crlf`` attributes.
|
|
294
|
+
"""
|
|
295
|
+
def __iter__(self):
|
|
296
|
+
"""Iterate over objects."""
|
|
227
297
|
|
|
228
|
-
class LineBool
|
|
298
|
+
class LineBool:
|
|
229
299
|
"""
|
|
230
|
-
|
|
300
|
+
An object containing ``line``, ``had_nwl`` and ``crlf``.
|
|
231
301
|
|
|
232
|
-
|
|
302
|
+
Parameters
|
|
303
|
+
----------
|
|
304
|
+
line : str
|
|
305
|
+
The last line of the target file.
|
|
306
|
+
had_nwl : bool
|
|
307
|
+
Whether the file has a newline or not.
|
|
308
|
+
crlf : bool
|
|
309
|
+
Whether the file is CRLF-terminated.
|
|
233
310
|
|
|
234
311
|
Attributes
|
|
235
312
|
----------
|
|
@@ -243,12 +320,29 @@ class LineBool(TypedDict):
|
|
|
243
320
|
line: str
|
|
244
321
|
had_nwl: bool
|
|
245
322
|
crlf: bool
|
|
323
|
+
def __init__(self, line: str, had_nwl: bool, crlf: bool) -> None: ...
|
|
324
|
+
def __iterables(self) -> tuple[str, bool, bool]:
|
|
325
|
+
"""
|
|
326
|
+
Generate iterables.
|
|
246
327
|
|
|
247
|
-
|
|
328
|
+
Returns
|
|
329
|
+
-------
|
|
330
|
+
Tuple[str, bool, bool]
|
|
331
|
+
The ``line``, ``had_nwl`` and ``crlf`` attributes.
|
|
332
|
+
"""
|
|
333
|
+
def __iter__(self):
|
|
334
|
+
"""Iterate over objects."""
|
|
335
|
+
|
|
336
|
+
class BatchPathDict:
|
|
248
337
|
"""
|
|
249
|
-
|
|
338
|
+
An object containing ``file`` and ``ft_ext``.
|
|
250
339
|
|
|
251
|
-
|
|
340
|
+
Parameters
|
|
341
|
+
----------
|
|
342
|
+
file : TextIO
|
|
343
|
+
The opened file as a ``TextIO`` wrapper.
|
|
344
|
+
ft_ext : str
|
|
345
|
+
The file-type/file-extension.
|
|
252
346
|
|
|
253
347
|
Attributes
|
|
254
348
|
----------
|
|
@@ -259,12 +353,29 @@ class BatchPathDict(TypedDict):
|
|
|
259
353
|
"""
|
|
260
354
|
file: TextIO
|
|
261
355
|
ft_ext: str
|
|
356
|
+
def __init__(self, file: TextIO, ft_ext: str) -> None: ...
|
|
357
|
+
def __iterables(self) -> tuple[TextIO, str]:
|
|
358
|
+
"""
|
|
359
|
+
Generate iterables.
|
|
360
|
+
|
|
361
|
+
Returns
|
|
362
|
+
-------
|
|
363
|
+
Tuple[TextIO, str]
|
|
364
|
+
The ``file`` and ``ft_ext`` attributes.
|
|
365
|
+
"""
|
|
366
|
+
def __iter__(self):
|
|
367
|
+
"""Iterate over objects."""
|
|
262
368
|
|
|
263
|
-
class BatchPairDict
|
|
369
|
+
class BatchPairDict:
|
|
264
370
|
"""
|
|
265
|
-
|
|
371
|
+
An object containing ``fpath`` and ``ft_ext``.
|
|
266
372
|
|
|
267
|
-
|
|
373
|
+
Parameters
|
|
374
|
+
----------
|
|
375
|
+
fpath : str
|
|
376
|
+
The target file's path.
|
|
377
|
+
ft_ext : str
|
|
378
|
+
The file-type/file-extension.
|
|
268
379
|
|
|
269
380
|
Attributes
|
|
270
381
|
----------
|
|
@@ -275,13 +386,34 @@ class BatchPairDict(TypedDict):
|
|
|
275
386
|
"""
|
|
276
387
|
fpath: str
|
|
277
388
|
ft_ext: str
|
|
389
|
+
def __init__(self, fpath: str, ft_ext: str) -> None: ...
|
|
390
|
+
def __iterables(self) -> tuple[str, str]:
|
|
391
|
+
"""
|
|
392
|
+
Generate iterables.
|
|
393
|
+
|
|
394
|
+
Returns
|
|
395
|
+
-------
|
|
396
|
+
Tuple[str, str]
|
|
397
|
+
The ``fpath`` and ``ft_ext`` attributes.
|
|
398
|
+
"""
|
|
399
|
+
def __iter__(self):
|
|
400
|
+
"""Iterate over objects."""
|
|
278
401
|
|
|
279
|
-
class EOFCommentSearch
|
|
402
|
+
class EOFCommentSearch:
|
|
280
403
|
"""
|
|
281
404
|
A dict containing ``state``, ``lang`` and ``match`` as keys.
|
|
282
405
|
|
|
283
406
|
This is a ``TypedDict``-like object.
|
|
284
407
|
|
|
408
|
+
Parameters
|
|
409
|
+
----------
|
|
410
|
+
state : IOWrapperBool
|
|
411
|
+
The target ``IOWrapperBool`` object.
|
|
412
|
+
lang : str
|
|
413
|
+
The file language.
|
|
414
|
+
match : bool
|
|
415
|
+
Whether it has a variation of an EOF comment at the end.
|
|
416
|
+
|
|
285
417
|
Attributes
|
|
286
418
|
----------
|
|
287
419
|
state : IOWrapperBool
|
|
@@ -294,5 +426,17 @@ class EOFCommentSearch(TypedDict):
|
|
|
294
426
|
state: IOWrapperBool
|
|
295
427
|
lang: str
|
|
296
428
|
match: bool
|
|
429
|
+
def __init__(self, state: IOWrapperBool, lang: str, match: bool) -> None: ...
|
|
430
|
+
def __iterables(self) -> tuple[IOWrapperBool, str, bool]:
|
|
431
|
+
"""
|
|
432
|
+
Generate iterables.
|
|
433
|
+
|
|
434
|
+
Returns
|
|
435
|
+
-------
|
|
436
|
+
Tuple[IOWrapperBool, str, bool]
|
|
437
|
+
The ``state``, ``lang`` and ``match`` attributes.
|
|
438
|
+
"""
|
|
439
|
+
def __iter__(self):
|
|
440
|
+
"""Iterate over objects."""
|
|
297
441
|
|
|
298
442
|
# vim: set ts=4 sts=4 sw=4 et ai si sta:
|
vim_eof_comment/util.py
CHANGED
|
@@ -14,12 +14,12 @@ __all__ = [
|
|
|
14
14
|
|
|
15
15
|
from sys import exit as Exit
|
|
16
16
|
from sys import stderr, stdout
|
|
17
|
-
from typing import Callable, Dict, List,
|
|
17
|
+
from typing import Callable, Dict, List, TextIO
|
|
18
18
|
|
|
19
19
|
from .types import IndentHandler, IndentMap
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
def error(*msg, **kwargs) ->
|
|
22
|
+
def error(*msg, **kwargs) -> None:
|
|
23
23
|
"""
|
|
24
24
|
Print to stderr.
|
|
25
25
|
|
|
@@ -40,7 +40,7 @@ def error(*msg, **kwargs) -> NoReturn:
|
|
|
40
40
|
print(*msg, file=stderr, end=end, sep=sep, flush=flush)
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
def die(*msg, code: int = 0, func: Callable[[TextIO], None] | None = None, **kwargs) ->
|
|
43
|
+
def die(*msg, code: int = 0, func: Callable[[TextIO], None] | None = None, **kwargs) -> None:
|
|
44
44
|
"""
|
|
45
45
|
Kill the program execution.
|
|
46
46
|
|
|
@@ -98,7 +98,7 @@ def die(*msg, code: int = 0, func: Callable[[TextIO], None] | None = None, **kwa
|
|
|
98
98
|
Exit(code)
|
|
99
99
|
|
|
100
100
|
|
|
101
|
-
def verbose_print(*msg, verbose: bool | None = None, **kwargs) ->
|
|
101
|
+
def verbose_print(*msg, verbose: bool | None = None, **kwargs) -> None:
|
|
102
102
|
"""
|
|
103
103
|
Only prints the given data if verbose mode is activated.
|
|
104
104
|
|
|
@@ -153,14 +153,14 @@ def gen_indent_maps(maps: List[IndentHandler]) -> Dict[str, IndentMap] | None:
|
|
|
153
153
|
if mapping_len <= 1:
|
|
154
154
|
raise ValueError(f"One of the custom mappings is not formatted properly! (`{mapping}`)")
|
|
155
155
|
|
|
156
|
-
ext, level = mapping
|
|
156
|
+
ext, level = mapping.ft_ext, mapping.level
|
|
157
157
|
if ext in map_d.keys():
|
|
158
158
|
continue
|
|
159
159
|
|
|
160
160
|
mapping_len = mapping_len if mapping_len <= 3 else 3
|
|
161
161
|
map_d[ext] = IndentMap(
|
|
162
162
|
level=level,
|
|
163
|
-
expandtab=True if mapping_len == 2 else mapping
|
|
163
|
+
expandtab=True if mapping_len == 2 else mapping.expandtab
|
|
164
164
|
)
|
|
165
165
|
|
|
166
166
|
return map_d
|
vim_eof_comment/util.pyi
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
from typing import Callable,
|
|
1
|
+
from typing import Callable, TextIO
|
|
2
2
|
|
|
3
3
|
from .types import IndentHandler, IndentMap
|
|
4
4
|
|
|
5
5
|
__all__ = ['die', 'error', 'gen_indent_maps', 'verbose_print']
|
|
6
6
|
|
|
7
|
-
def error(*msg, **kwargs) ->
|
|
7
|
+
def error(*msg, **kwargs) -> None:
|
|
8
8
|
"""
|
|
9
9
|
Print to stderr.
|
|
10
10
|
|
|
@@ -19,7 +19,7 @@ def error(*msg, **kwargs) -> NoReturn:
|
|
|
19
19
|
--------
|
|
20
20
|
print : This function is essentially being wrapped around here.
|
|
21
21
|
"""
|
|
22
|
-
def die(*msg, code: int = 0, func: Callable[[TextIO], None] | None = None, **kwargs) ->
|
|
22
|
+
def die(*msg, code: int = 0, func: Callable[[TextIO], None] | None = None, **kwargs) -> None:
|
|
23
23
|
'''
|
|
24
24
|
Kill the program execution.
|
|
25
25
|
|
|
@@ -60,7 +60,7 @@ def die(*msg, code: int = 0, func: Callable[[TextIO], None] | None = None, **kwa
|
|
|
60
60
|
>>> die("foo", "bar")
|
|
61
61
|
foo bar
|
|
62
62
|
'''
|
|
63
|
-
def verbose_print(*msg, verbose: bool | None = None, **kwargs) ->
|
|
63
|
+
def verbose_print(*msg, verbose: bool | None = None, **kwargs) -> None:
|
|
64
64
|
"""
|
|
65
65
|
Only prints the given data if verbose mode is activated.
|
|
66
66
|
|
vim_eof_comment/version.py
CHANGED
|
@@ -7,8 +7,6 @@ Copyright (c) 2025 Guennadi Maximov C. All Rights Reserved.
|
|
|
7
7
|
"""
|
|
8
8
|
__all__ = ["VersionInfo", "list_versions", "version_info", "version_print", "__version__"]
|
|
9
9
|
|
|
10
|
-
from typing import NoReturn
|
|
11
|
-
|
|
12
10
|
from .types import VersionInfo
|
|
13
11
|
from .util import die
|
|
14
12
|
|
|
@@ -84,17 +82,18 @@ version_info = VersionInfo([
|
|
|
84
82
|
(0, 5, 1),
|
|
85
83
|
(0, 5, 2),
|
|
86
84
|
(0, 5, 3),
|
|
85
|
+
(0, 6, 0),
|
|
87
86
|
])
|
|
88
87
|
|
|
89
88
|
__version__: str = str(version_info)
|
|
90
89
|
|
|
91
90
|
|
|
92
|
-
def list_versions() ->
|
|
91
|
+
def list_versions() -> None:
|
|
93
92
|
"""List all versions."""
|
|
94
93
|
die(version_info.get_all_versions(), code=0)
|
|
95
94
|
|
|
96
95
|
|
|
97
|
-
def version_print(version: str) ->
|
|
96
|
+
def version_print(version: str) -> None:
|
|
98
97
|
"""
|
|
99
98
|
Print project version, then exit.
|
|
100
99
|
|
vim_eof_comment/version.pyi
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
from typing import NoReturn
|
|
2
|
-
|
|
3
1
|
from _typeshed import Incomplete
|
|
4
2
|
|
|
5
3
|
from .types import VersionInfo as VersionInfo
|
|
@@ -9,9 +7,9 @@ __all__ = ['VersionInfo', 'list_versions', 'version_info', 'version_print', '__v
|
|
|
9
7
|
version_info: Incomplete
|
|
10
8
|
__version__: str
|
|
11
9
|
|
|
12
|
-
def list_versions() ->
|
|
10
|
+
def list_versions() -> None:
|
|
13
11
|
"""List all versions."""
|
|
14
|
-
def version_print(version: str) ->
|
|
12
|
+
def version_print(version: str) -> None:
|
|
15
13
|
"""
|
|
16
14
|
Print project version, then exit.
|
|
17
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vim-eof-comment
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Summary: Adds Vim EOF modeline comments for given filetypes in given directories
|
|
5
5
|
Author-email: Guennadi Maximov C <g.maxc.fox@protonmail.com>
|
|
6
6
|
Maintainer-email: Guennadi Maximov C <g.maxc.fox@protonmail.com>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
docs/Makefile,sha256=1rYkueTz6GC8AAF0rtOIJIv7sX-hMxVQBumHEqvbFEI,684
|
|
2
|
+
docs/make.bat,sha256=0qjrzODegavKd7LLwmr9ADhaYftiTnBgqOVAL9kApyo,769
|
|
3
|
+
docs/source/conf.py,sha256=nqU9B3qBpI-hZ8-L2oJuh2xY4Ob-GCD3nN00JiZbRHg,1729
|
|
4
|
+
docs/source/functions.rst,sha256=erouYhzblZATxkA5yB6aUvF8baSvBcPQ9HwySWATTdI,20
|
|
5
|
+
docs/source/index.rst,sha256=q7DKNrR1ztwLflzGbZDnIhFwkUTcjInqZV8uRqSq2N0,457
|
|
6
|
+
docs/source/installation.rst,sha256=PkiS3E_ujNTWeKXicZ7aBPch2l1R0TsRRL6pFj_oMJI,276
|
|
7
|
+
vim_eof_comment/__init__.py,sha256=ESbmhca9mTst3TYMer8zFw73IRsJvn5EESci_RpfLbQ,487
|
|
8
|
+
vim_eof_comment/__init__.pyi,sha256=Eh8FQwE_F9TrQEiT7CR1mdGHBT6fHUzfV6VP8uSN33g,478
|
|
9
|
+
vim_eof_comment/__main__.py,sha256=0AFVSkz8RuxSuPbJJWycyxs6u5Yypl8FKUMR3ZVLJbk,343
|
|
10
|
+
vim_eof_comment/eof.py,sha256=rGKPqO6JbDzdJcsp20Ma9LLdyNHuUjC9ddU9F5nZqDE,5259
|
|
11
|
+
vim_eof_comment/eof.pyi,sha256=xmAMsxOyiKQs4BqZP8h8rqP4a-ONifnb491sAzbu2Y8,1839
|
|
12
|
+
vim_eof_comment/file.py,sha256=k1pX1RMZYtUkTXqTrAPsamn86Owl_OZ86XKHvV-q1Qo,5410
|
|
13
|
+
vim_eof_comment/file.pyi,sha256=yqZh8ipC4X0GpMLVTUsw1UyiQ0JO6dY-_-0qGzJ3HF4,2317
|
|
14
|
+
vim_eof_comment/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
+
vim_eof_comment/regex.py,sha256=48oxUO3YDdM30U0qAsqyH_AycYCrcnaQ6cghy3NXHrw,903
|
|
16
|
+
vim_eof_comment/regex.pyi,sha256=W0ZX_J9mLRckCdBNE-Bl09hsQ61VFqjuLwDlevEeeUM,336
|
|
17
|
+
vim_eof_comment/types.py,sha256=9DP25oIFcLwf1rbv1d8PCoL1J6bY_NOjFWjJyL4DA_I,13621
|
|
18
|
+
vim_eof_comment/types.pyi,sha256=bBq_Jzl1HlczAG8ayFYS57Es_PcgU4cM-vuf-05VS60,11332
|
|
19
|
+
vim_eof_comment/util.py,sha256=rgYlXi1epsNxFEFSElUG4zCoGb6WQoguH7uphcI0Y9Y,4256
|
|
20
|
+
vim_eof_comment/util.pyi,sha256=twD4qk_fIL4ftQGbaGYmTSbKqE-RycAs5WTYBZ-HZsc,2653
|
|
21
|
+
vim_eof_comment/version.py,sha256=XdpssUzLL8mKqe37XDXTnWKapxkyBiTVal2uanbjgNw,1906
|
|
22
|
+
vim_eof_comment/version.pyi,sha256=aiA3TyTJOk5eZFt7glPNzRBvVgCwSJDlOFSUqoMPFG4,488
|
|
23
|
+
vim_eof_comment/args/__init__.py,sha256=Hyqun15456NVFLAJ3cpdtuNEz5XaFH93vfVlbC-aeuc,318
|
|
24
|
+
vim_eof_comment/args/__init__.pyi,sha256=cXK7nEpYBveD4kxtVTe2x8oUxT9mhENS5r3wK3AAX2U,151
|
|
25
|
+
vim_eof_comment/args/completion.py,sha256=X2O-02QHeKBNF6alJHM9qka0l3-aY5TUTAqnHLY0bSY,1256
|
|
26
|
+
vim_eof_comment/args/completion.pyi,sha256=nrKI8BYBe3cEXGOwkBDkeWgofjQpdGYL8mJR6ts1c9U,859
|
|
27
|
+
vim_eof_comment/args/parsing.py,sha256=Clp23emNb1X0KVbnwIY1egA4G1BJjMHiOPkoaNMdq2E,6593
|
|
28
|
+
vim_eof_comment/args/parsing.pyi,sha256=wJMDnW_dtIlv8NfTvf_JyTB7qwk_ZwLvCizp3GkFWhw,1741
|
|
29
|
+
vim_eof_comment/comments/__init__.py,sha256=KIFAbugEKa8arCASaf7pKNHdzUC99N_T18D1CfaCOQs,292
|
|
30
|
+
vim_eof_comment/comments/__init__.pyi,sha256=cecbbrShh0If8btwJ8zKYpBt9dIsMwrDXbdaBQqwUus,104
|
|
31
|
+
vim_eof_comment/comments/filetypes.json,sha256=JpSrnBNO2AivLYi-C5--8yVocyBwye3IkMesNIz1uHA,2973
|
|
32
|
+
vim_eof_comment/comments/generator.py,sha256=pCv6FFVCo4GscsB7-cbh-C8Ds19gYZ9dZAX2li9IZkc,7786
|
|
33
|
+
vim_eof_comment/comments/generator.pyi,sha256=MAT7N0bPQE2IswSWOyiELnldbsBcjVsnIwSj4ltkI4g,3665
|
|
34
|
+
vim_eof_comment-0.6.0.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
|
35
|
+
vim_eof_comment-0.6.0.dist-info/METADATA,sha256=UuN2LfHn7DksUxHDDXT6QHkX72m5qHEOEP8r3YN6n2o,2826
|
|
36
|
+
vim_eof_comment-0.6.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
37
|
+
vim_eof_comment-0.6.0.dist-info/entry_points.txt,sha256=vm47g4hoUbow4elcHr9yylYfj6IvAs10wSFKqwqTu6E,61
|
|
38
|
+
vim_eof_comment-0.6.0.dist-info/top_level.txt,sha256=TkaQ5vuhVzXaJnfUdcLJCQ81ILK2V6OtvX5-hIMZAc0,21
|
|
39
|
+
vim_eof_comment-0.6.0.dist-info/RECORD,,
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
docs/Makefile,sha256=1rYkueTz6GC8AAF0rtOIJIv7sX-hMxVQBumHEqvbFEI,684
|
|
2
|
-
docs/make.bat,sha256=0qjrzODegavKd7LLwmr9ADhaYftiTnBgqOVAL9kApyo,769
|
|
3
|
-
docs/source/conf.py,sha256=nqU9B3qBpI-hZ8-L2oJuh2xY4Ob-GCD3nN00JiZbRHg,1729
|
|
4
|
-
docs/source/functions.rst,sha256=erouYhzblZATxkA5yB6aUvF8baSvBcPQ9HwySWATTdI,20
|
|
5
|
-
docs/source/index.rst,sha256=q7DKNrR1ztwLflzGbZDnIhFwkUTcjInqZV8uRqSq2N0,457
|
|
6
|
-
docs/source/installation.rst,sha256=PkiS3E_ujNTWeKXicZ7aBPch2l1R0TsRRL6pFj_oMJI,276
|
|
7
|
-
vim_eof_comment/__init__.py,sha256=ESbmhca9mTst3TYMer8zFw73IRsJvn5EESci_RpfLbQ,487
|
|
8
|
-
vim_eof_comment/__init__.pyi,sha256=Eh8FQwE_F9TrQEiT7CR1mdGHBT6fHUzfV6VP8uSN33g,478
|
|
9
|
-
vim_eof_comment/__main__.py,sha256=0AFVSkz8RuxSuPbJJWycyxs6u5Yypl8FKUMR3ZVLJbk,343
|
|
10
|
-
vim_eof_comment/eof.py,sha256=gWq0mVc0PcRNW4R41BBRlDw3B2etCvv0qXUSHOiH72Q,5295
|
|
11
|
-
vim_eof_comment/eof.pyi,sha256=eFaIkPQ3ZXS3CE6QpTEA9QCQmJpmG_5N3Kb3_Iz_tOo,1872
|
|
12
|
-
vim_eof_comment/file.py,sha256=jR3VBVZ_yT9bMbi0SXQKMGexYgtWrvWkJEtodAIksrg,5395
|
|
13
|
-
vim_eof_comment/file.pyi,sha256=XOYsJnW72i7Zt9N0jSLpscls-ggzL08aQKXpxrLFiwY,2274
|
|
14
|
-
vim_eof_comment/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
-
vim_eof_comment/regex.py,sha256=48oxUO3YDdM30U0qAsqyH_AycYCrcnaQ6cghy3NXHrw,903
|
|
16
|
-
vim_eof_comment/regex.pyi,sha256=W0ZX_J9mLRckCdBNE-Bl09hsQ61VFqjuLwDlevEeeUM,336
|
|
17
|
-
vim_eof_comment/types.py,sha256=kujXMK19J0Nngf6eoHyg04ZfD-WKAB_Cdna7uRVJTKQ,8367
|
|
18
|
-
vim_eof_comment/types.pyi,sha256=OnXme5rgPq9vt8LHTRCSeOpkBAuc2J_7pcwcXFHOk1A,7255
|
|
19
|
-
vim_eof_comment/util.py,sha256=MHLt-FJz4uhsa56J2sug74uqk6W3S0mVLugvz7KNRUU,4287
|
|
20
|
-
vim_eof_comment/util.pyi,sha256=5RQukLgpVZTwbALhBOtd1NqFkiqC-V6JEWeT1_B9-2k,2675
|
|
21
|
-
vim_eof_comment/version.py,sha256=bP9IxYQS_QivEBpnNsL4Cl70-Q3Y0cP591byW2XmQYQ,1928
|
|
22
|
-
vim_eof_comment/version.pyi,sha256=P90IRWMKlsG_YU8G8a1e1eyTd8rC-6fUGvQrD3zjwbE,525
|
|
23
|
-
vim_eof_comment/args/__init__.py,sha256=Hyqun15456NVFLAJ3cpdtuNEz5XaFH93vfVlbC-aeuc,318
|
|
24
|
-
vim_eof_comment/args/__init__.pyi,sha256=cXK7nEpYBveD4kxtVTe2x8oUxT9mhENS5r3wK3AAX2U,151
|
|
25
|
-
vim_eof_comment/args/completion.py,sha256=xpfMKeo1-LBMeU-5icO1Jh5ixml55sK5ExHbi5sSXKg,1270
|
|
26
|
-
vim_eof_comment/args/completion.pyi,sha256=bEMpcLKYUZEGj3V9yiYifpLxfuNC69etdIf-gdsdtJc,891
|
|
27
|
-
vim_eof_comment/args/parsing.py,sha256=Zp1u4--4t4lfQF8RZLhCFfE6Khlc5rcG7gHcPXaPthw,6605
|
|
28
|
-
vim_eof_comment/args/parsing.pyi,sha256=wJMDnW_dtIlv8NfTvf_JyTB7qwk_ZwLvCizp3GkFWhw,1741
|
|
29
|
-
vim_eof_comment/comments/__init__.py,sha256=KIFAbugEKa8arCASaf7pKNHdzUC99N_T18D1CfaCOQs,292
|
|
30
|
-
vim_eof_comment/comments/__init__.pyi,sha256=cecbbrShh0If8btwJ8zKYpBt9dIsMwrDXbdaBQqwUus,104
|
|
31
|
-
vim_eof_comment/comments/filetypes.json,sha256=JpSrnBNO2AivLYi-C5--8yVocyBwye3IkMesNIz1uHA,2973
|
|
32
|
-
vim_eof_comment/comments/generator.py,sha256=yuRvTuVd6qQ1ei496w8NQ0c1MR1e3qJHf1pOTalXlv8,7814
|
|
33
|
-
vim_eof_comment/comments/generator.pyi,sha256=ue8oMa7yEoKfgQDJbeTzx0Qm5Wck2gHrDb_wF00xIyo,3687
|
|
34
|
-
vim_eof_comment-0.5.3.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
|
35
|
-
vim_eof_comment-0.5.3.dist-info/METADATA,sha256=lexJQiJJA7rL5pP1DRU_VkQvRFXLy5nSbIXAk-pwP3I,2826
|
|
36
|
-
vim_eof_comment-0.5.3.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
37
|
-
vim_eof_comment-0.5.3.dist-info/entry_points.txt,sha256=vm47g4hoUbow4elcHr9yylYfj6IvAs10wSFKqwqTu6E,61
|
|
38
|
-
vim_eof_comment-0.5.3.dist-info/top_level.txt,sha256=TkaQ5vuhVzXaJnfUdcLJCQ81ILK2V6OtvX5-hIMZAc0,21
|
|
39
|
-
vim_eof_comment-0.5.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|