Skip to main content

The slightly more compromising code formatter.

Project description

Lavender

PyPI

A slightly more compromising Python code formatter, based on the latest stable release of Black (20.8b10 at the time of writing).

Differences from Black

  • The default line length is 99 instead of 88 (configurable with --line-length).
  • Single quoted strings are preferred (configurable with --string-normalization none/single/double).
  • Empty lines between classes and defs are treated no differently from other code. The old behavior, which sometimes inserts double empty lines between them, remains available via --special-case-def-empty-lines.
  • The Vim plugin configuration variable for line length is named g:lavender_line_length instead of g:lavender_linelength, for consistency with the other configuration variable names.

Documentation

Read up on Black, but replace black with lavender in your head.

Development

Poetry is recommended for managing Python development tooling.

To initialize an isolated Python development environment for Lavender:

poetry install

Code Formatting

Code formatting for Python is handled by Lavender itself.

To check that the code is correctly formatted:

poetry run lavender --check .

To auto-format the code:

poetry run lavender .

Type Checking

Type checking for Python is handled by mypy.

To check that the code is correctly typed:

poetry run mypy .

License

Lavender is Copyright (c) 2019-2021 Michael Smith <michael@spinda.net>

Black, the software on which it was based, is Copyright (c) 2018-2020 Łukasz Langa

This program is free software: you can redistribute it and/or modify it under the terms of the MIT License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MIT License for more details.

You should have received a copy of the MIT License along with this program. If not, see http://opensource.org/licenses/MIT.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this work by you shall be licensed as above, without any additional terms or conditions.

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

lavender-0.2.1.tar.gz (102.8 kB view details)

Uploaded Source

Built Distribution

lavender-0.2.1-py3-none-any.whl (108.2 kB view details)

Uploaded Python 3

File details

Details for the file lavender-0.2.1.tar.gz.

File metadata

  • Download URL: lavender-0.2.1.tar.gz
  • Upload date:
  • Size: 102.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-58-generic

File hashes

Hashes for lavender-0.2.1.tar.gz
Algorithm Hash digest
SHA256 00cf477a7debb060164d1cac510f500c96e63ed5938585b22d1d432f1cdd33ee
MD5 84fdbb761f659eec40ba136d9ec6905e
BLAKE2b-256 4b74b8ed474472e7c86bbad9430cc353dd0625549c94fce7846091c472904271

See more details on using hashes here.

File details

Details for the file lavender-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: lavender-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 108.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-58-generic

File hashes

Hashes for lavender-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a3e6901983f161854ee7f7b7ba04814b3415afd63d3e3f08f5344370457159f6
MD5 224c0042601680cd1afba238ab3fe301
BLAKE2b-256 f657e30c1e77df96d881a9ff91ba5efc6469575ad9a1e23de9749086f4c2ef71

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