Python Comment Conformity Formatter
Project description
ComForm: Python Comment Conformity Formatter
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. Whichever
way comform is used I recommend running black first; it was mainly 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 are considered enabled if they are set in the CLI or
the config. If wrap is set in both then the CLI takes priority.
To use comform as a pre-commit hook add the following to your
.pre-commit-config.yaml:
- repo: https://github.com/j-hil/comform
rev: 0.1.1
hooks:
- id: comform
Development
Too see my development process see development.md.
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 comform-0.1.1.tar.gz.
File metadata
- Download URL: comform-0.1.1.tar.gz
- Upload date:
- Size: 27.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81e62c9768cd4ff177fbd0e9773e4bb57a322f4dc1fdee4a9bda38da04cd584e
|
|
| MD5 |
e494e8b67250745ffcf74316e5f457ad
|
|
| BLAKE2b-256 |
77a4a9bfa6e542a700d6f15323cd37d28c4f881d8baa31fff335fd08d3de63f0
|
File details
Details for the file comform-0.1.1-py2.py3-none-any.whl.
File metadata
- Download URL: comform-0.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b14dadcb9e825cc54f56b21d9c0c3f4011b2ff470e8cd6c02a9fe227c534e562
|
|
| MD5 |
672e948b5b747951681328ec317d1993
|
|
| BLAKE2b-256 |
54b67a407a8f77a97bf816993e4a97239f2095cbfac879bcac294985b33aff89
|