vim-eof-comment 0.3.10__py3-none-any.whl → 0.3.11__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.
- docs/Makefile +22 -0
- docs/make.bat +35 -0
- docs/source/conf.py +39 -0
- docs/source/functions.rst +2 -0
- docs/source/index.rst +22 -0
- docs/source/usage.rst +11 -0
- vim_eof_comment/__init__.py +2 -4
- vim_eof_comment/__init__.pyi +4 -3
- vim_eof_comment/args/parsing.py +1 -1
- vim_eof_comment/comments/__init__.py +2 -2
- vim_eof_comment/comments/__init__.pyi +1 -2
- vim_eof_comment/comments/filetypes.json +1 -1
- vim_eof_comment/comments/generator.py +28 -28
- vim_eof_comment/comments/generator.pyi +23 -23
- vim_eof_comment/eof.py +5 -8
- vim_eof_comment/eof.pyi +1 -1
- vim_eof_comment/file.py +4 -4
- vim_eof_comment/file.pyi +1 -1
- vim_eof_comment/types.py +6 -6
- vim_eof_comment/types.pyi +6 -6
- vim_eof_comment/util.py +1 -1
- vim_eof_comment/version.py +6 -3
- vim_eof_comment/version.pyi +4 -3
- {vim_eof_comment-0.3.10.dist-info → vim_eof_comment-0.3.11.dist-info}/METADATA +3 -2
- vim_eof_comment-0.3.11.dist-info/RECORD +39 -0
- {vim_eof_comment-0.3.10.dist-info → vim_eof_comment-0.3.11.dist-info}/top_level.txt +1 -0
- vim_eof_comment/comments/types.py +0 -76
- vim_eof_comment/comments/types.pyi +0 -65
- vim_eof_comment-0.3.10.dist-info/RECORD +0 -35
- {vim_eof_comment-0.3.10.dist-info → vim_eof_comment-0.3.11.dist-info}/WHEEL +0 -0
- {vim_eof_comment-0.3.10.dist-info → vim_eof_comment-0.3.11.dist-info}/entry_points.txt +0 -0
- {vim_eof_comment-0.3.10.dist-info → vim_eof_comment-0.3.11.dist-info}/licenses/LICENSE +0 -0
docs/Makefile
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line, and also
|
|
5
|
+
# from the environment for the first two.
|
|
6
|
+
SPHINXOPTS ?=
|
|
7
|
+
SPHINXBUILD ?= sphinx-build
|
|
8
|
+
SOURCEDIR := source
|
|
9
|
+
BUILDDIR := build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
21
|
+
|
|
22
|
+
# vim: set ts=4 sts=4 sw=0 noet ai si sta:
|
docs/make.bat
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@ECHO OFF
|
|
2
|
+
|
|
3
|
+
pushd %~dp0
|
|
4
|
+
|
|
5
|
+
REM Command file for Sphinx documentation
|
|
6
|
+
|
|
7
|
+
if "%SPHINXBUILD%" == "" (
|
|
8
|
+
set SPHINXBUILD=sphinx-build
|
|
9
|
+
)
|
|
10
|
+
set SOURCEDIR=source
|
|
11
|
+
set BUILDDIR=build
|
|
12
|
+
|
|
13
|
+
%SPHINXBUILD% >NUL 2>NUL
|
|
14
|
+
if errorlevel 9009 (
|
|
15
|
+
echo.
|
|
16
|
+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
|
17
|
+
echo.installed, then set the SPHINXBUILD environment variable to point
|
|
18
|
+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
|
19
|
+
echo.may add the Sphinx directory to PATH.
|
|
20
|
+
echo.
|
|
21
|
+
echo.If you don't have Sphinx installed, grab it from
|
|
22
|
+
echo.https://www.sphinx-doc.org/
|
|
23
|
+
exit /b 1
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
if "%1" == "" goto help
|
|
27
|
+
|
|
28
|
+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
29
|
+
goto end
|
|
30
|
+
|
|
31
|
+
:help
|
|
32
|
+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
33
|
+
|
|
34
|
+
:end
|
|
35
|
+
popd
|
docs/source/conf.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Configuration file for the Sphinx documentation builder.
|
|
2
|
+
#
|
|
3
|
+
# For the full list of built-in configuration values, see the documentation:
|
|
4
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
5
|
+
"""Runs configuration for building Sphinx documentation."""
|
|
6
|
+
|
|
7
|
+
import sys
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from typing import List
|
|
10
|
+
|
|
11
|
+
sys.path.insert(0, str(Path('..', 'src').resolve()))
|
|
12
|
+
|
|
13
|
+
# -- Project information -----------------------------------------------------
|
|
14
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
|
15
|
+
|
|
16
|
+
project: str = 'vim-eof-comment'
|
|
17
|
+
copyright: str = '2025, Guennadi Maximov C'
|
|
18
|
+
author: str = 'Guennadi Maximov C'
|
|
19
|
+
release: str = '0.1.33'
|
|
20
|
+
|
|
21
|
+
# -- General configuration ---------------------------------------------------
|
|
22
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
23
|
+
|
|
24
|
+
extensions: List[str] = [
|
|
25
|
+
'sphinx.ext.autodoc',
|
|
26
|
+
'sphinx.ext.autosectionlabel',
|
|
27
|
+
'sphinx.ext.duration',
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
templates_path: List[str] = ['_templates']
|
|
31
|
+
exclude_patterns: List[str] = []
|
|
32
|
+
|
|
33
|
+
# -- Options for HTML output -------------------------------------------------
|
|
34
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
35
|
+
|
|
36
|
+
html_theme: str = 'sphinx_rtd_theme'
|
|
37
|
+
html_static_path: List[str] = ['_static']
|
|
38
|
+
|
|
39
|
+
# vim: set ts=4 sts=4 sw=4 et ai si sta:
|
docs/source/index.rst
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
vim-eof-comment
|
|
2
|
+
===============
|
|
3
|
+
|
|
4
|
+
**vim-eof-comment** is a Python script that adds Vim EOF comments for given filetypes in a directory.
|
|
5
|
+
|
|
6
|
+
This tool adds a `Vim modeline comment <https://neovim.io/doc/user/options.html#_2.-automatically-setting-options>`_
|
|
7
|
+
at the end of the target files.
|
|
8
|
+
|
|
9
|
+
.. note::
|
|
10
|
+
This project is under active development.
|
|
11
|
+
|
|
12
|
+
.. toctree::
|
|
13
|
+
:maxdepth: 2
|
|
14
|
+
:caption: Contents:
|
|
15
|
+
|
|
16
|
+
Contents
|
|
17
|
+
--------
|
|
18
|
+
|
|
19
|
+
.. toctree::
|
|
20
|
+
|
|
21
|
+
usage
|
|
22
|
+
functions
|
docs/source/usage.rst
ADDED
vim_eof_comment/__init__.py
CHANGED
|
@@ -6,6 +6,7 @@ Ensure EOF Vim comments.
|
|
|
6
6
|
Copyright (c) 2025 Guennadi Maximov C. All Rights Reserved.
|
|
7
7
|
"""
|
|
8
8
|
__all__ = [
|
|
9
|
+
"__version__",
|
|
9
10
|
"args",
|
|
10
11
|
"comments",
|
|
11
12
|
"eof",
|
|
@@ -15,13 +16,10 @@ __all__ = [
|
|
|
15
16
|
"types",
|
|
16
17
|
"util",
|
|
17
18
|
"version",
|
|
18
|
-
"version_info",
|
|
19
19
|
]
|
|
20
20
|
|
|
21
21
|
from . import args, comments, eof, file, regex, types, util
|
|
22
22
|
from .eof import main
|
|
23
|
-
from .version import
|
|
24
|
-
|
|
25
|
-
version: str = str(version_info)
|
|
23
|
+
from .version import __version__
|
|
26
24
|
|
|
27
25
|
# vim: set ts=4 sts=4 sw=4 et ai si sta:
|
vim_eof_comment/__init__.pyi
CHANGED
|
@@ -6,10 +6,11 @@ from . import regex as regex
|
|
|
6
6
|
from . import types as types
|
|
7
7
|
from . import util as util
|
|
8
8
|
from .eof import main as main
|
|
9
|
-
from .version import
|
|
9
|
+
from .version import __version__ as __version__
|
|
10
10
|
|
|
11
|
-
__all__ = ['args', 'comments', 'eof', 'file', 'main', 'regex', 'types', 'util', 'version'
|
|
11
|
+
__all__ = ['__version__', 'args', 'comments', 'eof', 'file', 'main', 'regex', 'types', 'util', 'version']
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
# Names in __all__ with no definition:
|
|
14
|
+
# version
|
|
14
15
|
|
|
15
16
|
# vim: set ts=4 sts=4 sw=4 et ai si sta:
|
vim_eof_comment/args/parsing.py
CHANGED
|
@@ -220,7 +220,7 @@ def indent_handler(indent: str) -> List[IndentHandler]:
|
|
|
220
220
|
if len(inds) >= 3 and inds[2].upper() in ("Y", "N"):
|
|
221
221
|
et = not inds[2].upper() == "N"
|
|
222
222
|
|
|
223
|
-
maps.append(IndentHandler(
|
|
223
|
+
maps.append(IndentHandler(ft_ext=ext, level=ind_level, expandtab=et))
|
|
224
224
|
|
|
225
225
|
return maps
|
|
226
226
|
|
|
@@ -5,8 +5,8 @@ Comment class module for ``vim-eof-comment``.
|
|
|
5
5
|
|
|
6
6
|
Copyright (c) 2025 Guennadi Maximov C. All Rights Reserved.
|
|
7
7
|
"""
|
|
8
|
-
__all__ = ["generator"
|
|
8
|
+
__all__ = ["generator"]
|
|
9
9
|
|
|
10
|
-
from . import generator
|
|
10
|
+
from . import generator
|
|
11
11
|
|
|
12
12
|
# vim: set ts=4 sts=4 sw=4 et ai si sta:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"C": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "H": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "Makefile": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "bash": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "c": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "cc": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "cpp": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "css": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "fish": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "h": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "hh": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "hpp": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "htm": "<!-- vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: -->", "html": "<!-- vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: -->", "latex": "% vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "lua": "-- vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "markdown": "<!-- vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: -->", "md": "<!-- vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: -->", "mk": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "py": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "pyi": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "rb": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "sh": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "tex": "% vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "xml": "<!-- vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: -->", "zsh": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:"}, {"C": {"level": 2, "expandtab": true}, "H": {"level": 2, "expandtab": true}, "Makefile": {"level": 4, "expandtab": false}, "bash": {"level": 4, "expandtab": true}, "c": {"level": 2, "expandtab": true}, "cc": {"level": 2, "expandtab": true}, "cpp": {"level": 2, "expandtab": true}, "css": {"level": 4, "expandtab": true}, "fish": {"level": 4, "expandtab": true}, "h": {"level": 2, "expandtab": true}, "hh": {"level": 2, "expandtab": true}, "hpp": {"level": 2, "expandtab": true}, "htm": {"level": 2, "expandtab": true}, "html": {"level": 2, "expandtab": true}, "latex": {"level": 2, "expandtab": true}, "lua": {"level": 4, "expandtab": true}, "markdown": {"level": 2, "expandtab": true}, "md": {"level": 2, "expandtab": true}, "mk": {"level": 4, "expandtab": false}, "py": {"level": 4, "expandtab": true}, "pyi": {"level": 4, "expandtab": true}, "rb": {"level": 4, "expandtab": true}, "sh": {"level": 4, "expandtab": true}, "tex": {"level": 2, "expandtab": true}, "xml": {"level": 2, "expandtab": true}, "zsh": {"level": 4, "expandtab": true}}]
|
|
1
|
+
[{ "C": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "H": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "Makefile": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "bash": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "c": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "cc": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "cpp": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "css": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "fish": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "h": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "hh": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "hpp": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "htm": "<!-- vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: -->", "html": "<!-- vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: -->", "javascript": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "javascriptreact": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "js": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "jsx": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "latex": "% vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "lua": "-- vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "make": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "markdown": "<!-- vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: -->", "md": "<!-- vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: -->", "mk": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "py": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "pyi": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "python": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "rb": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "rs": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "ruby": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "rust": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "sh": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "tex": "% vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "toml": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "ts": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "tsx": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "typescript": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "typescriptreact": "/* vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: */", "xhtml": "<!-- vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: -->", "xml": "<!-- vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta: -->", "yaml": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "yml": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:", "zsh": "# vim: set ts={ts} sts={sts} sw={sw} {et} ai si sta:" }, { "C": { "level": 2, "expandtab": true }, "H": { "level": 2, "expandtab": true }, "Makefile": { "level": 4, "expandtab": false }, "bash": { "level": 4, "expandtab": true }, "c": { "level": 2, "expandtab": true }, "cc": { "level": 2, "expandtab": true }, "cpp": { "level": 2, "expandtab": true }, "css": { "level": 4, "expandtab": true }, "fish": { "level": 4, "expandtab": true }, "h": { "level": 2, "expandtab": true }, "hh": { "level": 2, "expandtab": true }, "hpp": { "level": 2, "expandtab": true }, "htm": { "level": 2, "expandtab": true }, "html": { "level": 2, "expandtab": true }, "javascript": { "level": 4, "expandtab": true }, "javascriptreact": { "level": 4, "expandtab": true }, "js": { "level": 4, "expandtab": true }, "jsx": { "level": 4, "expandtab": true }, "latex": { "level": 2, "expandtab": true }, "lua": { "level": 4, "expandtab": true }, "make": { "level": 4, "expandtab": false }, "markdown": { "level": 2, "expandtab": true }, "md": { "level": 2, "expandtab": true }, "mk": { "level": 4, "expandtab": false }, "py": { "level": 4, "expandtab": true }, "pyi": { "level": 4, "expandtab": true }, "python": { "level": 4, "expandtab": true }, "rb": { "level": 2, "expandtab": true }, "rs": { "level": 4, "expandtab": true }, "ruby": { "level": 2, "expandtab": true }, "rust": { "level": 4, "expandtab": true }, "sh": { "level": 4, "expandtab": true }, "tex": { "level": 2, "expandtab": true }, "toml": { "level": 4, "expandtab": true }, "ts": { "level": 4, "expandtab": true }, "tsx": { "level": 4, "expandtab": true }, "typescript": { "level": 4, "expandtab": true }, "typescriptreact": { "level": 4, "expandtab": true }, "xhtml": { "level": 2, "expandtab": true }, "xml": { "level": 2, "expandtab": true }, "yaml": { "level": 2, "expandtab": true }, "yml": { "level": 2, "expandtab": true }, "zsh": { "level": 4, "expandtab": true } }]
|
|
@@ -13,22 +13,22 @@ from io import TextIOWrapper
|
|
|
13
13
|
from os.path import exists, isdir, realpath
|
|
14
14
|
from typing import Dict, Iterator, List, NoReturn, Tuple
|
|
15
15
|
|
|
16
|
+
from ..types import IndentMap
|
|
16
17
|
from ..util import die
|
|
17
|
-
from .types import GeneratedEOFComments, IndentMapDict
|
|
18
18
|
|
|
19
19
|
_JSON_FILE: str = realpath("./vim_eof_comment/comments/filetypes.json")
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
def import_json() -> Tuple[
|
|
22
|
+
def import_json() -> Tuple[Dict[str, str], Dict[str, IndentMap]]:
|
|
23
23
|
"""
|
|
24
24
|
Import default vars from JSON file.
|
|
25
25
|
|
|
26
26
|
Returns
|
|
27
27
|
-------
|
|
28
|
-
comments :
|
|
29
|
-
The default ``
|
|
30
|
-
map_dict :
|
|
31
|
-
The default
|
|
28
|
+
comments : Dict[str, str]
|
|
29
|
+
The default ``Dict[str, str]``.
|
|
30
|
+
map_dict : Dict[str, IndentMap]
|
|
31
|
+
The default indent mappings dict.
|
|
32
32
|
"""
|
|
33
33
|
splitter: str = "/" if os.name != "nt" else "\\"
|
|
34
34
|
split = __file__.split(splitter)
|
|
@@ -39,7 +39,7 @@ def import_json() -> Tuple[GeneratedEOFComments, IndentMapDict]:
|
|
|
39
39
|
data: str = "".join(file.read().split("\n"))
|
|
40
40
|
file.close()
|
|
41
41
|
|
|
42
|
-
result: Tuple[
|
|
42
|
+
result: Tuple[Dict[str, str], Dict[str, IndentMap]] = json.loads(data)
|
|
43
43
|
|
|
44
44
|
return result[0], result[1]
|
|
45
45
|
|
|
@@ -53,18 +53,18 @@ class Comments():
|
|
|
53
53
|
|
|
54
54
|
Parameters
|
|
55
55
|
----------
|
|
56
|
-
mappings :
|
|
56
|
+
mappings : Dict[str, IndentMap], optional, default=None
|
|
57
57
|
The ``str`` to ``IndentMap`` dictionary.
|
|
58
58
|
|
|
59
59
|
Attributes
|
|
60
60
|
----------
|
|
61
|
-
__DEFAULT :
|
|
61
|
+
__DEFAULT : Dict[str, IndentMap]
|
|
62
62
|
The default/fallback alternative to ``langs``.
|
|
63
|
-
__formats :
|
|
63
|
+
__formats : Dict[str, str]
|
|
64
64
|
The default/fallback alternative to ``comments``.
|
|
65
|
-
langs :
|
|
65
|
+
langs : Dict[str, IndentMap]
|
|
66
66
|
A dictionary of ``IndentMap`` type objects.
|
|
67
|
-
comments :
|
|
67
|
+
comments : Dict[str, str]
|
|
68
68
|
A dictionary of file-extension-to-EOF-comment mappings.
|
|
69
69
|
|
|
70
70
|
Methods
|
|
@@ -74,18 +74,18 @@ class Comments():
|
|
|
74
74
|
get_defaults()
|
|
75
75
|
"""
|
|
76
76
|
|
|
77
|
-
__DEFAULT:
|
|
78
|
-
__formats:
|
|
79
|
-
comments:
|
|
80
|
-
langs:
|
|
77
|
+
__DEFAULT: Dict[str, IndentMap] = _DEFAULT.copy()
|
|
78
|
+
__formats: Dict[str, str] = _formats.copy()
|
|
79
|
+
comments: Dict[str, str]
|
|
80
|
+
langs: Dict[str, IndentMap]
|
|
81
81
|
|
|
82
|
-
def __init__(self, mappings:
|
|
82
|
+
def __init__(self, mappings: Dict[str, IndentMap] | None = None):
|
|
83
83
|
"""
|
|
84
84
|
Create a new Vim EOF comment object.
|
|
85
85
|
|
|
86
86
|
Parameters
|
|
87
87
|
----------
|
|
88
|
-
mappings :
|
|
88
|
+
mappings : Dict[str, IndentMap], optional, default=None
|
|
89
89
|
The ``str`` to ``IndentMap`` dictionary.
|
|
90
90
|
"""
|
|
91
91
|
if mappings is None or len(mappings) == 0:
|
|
@@ -126,13 +126,13 @@ class Comments():
|
|
|
126
126
|
"""
|
|
127
127
|
return lang in self.__DEFAULT.keys()
|
|
128
128
|
|
|
129
|
-
def __fill_langs(self, langs:
|
|
129
|
+
def __fill_langs(self, langs: Dict[str, IndentMap]) -> NoReturn:
|
|
130
130
|
"""
|
|
131
131
|
Fill languages dict.
|
|
132
132
|
|
|
133
133
|
Parameters
|
|
134
134
|
----------
|
|
135
|
-
langs :
|
|
135
|
+
langs : Dict[str, IndentMap]
|
|
136
136
|
A dictionary of ``IndentMap`` type objects.
|
|
137
137
|
"""
|
|
138
138
|
if len(langs) == 0:
|
|
@@ -142,26 +142,26 @@ class Comments():
|
|
|
142
142
|
for lang, mapping in self.__DEFAULT.items():
|
|
143
143
|
langs[lang] = langs.get(lang, mapping)
|
|
144
144
|
|
|
145
|
-
self.langs =
|
|
145
|
+
self.langs = langs.copy()
|
|
146
146
|
|
|
147
|
-
def get_defaults(self) ->
|
|
147
|
+
def get_defaults(self) -> Dict[str, IndentMap]:
|
|
148
148
|
"""
|
|
149
149
|
Retrieve the default comment dictionary.
|
|
150
150
|
|
|
151
151
|
Returns
|
|
152
152
|
-------
|
|
153
|
-
|
|
153
|
+
Dict[str, IndentMap]
|
|
154
154
|
A dictionary of ``IndentMap`` type objects.
|
|
155
155
|
"""
|
|
156
156
|
return self.__DEFAULT
|
|
157
157
|
|
|
158
|
-
def generate(self) ->
|
|
158
|
+
def generate(self) -> Dict[str, str]:
|
|
159
159
|
"""
|
|
160
160
|
Generate the comments list.
|
|
161
161
|
|
|
162
162
|
Returns
|
|
163
163
|
-------
|
|
164
|
-
|
|
164
|
+
Dict[str, str]
|
|
165
165
|
The customly generated comments dictionary.
|
|
166
166
|
"""
|
|
167
167
|
comments: Dict[str, str] = dict()
|
|
@@ -174,7 +174,7 @@ class Comments():
|
|
|
174
174
|
|
|
175
175
|
comments[lang] = fmt.format(ts=lvl, sts=lvl, sw=sw, et=et)
|
|
176
176
|
|
|
177
|
-
self.comments:
|
|
177
|
+
self.comments: Dict[str, str] = comments.copy()
|
|
178
178
|
return self.comments
|
|
179
179
|
|
|
180
180
|
def get_ft(self, ext: str) -> str | None:
|
|
@@ -191,7 +191,7 @@ class Comments():
|
|
|
191
191
|
str or None
|
|
192
192
|
Either the file extension string, or if not available then ``None``.
|
|
193
193
|
"""
|
|
194
|
-
comments:
|
|
194
|
+
comments: Dict[str, str] = self.generate()
|
|
195
195
|
return comments.get(ext, None)
|
|
196
196
|
|
|
197
197
|
|
|
@@ -200,7 +200,7 @@ def list_filetypes() -> NoReturn:
|
|
|
200
200
|
txt: List[str] = [""]
|
|
201
201
|
|
|
202
202
|
c: Comments = Comments()
|
|
203
|
-
defaults:
|
|
203
|
+
defaults: Dict[str, IndentMap] = c.get_defaults()
|
|
204
204
|
for ext, indents in defaults.items():
|
|
205
205
|
txt.append(f"- {ext}: {indents}")
|
|
206
206
|
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
from typing import Iterator, NoReturn
|
|
2
2
|
|
|
3
|
-
from
|
|
3
|
+
from ..types import IndentMap
|
|
4
4
|
|
|
5
5
|
__all__ = ['Comments', 'export_json', 'import_json', 'list_filetypes']
|
|
6
6
|
|
|
7
|
-
def import_json() -> tuple[
|
|
7
|
+
def import_json() -> tuple[dict[str, str], dict[str, IndentMap]]:
|
|
8
8
|
"""
|
|
9
9
|
Import default vars from JSON file.
|
|
10
10
|
|
|
11
11
|
Returns
|
|
12
12
|
-------
|
|
13
|
-
comments :
|
|
14
|
-
The default ``
|
|
15
|
-
map_dict :
|
|
16
|
-
The default
|
|
13
|
+
comments : Dict[str, str]
|
|
14
|
+
The default ``Dict[str, str]``.
|
|
15
|
+
map_dict : Dict[str, IndentMap]
|
|
16
|
+
The default indent mappings dict.
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
19
|
class Comments:
|
|
@@ -22,18 +22,18 @@ class Comments:
|
|
|
22
22
|
|
|
23
23
|
Parameters
|
|
24
24
|
----------
|
|
25
|
-
mappings :
|
|
25
|
+
mappings : Dict[str, IndentMap], optional, default=None
|
|
26
26
|
The ``str`` to ``IndentMap`` dictionary.
|
|
27
27
|
|
|
28
28
|
Attributes
|
|
29
29
|
----------
|
|
30
|
-
__DEFAULT :
|
|
30
|
+
__DEFAULT : Dict[str, IndentMap]
|
|
31
31
|
The default/fallback alternative to ``langs``.
|
|
32
|
-
__formats :
|
|
32
|
+
__formats : Dict[str, str]
|
|
33
33
|
The default/fallback alternative to ``comments``.
|
|
34
|
-
langs :
|
|
34
|
+
langs : Dict[str, IndentMap]
|
|
35
35
|
A dictionary of ``IndentMap`` type objects.
|
|
36
|
-
comments :
|
|
36
|
+
comments : Dict[str, str]
|
|
37
37
|
A dictionary of file-extension-to-EOF-comment mappings.
|
|
38
38
|
|
|
39
39
|
Methods
|
|
@@ -42,17 +42,17 @@ class Comments:
|
|
|
42
42
|
__fill_langs(langs)
|
|
43
43
|
get_defaults()
|
|
44
44
|
"""
|
|
45
|
-
__DEFAULT:
|
|
46
|
-
__formats:
|
|
47
|
-
comments:
|
|
48
|
-
langs:
|
|
49
|
-
def __init__(self, mappings:
|
|
45
|
+
__DEFAULT: dict[str, IndentMap]
|
|
46
|
+
__formats: dict[str, str]
|
|
47
|
+
comments: dict[str, str]
|
|
48
|
+
langs: dict[str, IndentMap]
|
|
49
|
+
def __init__(self, mappings: dict[str, IndentMap] | None = None) -> None:
|
|
50
50
|
"""
|
|
51
51
|
Create a new Vim EOF comment object.
|
|
52
52
|
|
|
53
53
|
Parameters
|
|
54
54
|
----------
|
|
55
|
-
mappings :
|
|
55
|
+
mappings : Dict[str, IndentMap], optional, default=None
|
|
56
56
|
The ``str`` to ``IndentMap`` dictionary.
|
|
57
57
|
"""
|
|
58
58
|
def __iter__(self) -> Iterator[str]:
|
|
@@ -71,31 +71,31 @@ class Comments:
|
|
|
71
71
|
bool
|
|
72
72
|
Represents whether the file extension has been included in the defaults.
|
|
73
73
|
"""
|
|
74
|
-
def __fill_langs(self, langs:
|
|
74
|
+
def __fill_langs(self, langs: dict[str, IndentMap]) -> NoReturn:
|
|
75
75
|
"""
|
|
76
76
|
Fill languages dict.
|
|
77
77
|
|
|
78
78
|
Parameters
|
|
79
79
|
----------
|
|
80
|
-
langs :
|
|
80
|
+
langs : Dict[str, IndentMap]
|
|
81
81
|
A dictionary of ``IndentMap`` type objects.
|
|
82
82
|
"""
|
|
83
|
-
def get_defaults(self) ->
|
|
83
|
+
def get_defaults(self) -> dict[str, IndentMap]:
|
|
84
84
|
"""
|
|
85
85
|
Retrieve the default comment dictionary.
|
|
86
86
|
|
|
87
87
|
Returns
|
|
88
88
|
-------
|
|
89
|
-
|
|
89
|
+
Dict[str, IndentMap]
|
|
90
90
|
A dictionary of ``IndentMap`` type objects.
|
|
91
91
|
"""
|
|
92
|
-
def generate(self) ->
|
|
92
|
+
def generate(self) -> dict[str, str]:
|
|
93
93
|
"""
|
|
94
94
|
Generate the comments list.
|
|
95
95
|
|
|
96
96
|
Returns
|
|
97
97
|
-------
|
|
98
|
-
|
|
98
|
+
Dict[str, str]
|
|
99
99
|
The customly generated comments dictionary.
|
|
100
100
|
"""
|
|
101
101
|
def get_ft(self, ext: str) -> str | None:
|
vim_eof_comment/eof.py
CHANGED
|
@@ -20,7 +20,7 @@ from .file import bootstrap_paths, get_last_line, modify_file, open_batch_paths
|
|
|
20
20
|
from .regex import matches
|
|
21
21
|
from .types import BatchPathDict, EOFCommentSearch, IndentHandler, IOWrapperBool
|
|
22
22
|
from .util import die, gen_indent_maps, verbose_print, version_print
|
|
23
|
-
from .version import
|
|
23
|
+
from .version import __version__, list_versions
|
|
24
24
|
|
|
25
25
|
_RED: int = Fore.LIGHTRED_EX
|
|
26
26
|
_GREEN: int = Fore.LIGHTGREEN_EX
|
|
@@ -41,7 +41,7 @@ def eof_comment_search(
|
|
|
41
41
|
files : Dict[str, BatchPathDict]
|
|
42
42
|
A dictionary of ``str`` to ``BatchPathDict`` objects.
|
|
43
43
|
comments : Comments
|
|
44
|
-
The ``Comments`` object containing the hardcoded comments per file
|
|
44
|
+
The ``Comments`` object containing the hardcoded comments per file-type/file-extension.
|
|
45
45
|
**kwargs
|
|
46
46
|
COntains the ``verbose`` and ``newline`` boolean options.
|
|
47
47
|
|
|
@@ -68,7 +68,7 @@ def eof_comment_search(
|
|
|
68
68
|
verbose_print(f"{_RESET}Analyzing files...\n", verbose=verbose)
|
|
69
69
|
for path, file in files.items():
|
|
70
70
|
file_obj: TextIOWrapper = file["file"]
|
|
71
|
-
ext: str = file["
|
|
71
|
+
ext: str = file["ft_ext"]
|
|
72
72
|
|
|
73
73
|
wrapper = get_last_line(file_obj)
|
|
74
74
|
last_line, has_nwl = wrapper["line"], wrapper["has_nwl"]
|
|
@@ -139,7 +139,7 @@ def main() -> int:
|
|
|
139
139
|
parser, ns = arg_parser_init()
|
|
140
140
|
|
|
141
141
|
if ns.version:
|
|
142
|
-
version_print(
|
|
142
|
+
version_print(__version__)
|
|
143
143
|
|
|
144
144
|
if ns.list_fts:
|
|
145
145
|
list_filetypes()
|
|
@@ -161,15 +161,12 @@ def main() -> int:
|
|
|
161
161
|
if dry_run:
|
|
162
162
|
verbose = True
|
|
163
163
|
|
|
164
|
-
indent = gen_indent_maps(indent.copy())
|
|
165
|
-
|
|
166
|
-
comments = Comments(indent)
|
|
167
|
-
|
|
168
164
|
files = open_batch_paths(bootstrap_paths(dirs, exts))
|
|
169
165
|
if len(files) == 0:
|
|
170
166
|
code = 1 if not dry_run else 0
|
|
171
167
|
die("No matching files found!", code=code)
|
|
172
168
|
|
|
169
|
+
comments = Comments(gen_indent_maps(indent.copy()))
|
|
173
170
|
results = eof_comment_search(files, comments, verbose=verbose, newline=newline)
|
|
174
171
|
if len(results) > 0 and not dry_run:
|
|
175
172
|
append_eof_comment(results, comments, newline)
|
vim_eof_comment/eof.pyi
CHANGED
|
@@ -14,7 +14,7 @@ def eof_comment_search(files: dict[str, BatchPathDict], comments: Comments, **kw
|
|
|
14
14
|
files : Dict[str, BatchPathDict]
|
|
15
15
|
A dictionary of ``str`` to ``BatchPathDict`` objects.
|
|
16
16
|
comments : Comments
|
|
17
|
-
The ``Comments`` object containing the hardcoded comments per file
|
|
17
|
+
The ``Comments`` object containing the hardcoded comments per file-type/file-extension.
|
|
18
18
|
**kwargs
|
|
19
19
|
COntains the ``verbose`` and ``newline`` boolean options.
|
|
20
20
|
|
vim_eof_comment/file.py
CHANGED
|
@@ -44,7 +44,7 @@ def bootstrap_paths(paths: List[str], exts: List[str]) -> List[BatchPairDict]:
|
|
|
44
44
|
if not file.endswith(ext):
|
|
45
45
|
continue
|
|
46
46
|
|
|
47
|
-
result.append(BatchPairDict(fpath=join(root, file),
|
|
47
|
+
result.append(BatchPairDict(fpath=join(root, file), ft_ext=ext))
|
|
48
48
|
|
|
49
49
|
return result
|
|
50
50
|
|
|
@@ -65,9 +65,9 @@ def open_batch_paths(paths: List[BatchPairDict]) -> Dict[str, BatchPathDict]:
|
|
|
65
65
|
"""
|
|
66
66
|
result = dict()
|
|
67
67
|
for path in paths:
|
|
68
|
-
fpath, ext = path["fpath"], path["
|
|
68
|
+
fpath, ext = path["fpath"], path["ft_ext"]
|
|
69
69
|
try:
|
|
70
|
-
result[fpath] = {"file": open(fpath, "r"), "
|
|
70
|
+
result[fpath] = {"file": open(fpath, "r"), "ft_ext": ext}
|
|
71
71
|
except KeyboardInterrupt:
|
|
72
72
|
die("\nProgram interrupted!", code=1) # Kills the program
|
|
73
73
|
except FileNotFoundError:
|
|
@@ -89,7 +89,7 @@ def modify_file(file: TextIOWrapper, comments: Dict[str, str], ext: str, **kwarg
|
|
|
89
89
|
comments : Dict[str, str]
|
|
90
90
|
A filetype-to-comment dictionary.
|
|
91
91
|
ext : str
|
|
92
|
-
The
|
|
92
|
+
The file-type/file-extension given by the user.
|
|
93
93
|
**kwargs
|
|
94
94
|
Contains the ``newline``, and ``matching`` boolean attributes.
|
|
95
95
|
|
vim_eof_comment/file.pyi
CHANGED
|
@@ -45,7 +45,7 @@ def modify_file(file: TextIOWrapper, comments: dict[str, str], ext: str, **kwarg
|
|
|
45
45
|
comments : Dict[str, str]
|
|
46
46
|
A filetype-to-comment dictionary.
|
|
47
47
|
ext : str
|
|
48
|
-
The
|
|
48
|
+
The file-type/file-extension given by the user.
|
|
49
49
|
**kwargs
|
|
50
50
|
Contains the ``newline``, and ``matching`` boolean attributes.
|
|
51
51
|
|
vim_eof_comment/types.py
CHANGED
|
@@ -67,19 +67,19 @@ class IndentMap(TypedDict):
|
|
|
67
67
|
|
|
68
68
|
class IndentHandler(TypedDict):
|
|
69
69
|
"""
|
|
70
|
-
A dict containing ``
|
|
70
|
+
A dict containing ``ft_ext``, ``level`` and ``expandtab`` as keys.
|
|
71
71
|
|
|
72
72
|
Attributes
|
|
73
73
|
----------
|
|
74
|
-
|
|
75
|
-
The file
|
|
74
|
+
ft_ext : str
|
|
75
|
+
The file-extension/file-type.
|
|
76
76
|
level : str
|
|
77
77
|
The string representation of the indent level.
|
|
78
78
|
expandtab : bool
|
|
79
79
|
Whether to expand tabs or not.
|
|
80
80
|
"""
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
ft_ext: str
|
|
83
83
|
level: str
|
|
84
84
|
expandtab: bool
|
|
85
85
|
|
|
@@ -102,14 +102,14 @@ class BatchPathDict(TypedDict):
|
|
|
102
102
|
"""A ``TypedDict`` container."""
|
|
103
103
|
|
|
104
104
|
file: TextIO
|
|
105
|
-
|
|
105
|
+
ft_ext: str
|
|
106
106
|
|
|
107
107
|
|
|
108
108
|
class BatchPairDict(TypedDict):
|
|
109
109
|
"""A ``TypedDict`` container."""
|
|
110
110
|
|
|
111
111
|
fpath: str
|
|
112
|
-
|
|
112
|
+
ft_ext: str
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
class EOFCommentSearch(TypedDict):
|
vim_eof_comment/types.pyi
CHANGED
|
@@ -43,18 +43,18 @@ class IndentMap(TypedDict):
|
|
|
43
43
|
|
|
44
44
|
class IndentHandler(TypedDict):
|
|
45
45
|
"""
|
|
46
|
-
A dict containing ``
|
|
46
|
+
A dict containing ``ft_ext``, ``level`` and ``expandtab`` as keys.
|
|
47
47
|
|
|
48
48
|
Attributes
|
|
49
49
|
----------
|
|
50
|
-
|
|
51
|
-
The file
|
|
50
|
+
ft_ext : str
|
|
51
|
+
The file-extension/file-type.
|
|
52
52
|
level : str
|
|
53
53
|
The string representation of the indent level.
|
|
54
54
|
expandtab : bool
|
|
55
55
|
Whether to expand tabs or not.
|
|
56
56
|
"""
|
|
57
|
-
|
|
57
|
+
ft_ext: str
|
|
58
58
|
level: str
|
|
59
59
|
expandtab: bool
|
|
60
60
|
|
|
@@ -71,12 +71,12 @@ class LineBool(TypedDict):
|
|
|
71
71
|
class BatchPathDict(TypedDict):
|
|
72
72
|
"""A ``TypedDict`` container."""
|
|
73
73
|
file: TextIO
|
|
74
|
-
|
|
74
|
+
ft_ext: str
|
|
75
75
|
|
|
76
76
|
class BatchPairDict(TypedDict):
|
|
77
77
|
"""A ``TypedDict`` container."""
|
|
78
78
|
fpath: str
|
|
79
|
-
|
|
79
|
+
ft_ext: str
|
|
80
80
|
|
|
81
81
|
class EOFCommentSearch(TypedDict):
|
|
82
82
|
"""A ``TypedDict`` container."""
|
vim_eof_comment/util.py
CHANGED
|
@@ -161,7 +161,7 @@ def gen_indent_maps(maps: List[IndentHandler]) -> Dict[str, IndentMap] | None:
|
|
|
161
161
|
if mapping_len <= 1:
|
|
162
162
|
raise ValueError(f"One of the custom mappings is not formatted properly! (`{mapping}`)")
|
|
163
163
|
|
|
164
|
-
ext, level = mapping["
|
|
164
|
+
ext, level = mapping["ft_ext"], mapping["level"]
|
|
165
165
|
if ext in map_d.keys():
|
|
166
166
|
continue
|
|
167
167
|
|
vim_eof_comment/version.py
CHANGED
|
@@ -5,7 +5,7 @@ Custom vim-eof-comment versioning objects.
|
|
|
5
5
|
|
|
6
6
|
Copyright (c) 2025 Guennadi Maximov C. All Rights Reserved.
|
|
7
7
|
"""
|
|
8
|
-
__all__ = ["VersionInfo", "list_versions", "version_info"]
|
|
8
|
+
__all__ = ["VersionInfo", "list_versions", "version_info", "__version__"]
|
|
9
9
|
|
|
10
10
|
from typing import List, NoReturn, Tuple
|
|
11
11
|
|
|
@@ -14,7 +14,7 @@ from .util import die
|
|
|
14
14
|
|
|
15
15
|
class VersionInfo():
|
|
16
16
|
"""
|
|
17
|
-
A sys
|
|
17
|
+
A ``sys.version_info``-like object type.
|
|
18
18
|
|
|
19
19
|
Parameters
|
|
20
20
|
----------
|
|
@@ -109,7 +109,7 @@ class VersionInfo():
|
|
|
109
109
|
Multiple definitions in constructor.
|
|
110
110
|
|
|
111
111
|
>>> from vim_eof_comment.version import VersionInfo
|
|
112
|
-
>>> print(VersionInfo([(0, 0, 1), (0, 0, 2)]))
|
|
112
|
+
>>> print(repr(VersionInfo([(0, 0, 1), (0, 0, 2)])))
|
|
113
113
|
0.0.2
|
|
114
114
|
"""
|
|
115
115
|
return self.__str__()
|
|
@@ -217,8 +217,11 @@ version_info: VersionInfo = VersionInfo([
|
|
|
217
217
|
(0, 3, 8),
|
|
218
218
|
(0, 3, 9),
|
|
219
219
|
(0, 3, 10),
|
|
220
|
+
(0, 3, 11),
|
|
220
221
|
])
|
|
221
222
|
|
|
223
|
+
__version__: str = str(version_info)
|
|
224
|
+
|
|
222
225
|
|
|
223
226
|
def list_versions() -> NoReturn:
|
|
224
227
|
"""List all versions."""
|
vim_eof_comment/version.pyi
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from typing import NoReturn
|
|
2
2
|
|
|
3
|
-
__all__ = ['VersionInfo', 'list_versions', 'version_info']
|
|
3
|
+
__all__ = ['VersionInfo', 'list_versions', 'version_info', '__version__']
|
|
4
4
|
|
|
5
5
|
class VersionInfo:
|
|
6
6
|
"""
|
|
7
|
-
A sys
|
|
7
|
+
A ``sys.version_info``-like object type.
|
|
8
8
|
|
|
9
9
|
Parameters
|
|
10
10
|
----------
|
|
@@ -88,7 +88,7 @@ class VersionInfo:
|
|
|
88
88
|
Multiple definitions in constructor.
|
|
89
89
|
|
|
90
90
|
>>> from vim_eof_comment.version import VersionInfo
|
|
91
|
-
>>> print(VersionInfo([(0, 0, 1), (0, 0, 2)]))
|
|
91
|
+
>>> print(repr(VersionInfo([(0, 0, 1), (0, 0, 2)])))
|
|
92
92
|
0.0.2
|
|
93
93
|
"""
|
|
94
94
|
def __eq__(self, b) -> bool:
|
|
@@ -125,6 +125,7 @@ class VersionInfo:
|
|
|
125
125
|
"""
|
|
126
126
|
|
|
127
127
|
version_info: VersionInfo
|
|
128
|
+
__version__: str
|
|
128
129
|
|
|
129
130
|
def list_versions() -> NoReturn:
|
|
130
131
|
"""List all versions."""
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: vim-eof-comment
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.11
|
|
4
4
|
Summary: Adds Vim EOF 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>
|
|
7
7
|
License-Expression: GPL-2.0-only
|
|
8
8
|
Project-URL: Issues, https://github.com/DrKJeff16/vim-eof-comment/issues
|
|
9
9
|
Project-URL: Repository, https://github.com/DrKJeff16/vim-eof-comment
|
|
10
|
-
|
|
10
|
+
Keywords: eof comments,eof,files,preprocessing,text,vim modeline,vim,vim-eof
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
12
|
Classifier: Environment :: Console
|
|
12
13
|
Classifier: Intended Audience :: Developers
|
|
13
14
|
Classifier: Intended Audience :: End Users/Desktop
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
docs/Makefile,sha256=1rYkueTz6GC8AAF0rtOIJIv7sX-hMxVQBumHEqvbFEI,684
|
|
2
|
+
docs/make.bat,sha256=0qjrzODegavKd7LLwmr9ADhaYftiTnBgqOVAL9kApyo,769
|
|
3
|
+
docs/source/conf.py,sha256=QXm85HG5Ii0abjZRRRVPTYnMNAorgViYI0gy2xeMl50,1328
|
|
4
|
+
docs/source/functions.rst,sha256=erouYhzblZATxkA5yB6aUvF8baSvBcPQ9HwySWATTdI,20
|
|
5
|
+
docs/source/index.rst,sha256=4ga-scVigmQiruBFGUwXbYopcpv1JOFMNSPzeUegckU,450
|
|
6
|
+
docs/source/usage.rst,sha256=r5GDHkgDxB35f2Nn_N30wNKqwfQQXKOE66mdrqGHsuE,155
|
|
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=ZT87ltzdnQLMoKZ6sx1QwRdSMcfjkFVWFEe9gwPkmqY,5159
|
|
11
|
+
vim_eof_comment/eof.pyi,sha256=BTw9brhrHBTX12fYuwfO8_D-Gyrf0387ErmgrcTdvh0,1786
|
|
12
|
+
vim_eof_comment/file.py,sha256=o_bWoBRehRWwzCozO-9DDf7G5-dU92nm-5mX1CxvlW4,4182
|
|
13
|
+
vim_eof_comment/file.pyi,sha256=BWBtHbFkAdiNSRfe9SQBJvxtH3WHZfIgz03kFsIWX4w,1950
|
|
14
|
+
vim_eof_comment/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
|
+
vim_eof_comment/regex.py,sha256=LxL4gu1iwnsTEOTqE0XYrJPhbg2ooodUidrLKqg4lFs,974
|
|
16
|
+
vim_eof_comment/regex.pyi,sha256=p0eI_9fi2QOGdNnViOpYYdvN5hKPVDnVOYM0cU-W4hM,400
|
|
17
|
+
vim_eof_comment/types.py,sha256=Nlm4rMqKvBEgD5LAtoGM5YeGDuKrAFlxdWKoIpHe3qo,2393
|
|
18
|
+
vim_eof_comment/types.pyi,sha256=FYmDZ_aEFA4zKkgLKR7ItgOcTDdu6e0aazQ2X46wHMc,2123
|
|
19
|
+
vim_eof_comment/util.py,sha256=k2cCknGHnpitRRDMNkEYzuMbwMtZ1eqyr9okgZQDwyg,4461
|
|
20
|
+
vim_eof_comment/util.pyi,sha256=2o50NhjhYm0gLHkCcUXNvFNjWc6kP5Xuo0r_sngRg1U,2963
|
|
21
|
+
vim_eof_comment/version.py,sha256=6cxMyb9DatZhrMwGBetbf3PB5mHFko2KjH5i3CC6FdI,5441
|
|
22
|
+
vim_eof_comment/version.pyi,sha256=tFXP9Be8ChJLKy6MEiiTR9l-0bn5uJMYIOSrvn2LlMQ,3460
|
|
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=wnN9r5Y-t7r3As558_bAq2XzLqg-HTzR8_ufXU-9bpU,779
|
|
26
|
+
vim_eof_comment/args/completion.pyi,sha256=kB4X_7NaSIuPqL8zbcBszewyLh-evB-9TYfYLOjCU4A,408
|
|
27
|
+
vim_eof_comment/args/parsing.py,sha256=AOHLN-K0vzbXBwsOjUv4ZcXMDbF_BDEONonZJFwwazo,6617
|
|
28
|
+
vim_eof_comment/args/parsing.pyi,sha256=czQNpDTfgUCv1P_bxHykUD9WDn5A8tnz396TT7oEdkY,1745
|
|
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=cjKvqTx2TflOUWrYqD7vvPDJ7KpPaVr-HrNO3OHrBfA,4736
|
|
32
|
+
vim_eof_comment/comments/generator.py,sha256=lJ8Ux922JebBk-6BjC8ZlkmpXuN-ZeGP6g25EEusvIk,6407
|
|
33
|
+
vim_eof_comment/comments/generator.pyi,sha256=Nj33jwria5FWUuydUD_uZSH__PxSZ3yPxOPYF1_TIpM,3272
|
|
34
|
+
vim_eof_comment-0.3.11.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
|
35
|
+
vim_eof_comment-0.3.11.dist-info/METADATA,sha256=b67NO5g1nqcgVQH-qZTF31DtaCMKWbkr1EoLRH5rBOk,2616
|
|
36
|
+
vim_eof_comment-0.3.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
37
|
+
vim_eof_comment-0.3.11.dist-info/entry_points.txt,sha256=vm47g4hoUbow4elcHr9yylYfj6IvAs10wSFKqwqTu6E,61
|
|
38
|
+
vim_eof_comment-0.3.11.dist-info/top_level.txt,sha256=TkaQ5vuhVzXaJnfUdcLJCQ81ILK2V6OtvX5-hIMZAc0,21
|
|
39
|
+
vim_eof_comment-0.3.11.dist-info/RECORD,,
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Copyright (c) 2025 Guennadi Maximov C. All Rights Reserved.
|
|
3
|
-
"""
|
|
4
|
-
Per-filetype modeline comment class.
|
|
5
|
-
|
|
6
|
-
Copyright (c) 2025 Guennadi Maximov C. All Rights Reserved.
|
|
7
|
-
"""
|
|
8
|
-
__all__ = ["GeneratedEOFComments", "IndentMapDict"]
|
|
9
|
-
|
|
10
|
-
from typing import TypedDict
|
|
11
|
-
|
|
12
|
-
from ..types import IndentMap
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class GeneratedEOFComments(TypedDict):
|
|
16
|
-
"""A ``TypedDict`` object containing all the file-extension to comment elements."""
|
|
17
|
-
|
|
18
|
-
C: str
|
|
19
|
-
H: str
|
|
20
|
-
Makefile: str
|
|
21
|
-
bash: str
|
|
22
|
-
c: str
|
|
23
|
-
cc: str
|
|
24
|
-
cpp: str
|
|
25
|
-
css: str
|
|
26
|
-
fish: str
|
|
27
|
-
h: str
|
|
28
|
-
hh: str
|
|
29
|
-
hpp: str
|
|
30
|
-
htm: str
|
|
31
|
-
html: str
|
|
32
|
-
latex: str
|
|
33
|
-
lua: str
|
|
34
|
-
markdown: str
|
|
35
|
-
md: str
|
|
36
|
-
mk: str
|
|
37
|
-
py: str
|
|
38
|
-
pyi: str
|
|
39
|
-
rb: str
|
|
40
|
-
sh: str
|
|
41
|
-
tex: str
|
|
42
|
-
xml: str
|
|
43
|
-
zsh: str
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
class IndentMapDict(TypedDict):
|
|
47
|
-
"""A ``TypedDict`` object with ``IndentMap`` values."""
|
|
48
|
-
|
|
49
|
-
C: IndentMap
|
|
50
|
-
H: IndentMap
|
|
51
|
-
Makefile: IndentMap
|
|
52
|
-
bash: IndentMap
|
|
53
|
-
c: IndentMap
|
|
54
|
-
cc: IndentMap
|
|
55
|
-
cpp: IndentMap
|
|
56
|
-
css: IndentMap
|
|
57
|
-
fish: IndentMap
|
|
58
|
-
h: IndentMap
|
|
59
|
-
hh: IndentMap
|
|
60
|
-
hpp: IndentMap
|
|
61
|
-
htm: IndentMap
|
|
62
|
-
html: IndentMap
|
|
63
|
-
latex: IndentMap
|
|
64
|
-
lua: IndentMap
|
|
65
|
-
markdown: IndentMap
|
|
66
|
-
md: IndentMap
|
|
67
|
-
mk: IndentMap
|
|
68
|
-
py: IndentMap
|
|
69
|
-
pyi: IndentMap
|
|
70
|
-
rb: IndentMap
|
|
71
|
-
sh: IndentMap
|
|
72
|
-
tex: IndentMap
|
|
73
|
-
xml: IndentMap
|
|
74
|
-
zsh: IndentMap
|
|
75
|
-
|
|
76
|
-
# vim: set ts=4 sts=4 sw=4 et ai si sta:
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
from typing import TypedDict
|
|
2
|
-
|
|
3
|
-
from ..types import IndentMap
|
|
4
|
-
|
|
5
|
-
__all__ = ['GeneratedEOFComments', 'IndentMapDict']
|
|
6
|
-
|
|
7
|
-
class GeneratedEOFComments(TypedDict):
|
|
8
|
-
"""A ``TypedDict`` object containing all the file-extension to comment elements."""
|
|
9
|
-
C: str
|
|
10
|
-
H: str
|
|
11
|
-
Makefile: str
|
|
12
|
-
bash: str
|
|
13
|
-
c: str
|
|
14
|
-
cc: str
|
|
15
|
-
cpp: str
|
|
16
|
-
css: str
|
|
17
|
-
fish: str
|
|
18
|
-
h: str
|
|
19
|
-
hh: str
|
|
20
|
-
hpp: str
|
|
21
|
-
htm: str
|
|
22
|
-
html: str
|
|
23
|
-
latex: str
|
|
24
|
-
lua: str
|
|
25
|
-
markdown: str
|
|
26
|
-
md: str
|
|
27
|
-
mk: str
|
|
28
|
-
py: str
|
|
29
|
-
pyi: str
|
|
30
|
-
rb: str
|
|
31
|
-
sh: str
|
|
32
|
-
tex: str
|
|
33
|
-
xml: str
|
|
34
|
-
zsh: str
|
|
35
|
-
|
|
36
|
-
class IndentMapDict(TypedDict):
|
|
37
|
-
"""A ``TypedDict`` object with ``IndentMap`` values."""
|
|
38
|
-
C: IndentMap
|
|
39
|
-
H: IndentMap
|
|
40
|
-
Makefile: IndentMap
|
|
41
|
-
bash: IndentMap
|
|
42
|
-
c: IndentMap
|
|
43
|
-
cc: IndentMap
|
|
44
|
-
cpp: IndentMap
|
|
45
|
-
css: IndentMap
|
|
46
|
-
fish: IndentMap
|
|
47
|
-
h: IndentMap
|
|
48
|
-
hh: IndentMap
|
|
49
|
-
hpp: IndentMap
|
|
50
|
-
htm: IndentMap
|
|
51
|
-
html: IndentMap
|
|
52
|
-
latex: IndentMap
|
|
53
|
-
lua: IndentMap
|
|
54
|
-
markdown: IndentMap
|
|
55
|
-
md: IndentMap
|
|
56
|
-
mk: IndentMap
|
|
57
|
-
py: IndentMap
|
|
58
|
-
pyi: IndentMap
|
|
59
|
-
rb: IndentMap
|
|
60
|
-
sh: IndentMap
|
|
61
|
-
tex: IndentMap
|
|
62
|
-
xml: IndentMap
|
|
63
|
-
zsh: IndentMap
|
|
64
|
-
|
|
65
|
-
# vim: set ts=4 sts=4 sw=4 et ai si sta:
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
vim_eof_comment/__init__.py,sha256=1-SmBIk-4U8WUjqO-2jJPfAbn-z52eN2sEQ3Zc0EUyo,523
|
|
2
|
-
vim_eof_comment/__init__.pyi,sha256=TX5r87Ycvr6Y1Zrbad4WJlSIZ4j4zyQAnSSfecEGLXk,443
|
|
3
|
-
vim_eof_comment/__main__.py,sha256=0AFVSkz8RuxSuPbJJWycyxs6u5Yypl8FKUMR3ZVLJbk,343
|
|
4
|
-
vim_eof_comment/eof.py,sha256=E5JN1-pDMtDpifp2tmJlFQtXPX2IkUgjB_Z-M1ImjXI,5175
|
|
5
|
-
vim_eof_comment/eof.pyi,sha256=KfSml7cAgJZ_cI66e9oa9jNffDXley9RVvY4vFF7Jos,1776
|
|
6
|
-
vim_eof_comment/file.py,sha256=1qKI3pDXEN2ZyhToOzuqYxjMMhOGZ_GsRTnHAbxy_Ys,4167
|
|
7
|
-
vim_eof_comment/file.pyi,sha256=H6S6Rtrd9UI_ZamEOWC3v3kHUsgI42Y1XimV4sWOlxQ,1944
|
|
8
|
-
vim_eof_comment/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
vim_eof_comment/regex.py,sha256=LxL4gu1iwnsTEOTqE0XYrJPhbg2ooodUidrLKqg4lFs,974
|
|
10
|
-
vim_eof_comment/regex.pyi,sha256=p0eI_9fi2QOGdNnViOpYYdvN5hKPVDnVOYM0cU-W4hM,400
|
|
11
|
-
vim_eof_comment/types.py,sha256=9OxxcLivpOdJ3Fxx408xs7CofPQDsuoyojzrbnJR7dE,2368
|
|
12
|
-
vim_eof_comment/types.pyi,sha256=lGRzHLMEoE94oSPf9UeRr-2wgoDvxQEe_4WmVW1OYSw,2098
|
|
13
|
-
vim_eof_comment/util.py,sha256=Sr8UXekdgO-HYov1xZZ0ZVBIVdWfj-1gylOu1iOxk2M,4458
|
|
14
|
-
vim_eof_comment/util.pyi,sha256=2o50NhjhYm0gLHkCcUXNvFNjWc6kP5Xuo0r_sngRg1U,2963
|
|
15
|
-
vim_eof_comment/version.py,sha256=L1uqZMUf_p4PveyfU4QZR8ejFJQ-WblX_4XEiAD2crM,5366
|
|
16
|
-
vim_eof_comment/version.pyi,sha256=SsD8IGkJwJNJsH53ofCieop9VfLlWu_4MnN5PKJ6uOo,3422
|
|
17
|
-
vim_eof_comment/args/__init__.py,sha256=Hyqun15456NVFLAJ3cpdtuNEz5XaFH93vfVlbC-aeuc,318
|
|
18
|
-
vim_eof_comment/args/__init__.pyi,sha256=cXK7nEpYBveD4kxtVTe2x8oUxT9mhENS5r3wK3AAX2U,151
|
|
19
|
-
vim_eof_comment/args/completion.py,sha256=wnN9r5Y-t7r3As558_bAq2XzLqg-HTzR8_ufXU-9bpU,779
|
|
20
|
-
vim_eof_comment/args/completion.pyi,sha256=kB4X_7NaSIuPqL8zbcBszewyLh-evB-9TYfYLOjCU4A,408
|
|
21
|
-
vim_eof_comment/args/parsing.py,sha256=LKfkCqhLXa-Wfvl_dK39doKaKq304xCDlT_xGOWcmqs,6614
|
|
22
|
-
vim_eof_comment/args/parsing.pyi,sha256=czQNpDTfgUCv1P_bxHykUD9WDn5A8tnz396TT7oEdkY,1745
|
|
23
|
-
vim_eof_comment/comments/__init__.py,sha256=zx6kpxjdhDjD2JVCwyGc1RNszXV7i4evVXxZ3fotty4,308
|
|
24
|
-
vim_eof_comment/comments/__init__.pyi,sha256=qpv02QY89Ow8sa8ekyjeWmT3fqqNhfPz7ITTUla-qws,142
|
|
25
|
-
vim_eof_comment/comments/filetypes.json,sha256=Dr8nMCTVb1n8cF5Oy6DggOe-_y5YuuKAOhjZE4Vd9_4,2757
|
|
26
|
-
vim_eof_comment/comments/generator.py,sha256=KCic09QBtmlRRFJ2aimwVNvP-1TUPhDQdeK3zlckNWg,6423
|
|
27
|
-
vim_eof_comment/comments/generator.pyi,sha256=HDWFJI9OwSwWI8BN28nnhFsR3NwL2Z_e0BEiMs07aa4,3257
|
|
28
|
-
vim_eof_comment/comments/types.py,sha256=WcBMIPha_ShrTYu-StRwHWmPTHHI5ahFu46psKR-ZtY,1404
|
|
29
|
-
vim_eof_comment/comments/types.pyi,sha256=kVEwSdMHBkmQU16VGRzDkm0smxBsaIE9YbG3SSJLA7E,1208
|
|
30
|
-
vim_eof_comment-0.3.10.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
|
|
31
|
-
vim_eof_comment-0.3.10.dist-info/METADATA,sha256=93LAjTg6QgsBhHUvc-Jm2nGOfHDEIM-ytAUKOcfyA4E,2540
|
|
32
|
-
vim_eof_comment-0.3.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
33
|
-
vim_eof_comment-0.3.10.dist-info/entry_points.txt,sha256=vm47g4hoUbow4elcHr9yylYfj6IvAs10wSFKqwqTu6E,61
|
|
34
|
-
vim_eof_comment-0.3.10.dist-info/top_level.txt,sha256=z493WRKeXW62WRGfjcNrcn73np4tFyZUWD1zXjMftbM,16
|
|
35
|
-
vim_eof_comment-0.3.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|