Validate your Python file format with yapf
Project description
pytest-yapf3
Validate your Python file format with yapf.
This is a pytest plugin, which make sure your python file is exactly formatted by yapf,
or it will crash when running pytest
.
Install
pip install pytest-yapf3
Usage
Modify setup.cfg
(or pytest.ini
):
[tool:pytest]
addopts =
--yapf
--yapfdiff
Add --yapf
to pytest configuration addopts
.
By default, only line summaries is displayed.
With --yapfdiff
, a full text of yapf -d
is displayed.
Features and Todos
- Basic support to validate
yapf
. - Fix the diff line count error and improve the performance.
- Display
YAPF-check
as the error session name. - Display
YAPF
inpytest --verbose
. - Support
--yapf-ignore
to ignore specified files. - Skip running if a file is not changed.
- 100% test coverage.
Develop
Prepare the environment:
source your/virtual/env
pip install -e .[dev]
Run test:
pytest
License
The MIT License (MIT)
Copyright (c) 2019 Yan QiDong
This repository is forked from pytest-yapf in 2019, which is not maintained since 2017. Besides extra features, the project structure is adjusted, and the code is enhanced to pass linters like flake8, pylint and, of course, yapf.
Change Log
Release 0.3.0
- Display
YAPF-check
as the error session name - Display
::YAPF
inpytest --verbose
Release 0.2.0
Since forked from pytest-yapf 0.1.1
, there are some improvements:
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
File details
Details for the file pytest-yapf3-0.3.0.tar.gz
.
File metadata
- Download URL: pytest-yapf3-0.3.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1aad99b087b3ea3a971123340a1d27375459c13b00de38b68cb446fa3f4c7b33 |
|
MD5 | 69d36527a564b0cfc4338683b2df8421 |
|
BLAKE2b-256 | 90871d6f05b23788c810bfb3f1f3af46e5561d980b41ca50f46f53400e8c909c |
File details
Details for the file pytest_yapf3-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: pytest_yapf3-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8393c8ae8fc159675fa654732de42792f8f1915dc22252d252bfcdbbe441a7fb |
|
MD5 | 530dcc5ce697f2d62c45128962e40261 |
|
BLAKE2b-256 | fc8a602a0319c0625f7dfa57ee859fe5216a8133df34d7ed0413aa3e15d0553a |