check-empty 4.1.0__tar.gz → 4.1.1__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.
- {check_empty-4.1.0 → check_empty-4.1.1}/PKG-INFO +16 -16
- {check_empty-4.1.0 → check_empty-4.1.1}/README.md +13 -13
- {check_empty-4.1.0 → check_empty-4.1.1}/check_empty/__init__.py +7 -3
- {check_empty-4.1.0 → check_empty-4.1.1}/check_empty/archives.py +3 -3
- {check_empty-4.1.0 → check_empty-4.1.1}/check_empty/constants.py +5 -5
- {check_empty-4.1.0 → check_empty-4.1.1}/pyproject.toml +21 -21
- {check_empty-4.1.0 → check_empty-4.1.1}/pyproject.toml.orig +15 -16
- {check_empty-4.1.0 → check_empty-4.1.1}/AUTHORS.md +0 -0
- {check_empty-4.1.0 → check_empty-4.1.1}/LICENSE +0 -0
- {check_empty-4.1.0 → check_empty-4.1.1}/check_empty/__main__.py +0 -0
- {check_empty-4.1.0 → check_empty-4.1.1}/check_empty/py.typed +0 -0
- {check_empty-4.1.0 → check_empty-4.1.1}/check_empty/reporter/__init__.py +0 -0
- {check_empty-4.1.0 → check_empty-4.1.1}/check_empty/reporter/abcdef.py +0 -0
- {check_empty-4.1.0 → check_empty-4.1.1}/check_empty/reporter/dct.py +0 -0
- {check_empty-4.1.0 → check_empty-4.1.1}/check_empty/reporter/exceptions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: check-empty
|
|
3
|
-
Version: 4.1.
|
|
3
|
+
Version: 4.1.1
|
|
4
4
|
Summary: Command-line utility, as well as a hook usable by the Python pre-commit framework, and a GitHub Action, to ensure that selected files are empty.
|
|
5
5
|
Keywords: check,command-line,empty,files,github-action,helper,hook,lightweight,pre-commit,prek,tool,utility
|
|
6
6
|
Author: Jonathan Dung
|
|
@@ -24,9 +24,9 @@ Classifier: Programming Language :: Python :: 3.16
|
|
|
24
24
|
Classifier: Programming Language :: Python :: Free Threading :: 3 - Stable
|
|
25
25
|
Classifier: Topic :: Utilities
|
|
26
26
|
Classifier: Typing :: Typed
|
|
27
|
-
Requires-Dist: py7zr==1.1.
|
|
27
|
+
Requires-Dist: py7zr==1.1.4 ; extra == '7z'
|
|
28
28
|
Requires-Dist: acefile==0.6.14 ; extra == 'ace'
|
|
29
|
-
Requires-Dist: check-empty[7z,ace,ar,lzh,rar]==4.1.
|
|
29
|
+
Requires-Dist: check-empty[7z,ace,ar,lzh,rar]==4.1.1 ; extra == 'all'
|
|
30
30
|
Requires-Dist: arpy==2.4.0 ; extra == 'ar'
|
|
31
31
|
Requires-Dist: lhafile==0.3.1 ; extra == 'lzh'
|
|
32
32
|
Requires-Dist: rarfile==4.5 ; extra == 'rar'
|
|
@@ -41,7 +41,7 @@ Provides-Extra: lzh
|
|
|
41
41
|
Provides-Extra: rar
|
|
42
42
|
Description-Content-Type: text/markdown
|
|
43
43
|
|
|
44
|
-
# [check-empty](https://pypi.org/project/check-empty/4.1.
|
|
44
|
+
# [check-empty](https://pypi.org/project/check-empty/4.1.1)
|
|
45
45
|
|
|
46
46
|
[](https://github.com/TheBSD/StandWithPalestine/blob/main/docs/README.md)
|
|
47
47
|
|
|
@@ -125,15 +125,15 @@ As a pre-commit hook:
|
|
|
125
125
|
# .pre-commit-config.yaml
|
|
126
126
|
repos:
|
|
127
127
|
- repo: https://github.com/jonathandung/check-empty
|
|
128
|
-
rev: v4.1.
|
|
128
|
+
rev: v4.1.1 # repository version
|
|
129
129
|
hooks:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
130
|
+
- id: check-empty # the hook
|
|
131
|
+
args: # example list of arguments
|
|
132
|
+
- -Q # flag to decrease output, applicable twice (shorthand for --quiet)
|
|
133
|
+
files: ^src/mylib/py\.typed|docs/\.nojekyll|static/\.gitkeep|some_dir/.*|.*\.lock$
|
|
134
|
+
# paths to files/directories to clear or keep empty as a single regular
|
|
135
|
+
# expression (as per the somewhat restrictive pre-commit config schema),
|
|
136
|
+
# relative to project root
|
|
137
137
|
```
|
|
138
138
|
|
|
139
139
|
equivalent in `prek.toml` format:
|
|
@@ -141,7 +141,7 @@ equivalent in `prek.toml` format:
|
|
|
141
141
|
```toml
|
|
142
142
|
[[repos]]
|
|
143
143
|
repo = "https://github.com/jonathandung/check-empty"
|
|
144
|
-
rev = "v4.1.
|
|
144
|
+
rev = "v4.1.1"
|
|
145
145
|
|
|
146
146
|
[[repos.hooks]]
|
|
147
147
|
id = "check-empty"
|
|
@@ -165,7 +165,7 @@ or (TOML 1.1+):
|
|
|
165
165
|
# using multiline inline tables
|
|
166
166
|
[[repos]]
|
|
167
167
|
repo = "https://github.com/jonathandung/check-empty"
|
|
168
|
-
rev = "v4.1.
|
|
168
|
+
rev = "v4.1.1"
|
|
169
169
|
hooks = [{
|
|
170
170
|
id = "check-empty",
|
|
171
171
|
args = ["-Q"],
|
|
@@ -185,11 +185,11 @@ As a GitHub Actions workflow step:
|
|
|
185
185
|
|
|
186
186
|
```yaml
|
|
187
187
|
steps:
|
|
188
|
-
- uses: jonathandung/check-empty@v4.1.
|
|
188
|
+
- uses: jonathandung/check-empty@v4.1.1 # the latest version on the GitHub Actions
|
|
189
189
|
# marketplace; this step will fail and subsequent jobs will not run if any file is
|
|
190
190
|
# not empty
|
|
191
191
|
with:
|
|
192
|
-
python-version: '3.
|
|
192
|
+
python-version: '3.15' # run the script on the latest stable Python version
|
|
193
193
|
filenames: |
|
|
194
194
|
src/mylib/py.typed
|
|
195
195
|
docs/.nojekyll
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# [check-empty](https://pypi.org/project/check-empty/4.1.
|
|
1
|
+
# [check-empty](https://pypi.org/project/check-empty/4.1.1)
|
|
2
2
|
|
|
3
3
|
[](https://github.com/TheBSD/StandWithPalestine/blob/main/docs/README.md)
|
|
4
4
|
|
|
@@ -82,15 +82,15 @@ As a pre-commit hook:
|
|
|
82
82
|
# .pre-commit-config.yaml
|
|
83
83
|
repos:
|
|
84
84
|
- repo: https://github.com/jonathandung/check-empty
|
|
85
|
-
rev: v4.1.
|
|
85
|
+
rev: v4.1.1 # repository version
|
|
86
86
|
hooks:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
- id: check-empty # the hook
|
|
88
|
+
args: # example list of arguments
|
|
89
|
+
- -Q # flag to decrease output, applicable twice (shorthand for --quiet)
|
|
90
|
+
files: ^src/mylib/py\.typed|docs/\.nojekyll|static/\.gitkeep|some_dir/.*|.*\.lock$
|
|
91
|
+
# paths to files/directories to clear or keep empty as a single regular
|
|
92
|
+
# expression (as per the somewhat restrictive pre-commit config schema),
|
|
93
|
+
# relative to project root
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
equivalent in `prek.toml` format:
|
|
@@ -98,7 +98,7 @@ equivalent in `prek.toml` format:
|
|
|
98
98
|
```toml
|
|
99
99
|
[[repos]]
|
|
100
100
|
repo = "https://github.com/jonathandung/check-empty"
|
|
101
|
-
rev = "v4.1.
|
|
101
|
+
rev = "v4.1.1"
|
|
102
102
|
|
|
103
103
|
[[repos.hooks]]
|
|
104
104
|
id = "check-empty"
|
|
@@ -122,7 +122,7 @@ or (TOML 1.1+):
|
|
|
122
122
|
# using multiline inline tables
|
|
123
123
|
[[repos]]
|
|
124
124
|
repo = "https://github.com/jonathandung/check-empty"
|
|
125
|
-
rev = "v4.1.
|
|
125
|
+
rev = "v4.1.1"
|
|
126
126
|
hooks = [{
|
|
127
127
|
id = "check-empty",
|
|
128
128
|
args = ["-Q"],
|
|
@@ -142,11 +142,11 @@ As a GitHub Actions workflow step:
|
|
|
142
142
|
|
|
143
143
|
```yaml
|
|
144
144
|
steps:
|
|
145
|
-
- uses: jonathandung/check-empty@v4.1.
|
|
145
|
+
- uses: jonathandung/check-empty@v4.1.1 # the latest version on the GitHub Actions
|
|
146
146
|
# marketplace; this step will fail and subsequent jobs will not run if any file is
|
|
147
147
|
# not empty
|
|
148
148
|
with:
|
|
149
|
-
python-version: '3.
|
|
149
|
+
python-version: '3.15' # run the script on the latest stable Python version
|
|
150
150
|
filenames: |
|
|
151
151
|
src/mylib/py.typed
|
|
152
152
|
docs/.nojekyll
|
|
@@ -10,7 +10,7 @@ from __future__ import annotations
|
|
|
10
10
|
from check_empty import constants, reporter
|
|
11
11
|
|
|
12
12
|
__all__ = ('Handler', 'check', 'default_reporter')
|
|
13
|
-
__version__ = '4.1.
|
|
13
|
+
__version__ = '4.1.1'
|
|
14
14
|
"""The version of the package."""
|
|
15
15
|
default_reporter: reporter.Reporter = reporter.Reporter()
|
|
16
16
|
"""The default reporter used by :func:`check`."""
|
|
@@ -319,8 +319,12 @@ def check(
|
|
|
319
319
|
t += s
|
|
320
320
|
if clear:
|
|
321
321
|
Handler(*i, a).o()
|
|
322
|
-
x, d
|
|
323
|
-
|
|
322
|
+
x, d, y, p = (
|
|
323
|
+
k[1] if z is None else len(z) - 1,
|
|
324
|
+
k[2] if w is None else len(w),
|
|
325
|
+
k[3] if r is None else len(r),
|
|
326
|
+
k[0] if b is None else len(b) - 1,
|
|
327
|
+
)
|
|
324
328
|
reporter.report(z, v, b, ra, r, w, x, y, d, p, n, t, verbosity, clear)
|
|
325
329
|
reporter.reset_out()
|
|
326
330
|
return reporter.calculate_result(*map(bool, (y, x and not may_not_exist, d)))
|
|
@@ -89,11 +89,11 @@ def purge_ar(a: Archive, g: int) -> None:
|
|
|
89
89
|
q = __import__('itertools').filterfalse(
|
|
90
90
|
AR_SKIP.__contains__, map(__import__('operator').attrgetter('name'), i)
|
|
91
91
|
)
|
|
92
|
-
|
|
92
|
+
__gnu(tuple(q), w) if i[0].type == g else __bsd(q, w)
|
|
93
93
|
os.replace(f.name, n)
|
|
94
94
|
|
|
95
95
|
|
|
96
|
-
def
|
|
96
|
+
def __bsd(q: Iterable[bytes], w: Callable[[bytes], int]) -> None:
|
|
97
97
|
"""Clear the contents of each file in a BSD .a, .ar or .lib archive."""
|
|
98
98
|
for m in q:
|
|
99
99
|
x = len(m)
|
|
@@ -101,7 +101,7 @@ def _bsd(q: Iterable[bytes], w: Callable[[bytes], int]) -> None:
|
|
|
101
101
|
w(AR_FS % (b'#1/%d' % x if b else m, x, m if b else b''))
|
|
102
102
|
|
|
103
103
|
|
|
104
|
-
def
|
|
104
|
+
def __gnu(q: tuple[bytes, ...], w: Callable[[bytes], int]) -> None:
|
|
105
105
|
"""Clear the contents of each file in a GNU .a, .ar or .lib archive."""
|
|
106
106
|
c, d = 0, {}
|
|
107
107
|
for m in q:
|
|
@@ -16,12 +16,12 @@ TYPE_CHECKING = False
|
|
|
16
16
|
if TYPE_CHECKING:
|
|
17
17
|
from typing import Final
|
|
18
18
|
TYPE_MASK: Final = 0xF000
|
|
19
|
-
"""The mask that extracts the type of a file from its mode bits
|
|
19
|
+
"""The mask that extracts the type of a file from its mode bits using bitwise and."""
|
|
20
20
|
S_IFDIR: Final = 0x4000
|
|
21
21
|
"""Equal to :data:`stat.S_IFDIR`."""
|
|
22
22
|
ENOENT: Final = 2
|
|
23
23
|
"""Equal to :data:`errno.ENOENT`."""
|
|
24
|
-
DIRFD_UNSUPPORTED: Final
|
|
24
|
+
DIRFD_UNSUPPORTED: Final = (
|
|
25
25
|
SystemError('got directory descriptor on Windows')
|
|
26
26
|
if os.name == 'nt'
|
|
27
27
|
else NotImplementedError('directory descriptors are not supported')
|
|
@@ -49,11 +49,11 @@ class RecurseInto(__import__('enum').IntFlag):
|
|
|
49
49
|
TYPICAL = 15
|
|
50
50
|
"""Recurse into the most common archive types, namely .zip, .tar, .7z, and .rar."""
|
|
51
51
|
AR = 16
|
|
52
|
-
"""Recurse into .a, .ar and .lib archives; requires
|
|
52
|
+
"""Recurse into .a, .ar and .lib archives; requires `arpy <https://github.com/onekey-sec/arpy>`__."""
|
|
53
53
|
LZH = 32
|
|
54
|
-
"""Recurse into .lzh and .lha archives; requires
|
|
54
|
+
"""Recurse into .lzh and .lha archives; requires `lhafile <https://github.com/FrodeSolheim/python-lhafile>`__."""
|
|
55
55
|
ACE = 64
|
|
56
|
-
"""Recurse into .ace archives; requires
|
|
56
|
+
"""Recurse into .ace archives; requires `acefile <https://apidoc.roe.ch/acefile/latest>`__."""
|
|
57
57
|
ALL = 127
|
|
58
58
|
"""Recurse into all archive types."""
|
|
59
59
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["uv_build>=0.13.
|
|
2
|
+
requires = ["uv_build>=0.13.7"]
|
|
3
3
|
build-backend = "uv_build"
|
|
4
4
|
|
|
5
5
|
[dependency-groups]
|
|
6
6
|
docs = [
|
|
7
7
|
"furo==2025.12.19",
|
|
8
|
-
"sphinx==9.
|
|
9
|
-
"sphinx-argparse-cli==1.
|
|
8
|
+
"sphinx==9.2.0",
|
|
9
|
+
"sphinx-argparse-cli==1.24.0",
|
|
10
10
|
"sphinx-copybutton==0.5.2",
|
|
11
|
-
"sphinx-lint==1.0.2",
|
|
12
11
|
"sphinx-notfound-page==1.1.0",
|
|
13
12
|
]
|
|
14
13
|
|
|
@@ -54,7 +53,7 @@ license-files = [
|
|
|
54
53
|
name = "check-empty"
|
|
55
54
|
readme = "README.md"
|
|
56
55
|
requires-python = ">=3.11"
|
|
57
|
-
version = "4.1.
|
|
56
|
+
version = "4.1.1"
|
|
58
57
|
|
|
59
58
|
[[project.authors]]
|
|
60
59
|
name = "Jonathan Dung"
|
|
@@ -65,9 +64,9 @@ name = "Jonathan Dung"
|
|
|
65
64
|
email = "jonathandung@yahoo.com"
|
|
66
65
|
|
|
67
66
|
[project.optional-dependencies]
|
|
68
|
-
7z = ["py7zr==1.1.
|
|
67
|
+
7z = ["py7zr==1.1.4"]
|
|
69
68
|
ace = ["acefile==0.6.14"]
|
|
70
|
-
all = ["check-empty[7z,ace,ar,lzh,rar]==4.1.
|
|
69
|
+
all = ["check-empty[7z,ace,ar,lzh,rar]==4.1.1"]
|
|
71
70
|
ar = ["arpy==2.4.0"]
|
|
72
71
|
lzh = ["lhafile==0.3.1"]
|
|
73
72
|
rar = ["rarfile==4.5"]
|
|
@@ -76,7 +75,7 @@ rar = ["rarfile==4.5"]
|
|
|
76
75
|
check-empty = "check_empty.__main__:main"
|
|
77
76
|
|
|
78
77
|
[tool.ruff]
|
|
79
|
-
required-version = ">=0.17.
|
|
78
|
+
required-version = ">=0.17.4"
|
|
80
79
|
target-version = "py311"
|
|
81
80
|
|
|
82
81
|
[tool.ruff.analyze]
|
|
@@ -133,17 +132,6 @@ combine-as-imports = true
|
|
|
133
132
|
[tool.ruff.lint.pydocstyle]
|
|
134
133
|
convention = "google"
|
|
135
134
|
|
|
136
|
-
[tool.ty.analysis]
|
|
137
|
-
respect-type-ignore-comments = false
|
|
138
|
-
|
|
139
|
-
[tool.ty.environment]
|
|
140
|
-
python-version = "3.11"
|
|
141
|
-
python-platform = "all"
|
|
142
|
-
|
|
143
|
-
[tool.ty.rules]
|
|
144
|
-
all = "error"
|
|
145
|
-
missing-override-decorator = "ignore"
|
|
146
|
-
|
|
147
135
|
[[tool.ty.overrides]]
|
|
148
136
|
include = ["check_empty/__init__.py"]
|
|
149
137
|
|
|
@@ -158,12 +146,24 @@ include = ["check_empty/reporter/exceptions.py"]
|
|
|
158
146
|
[tool.ty.overrides.rules]
|
|
159
147
|
invalid-mutable-override = "ignore"
|
|
160
148
|
|
|
149
|
+
[tool.ty.analysis]
|
|
150
|
+
respect-type-ignore-comments = false
|
|
151
|
+
|
|
152
|
+
[tool.ty.environment]
|
|
153
|
+
python-version = "3.11"
|
|
154
|
+
python-platform = "all"
|
|
155
|
+
|
|
156
|
+
[tool.ty.rules]
|
|
157
|
+
all = "error"
|
|
158
|
+
missing-override-decorator = "ignore"
|
|
159
|
+
|
|
161
160
|
[tool.uv]
|
|
162
|
-
|
|
161
|
+
preview = true
|
|
162
|
+
required-version = ">=0.13.7"
|
|
163
163
|
|
|
164
164
|
[tool.uv.build-backend]
|
|
165
165
|
module-name = "check_empty"
|
|
166
166
|
module-root = ""
|
|
167
167
|
|
|
168
168
|
[tool.uv.dependency-groups.docs]
|
|
169
|
-
requires-python = ">=3.
|
|
169
|
+
requires-python = ">=3.13"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["uv_build>=0.13.
|
|
2
|
+
requires = ["uv_build>=0.13.7"]
|
|
3
3
|
build-backend = "uv_build"
|
|
4
4
|
|
|
5
5
|
[dependency-groups]
|
|
6
|
-
docs = ["furo==2025.12.19", "sphinx==9.
|
|
6
|
+
docs = ["furo==2025.12.19", "sphinx==9.2.0", "sphinx-argparse-cli==1.24.0", "sphinx-copybutton==0.5.2", "sphinx-notfound-page==1.1.0"]
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
authors = [{name = "Jonathan Dung", email = "jonathandung@yahoo.com"}]
|
|
@@ -16,12 +16,12 @@ maintainers = [{name = "Jonathan Dung", email = "jonathandung@yahoo.com"}]
|
|
|
16
16
|
name = "check-empty"
|
|
17
17
|
readme = "README.md"
|
|
18
18
|
requires-python = ">=3.11"
|
|
19
|
-
version = "4.1.
|
|
19
|
+
version = "4.1.1"
|
|
20
20
|
|
|
21
21
|
[project.optional-dependencies]
|
|
22
|
-
"7z" = ["py7zr==1.1.
|
|
22
|
+
"7z" = ["py7zr==1.1.4"]
|
|
23
23
|
ace = ["acefile==0.6.14"]
|
|
24
|
-
all = ["check-empty[7z,ace,ar,lzh,rar]==4.1.
|
|
24
|
+
all = ["check-empty[7z,ace,ar,lzh,rar]==4.1.1"]
|
|
25
25
|
ar = ["arpy==2.4.0"]
|
|
26
26
|
lzh = ["lhafile==0.3.1"]
|
|
27
27
|
rar = ["rarfile==4.5"]
|
|
@@ -30,7 +30,7 @@ rar = ["rarfile==4.5"]
|
|
|
30
30
|
check-empty = "check_empty.__main__:main"
|
|
31
31
|
|
|
32
32
|
[tool.ruff]
|
|
33
|
-
required-version = ">=0.17.
|
|
33
|
+
required-version = ">=0.17.4"
|
|
34
34
|
target-version = "py311"
|
|
35
35
|
|
|
36
36
|
[tool.ruff.analyze]
|
|
@@ -66,6 +66,12 @@ combine-as-imports = true
|
|
|
66
66
|
[tool.ruff.lint.pydocstyle]
|
|
67
67
|
convention = "google"
|
|
68
68
|
|
|
69
|
+
[tool.ty]
|
|
70
|
+
overrides = [
|
|
71
|
+
{include = ["check_empty/__init__.py"], rules = {possibly-unresolved-reference = "ignore", redundant-condition = "ignore", unsound-assignment = "ignore"}},
|
|
72
|
+
{include = ["check_empty/reporter/exceptions.py"], rules = {invalid-mutable-override = "ignore"}}
|
|
73
|
+
]
|
|
74
|
+
|
|
69
75
|
[tool.ty.analysis]
|
|
70
76
|
respect-type-ignore-comments = false
|
|
71
77
|
|
|
@@ -77,20 +83,13 @@ python-platform = "all"
|
|
|
77
83
|
all = "error"
|
|
78
84
|
missing-override-decorator = "ignore"
|
|
79
85
|
|
|
80
|
-
[[tool.ty.overrides]]
|
|
81
|
-
include = ["check_empty/__init__.py"]
|
|
82
|
-
rules = {possibly-unresolved-reference = "ignore", redundant-condition = "ignore", unsound-assignment = "ignore"}
|
|
83
|
-
|
|
84
|
-
[[tool.ty.overrides]]
|
|
85
|
-
include = ["check_empty/reporter/exceptions.py"]
|
|
86
|
-
rules = {invalid-mutable-override = "ignore"}
|
|
87
|
-
|
|
88
86
|
[tool.uv]
|
|
89
|
-
|
|
87
|
+
preview = true
|
|
88
|
+
required-version = ">=0.13.7"
|
|
90
89
|
|
|
91
90
|
[tool.uv.build-backend]
|
|
92
91
|
module-name = "check_empty"
|
|
93
92
|
module-root = ""
|
|
94
93
|
|
|
95
94
|
[tool.uv.dependency-groups]
|
|
96
|
-
docs = {requires-python = ">=3.
|
|
95
|
+
docs = {requires-python = ">=3.13"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|