Skip to main content

A CLI tool to clean up your source files

Project description

Cleany

tests GitHub issues last-commit Supported Versions

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cleany-0.3.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cleany-0.3.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file cleany-0.3.1.tar.gz.

File metadata

  • Download URL: cleany-0.3.1.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

Hashes for cleany-0.3.1.tar.gz
Algorithm Hash digest
SHA256 fd7d1781913768ec283d162d8e4b3cfea080eb963f5814b9488e7d674188f06e
MD5 f19865f1a0b44e58368c986f20b9d6f8
BLAKE2b-256 be0038fd64a9be01540bef789c2da299bb055c45dcad1fa88150933f1f3e4cbd

See more details on using hashes here.

Provenance

The following attestation bundles were made for cleany-0.3.1.tar.gz:

Publisher: cleany.yml on weddleben/cleany

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cleany-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: cleany-0.3.1-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

Hashes for cleany-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7552eca2e7e0f60a11d97fc4b297c43b962875e6a965d33a619c60466be6a841
MD5 b7ecc7b5e9312111075f4e12834aa125
BLAKE2b-256 944d80b852c3f860f9d82d2a4fa29058ca3ec6698aec4aba477e41c16cf9344a

See more details on using hashes here.

Provenance

The following attestation bundles were made for cleany-0.3.1-py3-none-any.whl:

Publisher: cleany.yml on weddleben/cleany

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page