https://github.com/forgepackages/forge-format
Unified formatter for Django (uses Black and Ruff)
https://github.com/forgepackages/forge-format
black django forgepackages formatter python ruff
Last synced: 6 months ago
JSON representation
Unified formatter for Django (uses Black and Ruff)
- Host: GitHub
- URL: https://github.com/forgepackages/forge-format
- Owner: forgepackages
- License: mit
- Created: 2022-06-17T21:41:06.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-01T19:10:11.000Z (almost 3 years ago)
- Last Synced: 2024-11-30T01:31:21.825Z (over 1 year ago)
- Topics: black, django, forgepackages, formatter, python, ruff
- Language: Python
- Homepage: https://www.forgepackages.com/docs/forge-format
- Size: 58.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# forge-format
A unified, opinionated code formatting command for Django projects.
Uses [black](https://github.com/psf/black) and [ruff](https://github.com/charliermarsh/ruff/) to format Python code.
## Installation
First, install `forge-format` from [PyPI](https://pypi.org/project/forge-format/):
```sh
pip install forge-format
```
Now you will have access to the `format` command:
```sh
forge format
```
Note that if you're using black + ruff for the first time,
a common issue is to get a bunch of `E501 Line too long` errors on code comments.
This is because black doesn't fix line lengths on comments!
If there are more than you want to fix, just add this to your `pyproject.toml`:
```toml
[tool.ruff]
# Never enforce `E501` (line length violations).
ignore = ["E501"]
```