A CLI tool to clean up your source files
Project description
Cleany
Cleany is a CLI tool to clean up your source files.
Install
Install via pip
$ pip install cleany
Invoke
Cleany is a command line tool. Once installed, invoke it from the command line:
$ cleany
> cleany -h for help
Remove emojis:
$ cleany --emoji
Cleany will attempt to remove all emojis from all valid UTF-8 text files it finds.
IF cleany removes at least one emoji from a .py file, it will attempt to refactor the file using Ruff. Since this can significantly change the shape of your source files, you can disable Ruff:
$ cleany --emoji --no-ruff
If cleany does not remove an emoji from a Python file, it will not run Ruff against it.
Change the path.
Cleany will search for files starting in your current directory and moving recursively down. If you would like to specify a directory, use --path:
$ cleany --emoji --path some-directory
Ignore directory
If you want Cleany to skip directory, use --ignore-dir:
$ cleany --emoji --ignore-dir some-directory
You can ignore multiple directories:
$ cleany --emoji --ignore-dir some-directory --ignore-dir another-directory
By default cleany will skip hidden directories (directory names which begin with .) It will also skip the following directories:
- venv
- add more here
Ignore file
If you want Cleany to skip a file, use --ignore-file:
$ cleany --nuke --ignore-file banana.js
You can ignore multiple files:
$ cleany --emoji --ignore-file banana.js --ignore-file palace.js
Do not include the full path to the file; just use the file name. Cleany will find and skip any file with that name.
Remove comments from Python files
If cleany finds .py files, it can remove all # comments from them. Does not remove docstrings.
$ cleany --nuke
IF cleany removes at least one comment from a .py file, it will attempt to refactor the file using Ruff. Since this can significantly change the shape of your source files, you can disable Ruff:
$ cleany --nuke --no-ruff
If cleany does not remove a comment from a Python file, it will not run Ruff against it.
Surpress Cleany's output
By default Cleany will provide output about the files it's cleaning up.
$ cleany --nuke
> ----- scanning comments in /src/main.py -----
> removing comment from line 85 of /src/main.py
> removing comment from line 115 of /src/main.py
> removed 2 comments from /src/main.py
If you want to surpress that output, use --quiet:
$ cleany --nuke --quiet
$
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cleany-0.3.2.tar.gz.
File metadata
- Download URL: cleany-0.3.2.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
839006693d64b5e1e213b40788a1c75a0c2f0a3b4cb76301cfe225698bd67a3e
|
|
| MD5 |
42e44ffd32f7779051ca8796ae03f98c
|
|
| BLAKE2b-256 |
fa76fe654c5ae5a7c5a92d073cdf5cdb505d3a85c7ad86f979bda8e83215a517
|
Provenance
The following attestation bundles were made for cleany-0.3.2.tar.gz:
Publisher:
cleany.yml on weddleben/cleany
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cleany-0.3.2.tar.gz -
Subject digest:
839006693d64b5e1e213b40788a1c75a0c2f0a3b4cb76301cfe225698bd67a3e - Sigstore transparency entry: 1238413248
- Sigstore integration time:
-
Permalink:
weddleben/cleany@1ff99131ec1645bc04ce218ced127c6f15466926 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/weddleben
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cleany.yml@1ff99131ec1645bc04ce218ced127c6f15466926 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cleany-0.3.2-py3-none-any.whl.
File metadata
- Download URL: cleany-0.3.2-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9ae6301d843c544d516d6107baba9539efe67bd4b961480a7660f9b26304632
|
|
| MD5 |
43840fd9508d283ef731e8407ccd9b84
|
|
| BLAKE2b-256 |
e8a1c4a84a602759ab9750014cdcc6243a439eeb7fd2fe4697472f69bb62195e
|
Provenance
The following attestation bundles were made for cleany-0.3.2-py3-none-any.whl:
Publisher:
cleany.yml on weddleben/cleany
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cleany-0.3.2-py3-none-any.whl -
Subject digest:
e9ae6301d843c544d516d6107baba9539efe67bd4b961480a7660f9b26304632 - Sigstore transparency entry: 1238413281
- Sigstore integration time:
-
Permalink:
weddleben/cleany@1ff99131ec1645bc04ce218ced127c6f15466926 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/weddleben
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cleany.yml@1ff99131ec1645bc04ce218ced127c6f15466926 -
Trigger Event:
push
-
Statement type: