Skip to content

Commit b545cbd

Browse files
committed
Use stdout for deadcode output
1 parent e128c7a commit b545cbd

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ code base is implemented in.
174174
- [ ] Investigate ways of extracting and backporting Python3.10+ `ast` implementation to lower Python versions.
175175

176176
## Release notes
177+
- v2.4.1:
178+
- Add `--version` option to show `deadcode` version.
179+
- Use stdout for `deadcode` output.
177180
- v2.4.0:
178181
- Add `--only` option that accepts filenames only which will be reflected in the output and modified.
179182
This option can be used with `--fix` and `--fix --dry` options as well as for simple unused code detection without fixing.

deadcode/cli.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,10 @@ def main(
3737
return None
3838

3939

40+
def print_main() -> None:
41+
if result := main():
42+
print(result)
43+
44+
4045
if __name__ == '__main__':
41-
main()
46+
print_main()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ test = [
3333
]
3434

3535
[project.scripts]
36-
deadcode = "deadcode.cli:main"
36+
deadcode = "deadcode.cli:print_main"
3737

3838
[project.urls]
3939
homepage = "https://github.com/albertas/deadcode"

0 commit comments

Comments
 (0)