vim-eof-comment 0.5.2__tar.gz → 0.5.3__tar.gz

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.
Files changed (59) hide show
  1. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/PKG-INFO +1 -1
  2. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/pyproject.toml +1 -1
  3. vim_eof_comment-0.5.3/version.txt +1 -0
  4. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/eof.py +4 -5
  5. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/file.py +13 -14
  6. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/version.py +1 -0
  7. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment.egg-info/PKG-INFO +1 -1
  8. vim_eof_comment-0.5.2/version.txt +0 -1
  9. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/.flake8 +0 -0
  10. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/.gitattributes +0 -0
  11. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/.github/CODEOWNERS +0 -0
  12. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/.github/FUNDING.yml +0 -0
  13. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/.github/workflows/flake8-lint.yml +0 -0
  14. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/.github/workflows/mypy-lint.yml +0 -0
  15. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/.github/workflows/release.yml +0 -0
  16. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/.github/workflows/vim-eof-comment.yml +0 -0
  17. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/.pre-commit-config.yaml +0 -0
  18. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/CHANGELOG.md +0 -0
  19. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/LICENSE +0 -0
  20. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/Makefile +0 -0
  21. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/README.md +0 -0
  22. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/docs/Makefile +0 -0
  23. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/docs/make.bat +0 -0
  24. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/docs/source/conf.py +0 -0
  25. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/docs/source/functions.rst +0 -0
  26. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/docs/source/index.rst +0 -0
  27. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/docs/source/installation.rst +0 -0
  28. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/requirements.txt +0 -0
  29. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/setup.cfg +0 -0
  30. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/taplo.toml +0 -0
  31. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/__init__.py +0 -0
  32. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/__init__.pyi +0 -0
  33. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/__main__.py +0 -0
  34. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/args/__init__.py +0 -0
  35. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/args/__init__.pyi +0 -0
  36. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/args/completion.py +0 -0
  37. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/args/completion.pyi +0 -0
  38. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/args/parsing.py +0 -0
  39. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/args/parsing.pyi +0 -0
  40. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/comments/__init__.py +0 -0
  41. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/comments/__init__.pyi +0 -0
  42. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/comments/filetypes.json +0 -0
  43. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/comments/generator.py +0 -0
  44. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/comments/generator.pyi +0 -0
  45. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/eof.pyi +0 -0
  46. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/file.pyi +0 -0
  47. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/py.typed +0 -0
  48. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/regex.py +0 -0
  49. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/regex.pyi +0 -0
  50. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/types.py +0 -0
  51. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/types.pyi +0 -0
  52. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/util.py +0 -0
  53. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/util.pyi +0 -0
  54. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment/version.pyi +0 -0
  55. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment.egg-info/SOURCES.txt +0 -0
  56. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment.egg-info/dependency_links.txt +0 -0
  57. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment.egg-info/entry_points.txt +0 -0
  58. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment.egg-info/requires.txt +0 -0
  59. {vim_eof_comment-0.5.2 → vim_eof_comment-0.5.3}/vim_eof_comment.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vim-eof-comment
3
- Version: 0.5.2
3
+ Version: 0.5.3
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>
@@ -40,7 +40,7 @@ maintainers = [{ name = "Guennadi Maximov C", email = "g.maxc.fox@protonmail.com
40
40
  name = "vim-eof-comment"
41
41
  readme = "README.md"
42
42
  requires-python = ">=3.10"
43
- version = "0.5.2"
43
+ version = "0.5.3"
44
44
 
45
45
  [project.scripts]
46
46
  vim-eof-comment = "vim_eof_comment.eof:main"
@@ -0,0 +1 @@
1
+ 0.5.3
@@ -120,12 +120,11 @@ def append_eof_comment(
120
120
  ext=ext,
121
121
  newline=newline,
122
122
  had_nwl=had_nwl,
123
- matching=matching
123
+ matching=matching,
124
+ crlf=crlf
124
125
  )
125
- file_obj = open(path, "w")
126
-
127
- file_obj.write(txt)
128
- file_obj.close()
126
+ with open(path, "w") as file_obj:
127
+ file_obj.write(txt)
129
128
 
130
129
 
131
130
  def main() -> int:
@@ -148,27 +148,27 @@ def modify_file(file: TextIOWrapper, comments: Dict[str, str], ext: str, **kwarg
148
148
  newline: bool = kwargs.get("newline", False)
149
149
  crlf: bool = kwargs.get("crlf", False)
150
150
 
151
- bdata: str = file.read()
151
+ data: List[str] = file.read().split("\n")
152
152
  file.close()
153
153
 
154
- data: List[str] = bdata.split("\n")
154
+ if len(data) >= 1 and data[-1] != "":
155
+ data.append("")
156
+
155
157
  if crlf:
156
158
  data[-2] = ""
157
159
 
158
- data_len = len(data)
159
- comment = comments[ext]
160
- if data_len == 0:
161
- data = [comment, ""]
162
- elif data_len == 1:
160
+ if len(data) == 0:
161
+ data = [comments[ext], ""]
162
+ elif len(data) == 1:
163
163
  if matching:
164
- data = [comment, ""]
164
+ data = [comments[ext], ""]
165
165
  else:
166
- data.insert(0, comment)
167
- elif data_len >= 2:
166
+ data.insert(0, comments[ext])
167
+ elif len(data) >= 2:
168
168
  if matching:
169
- data[-2] = comment
169
+ data[-2] = comments[ext]
170
170
  else:
171
- data.insert(-1, comment)
171
+ data.insert(-1, comments[ext])
172
172
 
173
173
  if len(data) >= 3:
174
174
  if newline and data[-3] != "":
@@ -197,8 +197,7 @@ def get_last_line(file: TextIOWrapper) -> LineBool:
197
197
  LineBool
198
198
  An object containing both the last line in a string and a boolean indicating a newline.
199
199
  """
200
- bdata: str = file.read()
201
- data: List[str] = bdata.split("\n")
200
+ data: List[str] = file.read().split("\n")
202
201
  file.close()
203
202
 
204
203
  if data[-1] != "":
@@ -83,6 +83,7 @@ version_info = VersionInfo([
83
83
  (0, 5, 0),
84
84
  (0, 5, 1),
85
85
  (0, 5, 2),
86
+ (0, 5, 3),
86
87
  ])
87
88
 
88
89
  __version__: str = str(version_info)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vim-eof-comment
3
- Version: 0.5.2
3
+ Version: 0.5.3
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>
@@ -1 +0,0 @@
1
- 0.5.2
File without changes
File without changes