Monkey patched black that understands nose of yeti
Project description
This is a monkey patch of black (https://github.com/psf/black) to give it the ability to understand the noseOfYeti (http://noseofyeti.readthedocs.io) spec coding.
To use it:
$ pip install noy_black $ noy_black file_to_format.py
Where all the arguments are the same as the normal black command.
It will even use noseOfYeti to tokenize the original and the formatted files to check that the ast is equivalent before and after formatting with black.
Caveats
Because it, ignore, context, describe, before_each and after_each are special keywords only for noseOfYeti, you can still use these words as variable names. However you cannot start a line with any of these keywords or black will get confused.
For example:
# This will confuse black
context = 1
# This will not confuse black
one, context = 1, 2
# this will also not confuse black
for it in [1, 2]:
print(it)
# but this will
it = 1
Also, this works by defining the whole python grammar plus some extra grammar so new versions of black will mean I have to update my version of the Grammar.
Changelog
- 0.1.3
Initial release
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
Hashes for noy_black-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df9ab05420485b9a903cad15e7f1452eae89753ba6e37cd239704cad5b7356b3 |
|
MD5 | a2fbebf4629709cac990ae8569d0e435 |
|
BLAKE2b-256 | 2384cf086c3085fc412070d00186190dcef0fd62c2fd32926f9bc1422326ea02 |