Skip to main content

Python Comment Conformity Formatter

Project description

ComForm: Python Comment Conformity Formatter

code style: black Imports: isort

An auto-formatter for pretty and readable comment formatting in python.

WARNING: comform is made for my own usage so it's not been tested in a variety of environments. Use it on your own code at peril ;).

Comments are formatted as markdown text using the fantastic mdformat package. Treating comments as markdown has drawbacks, but I've found these to be outweighed.

Usage

This package can be installed from PyPI as usual via pip install comform and is meant to be used as a command line tool. It can also be used as a pre-commit hook, but only with a local copy installed (known issue, see here). Whichever way comform is used I recommend running black first; it was developed for this use-case.

The command line interface is:

comform [-h] [--version] [--check] [--align] [--dividers] [--wrap N] paths [paths ...]

and inputs can also be configured in pyproject.toml:

[tool.comform]
# these are the default values:
check = false
align = false
dividers = false
wrap = 88

check, align and dividers work if they are set in the CLI or the config. If wrap is set in both then the CLI takes priority.

Development

Too see my development process see development.md.

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

comform-0.1.0.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

comform-0.1.0-py2.py3-none-any.whl (20.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file comform-0.1.0.tar.gz.

File metadata

  • Download URL: comform-0.1.0.tar.gz
  • Upload date:
  • Size: 27.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for comform-0.1.0.tar.gz
Algorithm Hash digest
SHA256 410efbb96242664e72ec72fd5beac028fef4611c4fd0ff4a1bdf7ce6ec286801
MD5 e2fb97f5c899b58fdec76fa7559723ad
BLAKE2b-256 c44a4193a0f04884ab050e639c90d1bf2ebfaf75570b0331e71d93562d899c05

See more details on using hashes here.

File details

Details for the file comform-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: comform-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for comform-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ec590da051f0b1ba55464c774ccfc7c7de2e539c18446f396c2b91009eef0a43
MD5 3eb8aa500d23b4019b93eb4eae743c82
BLAKE2b-256 976a4ad538a595e84f6b1ce2b76647aedb9856ac67363235996e902891c16dc0

See more details on using hashes here.

Supported by

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