deadcode 2.4.0__py3-none-any.whl → 2.4.1__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.
- deadcode/__init__.py +2 -0
- deadcode/actions/parse_arguments.py +6 -0
- deadcode/cli.py +12 -1
- deadcode/data_types.py +1 -0
- {deadcode-2.4.0.dist-info → deadcode-2.4.1.dist-info}/METADATA +4 -1
- {deadcode-2.4.0.dist-info → deadcode-2.4.1.dist-info}/RECORD +9 -9
- deadcode-2.4.1.dist-info/entry_points.txt +2 -0
- deadcode-2.4.0.dist-info/entry_points.txt +0 -2
- {deadcode-2.4.0.dist-info → deadcode-2.4.1.dist-info}/WHEEL +0 -0
- {deadcode-2.4.0.dist-info → deadcode-2.4.1.dist-info}/licenses/LICENSE +0 -0
deadcode/__init__.py
CHANGED
|
@@ -194,6 +194,12 @@ def parse_arguments(args: Optional[List[str]]) -> Args:
|
|
|
194
194
|
action='store_true',
|
|
195
195
|
default=False,
|
|
196
196
|
)
|
|
197
|
+
parser.add_argument(
|
|
198
|
+
'--version',
|
|
199
|
+
help='Shows deadcode version',
|
|
200
|
+
action='store_true',
|
|
201
|
+
default=False,
|
|
202
|
+
)
|
|
197
203
|
|
|
198
204
|
parsed_args = parser.parse_args(args).__dict__
|
|
199
205
|
|
deadcode/cli.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from typing import List, Optional
|
|
2
|
+
import sys
|
|
2
3
|
|
|
4
|
+
from deadcode import __version__
|
|
3
5
|
from deadcode.actions.find_python_filenames import find_python_filenames
|
|
4
6
|
from deadcode.actions.find_unused_names import find_unused_names
|
|
5
7
|
from deadcode.actions.fix_or_show_unused_code import fix_or_show_unused_code
|
|
@@ -12,6 +14,10 @@ from deadcode.actions.get_unused_names_error_message import (
|
|
|
12
14
|
def main(
|
|
13
15
|
command_line_args: Optional[List[str]] = None,
|
|
14
16
|
) -> Optional[str]:
|
|
17
|
+
|
|
18
|
+
if command_line_args and '--version' in command_line_args or '--version' in sys.argv:
|
|
19
|
+
return __version__
|
|
20
|
+
|
|
15
21
|
args = parse_arguments(command_line_args)
|
|
16
22
|
|
|
17
23
|
filenames = find_python_filenames(args=args)
|
|
@@ -31,5 +37,10 @@ def main(
|
|
|
31
37
|
return None
|
|
32
38
|
|
|
33
39
|
|
|
40
|
+
def print_main() -> None:
|
|
41
|
+
if result := main():
|
|
42
|
+
print(result)
|
|
43
|
+
|
|
44
|
+
|
|
34
45
|
if __name__ == '__main__':
|
|
35
|
-
|
|
46
|
+
print_main()
|
deadcode/data_types.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: deadcode
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.1
|
|
4
4
|
Summary: Find and remove dead code.
|
|
5
5
|
Project-URL: homepage, https://github.com/albertas/deadcode
|
|
6
6
|
Project-URL: documentation, https://deadcode.readthedocs.io/
|
|
@@ -201,6 +201,9 @@ code base is implemented in.
|
|
|
201
201
|
- [ ] Investigate ways of extracting and backporting Python3.10+ `ast` implementation to lower Python versions.
|
|
202
202
|
|
|
203
203
|
## Release notes
|
|
204
|
+
- v2.4.1:
|
|
205
|
+
- Add `--version` option to show `deadcode` version.
|
|
206
|
+
- Use stdout for `deadcode` output.
|
|
204
207
|
- v2.4.0:
|
|
205
208
|
- Add `--only` option that accepts filenames only which will be reflected in the output and modified.
|
|
206
209
|
This option can be used with `--fix` and `--fix --dry` options as well as for simple unused code detection without fixing.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
deadcode/__init__.py,sha256
|
|
2
|
-
deadcode/cli.py,sha256=
|
|
1
|
+
deadcode/__init__.py,sha256=-nvSi7hjcp572lXD-ercQdCJg2qJKYeBC7rLYPanSUs,227
|
|
2
|
+
deadcode/cli.py,sha256=yh-uAN8e16mf-BebfLtT9jWBr8kdYi8ZGUCYpNLdWHw,1419
|
|
3
3
|
deadcode/constants.py,sha256=ya_JsIQGtWAgrEZWc2NpKtuhwkn_05tlGBQpAm3f3Hc,838
|
|
4
|
-
deadcode/data_types.py,sha256=
|
|
4
|
+
deadcode/data_types.py,sha256=3BzU0LxTi00XtbIM8fh4RkdAoAeZsrbCyvyaSuNe5UA,1363
|
|
5
5
|
deadcode/actions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
deadcode/actions/find_python_filenames.py,sha256=uUKvCcisGc4zb6CjUDOhGYPjwW4S2Ysfr2MRhkMD7m0,1546
|
|
7
7
|
deadcode/actions/find_unused_names.py,sha256=TagYxuxNrBarwmJ23tuxuCGNinj8mQo26RGZTh90a-8,494
|
|
@@ -9,7 +9,7 @@ deadcode/actions/fix_or_show_unused_code.py,sha256=7txuOL_4wYiBecSMhGJ15YotNtlTW
|
|
|
9
9
|
deadcode/actions/get_unused_names_error_message.py,sha256=OMQyCXYTs5FAEFzrcFHZAJ_UrrphbAfn9ahtQG7Nt1I,1285
|
|
10
10
|
deadcode/actions/merge_overlaping_file_parts.py,sha256=ukErzpXCuUOWk5CCpPxD43edqoE087sGJGvYZnwUGXs,3165
|
|
11
11
|
deadcode/actions/parse_abstract_syntax_tree.py,sha256=iL0ukt-FQKA9DuFUk7-sSJZ9nfBzDlJBY-ijItYR6PU,547
|
|
12
|
-
deadcode/actions/parse_arguments.py,sha256=
|
|
12
|
+
deadcode/actions/parse_arguments.py,sha256=gYbdHz_8bzWUXArLzeV0Mu1a4vnhSBKuGWsuluDJcSs,7113
|
|
13
13
|
deadcode/actions/remove_file_parts_from_content.py,sha256=vz9fjniO6Tx3y-rUb4pmAWwU3BYbCBE4-ZY7aDNNnMI,6475
|
|
14
14
|
deadcode/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
deadcode/utils/add_colors_to_diff.py,sha256=JSEtaHbyojIpCOBa2UNCaKDJr0a9hxkeDlRB4h-YpBI,423
|
|
@@ -25,8 +25,8 @@ deadcode/visitor/ignore.py,sha256=m8qB8uKYB65D-53JOB5LKz32TF9c1y623EyZ1uFFc9A,31
|
|
|
25
25
|
deadcode/visitor/lines.py,sha256=0NCrWAqYua7k93VYy7yLby7olhT2Pe4VU_Z5ImNKkjE,3241
|
|
26
26
|
deadcode/visitor/noqa.py,sha256=0zRA9q0MzEzKe-N285JafP1DSJ3QqGL4GTb9m0QwCiY,2088
|
|
27
27
|
deadcode/visitor/utils.py,sha256=55WcdKJPRrQiFrc0tIkcGO7dUkTnfvZ3qSzsLsTR4MI,2765
|
|
28
|
-
deadcode-2.4.
|
|
29
|
-
deadcode-2.4.
|
|
30
|
-
deadcode-2.4.
|
|
31
|
-
deadcode-2.4.
|
|
32
|
-
deadcode-2.4.
|
|
28
|
+
deadcode-2.4.1.dist-info/METADATA,sha256=CBnXRajVuYC5JBURud_5lruOBh9UJF9hODRYKijHimk,11999
|
|
29
|
+
deadcode-2.4.1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
30
|
+
deadcode-2.4.1.dist-info/entry_points.txt,sha256=efJLd6DwsjycmpPFhvnql1ziW6xGx6VtAvZXNlREQxg,53
|
|
31
|
+
deadcode-2.4.1.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
|
32
|
+
deadcode-2.4.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|