mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-03 03:31:05 +06:00

* fix confused flake We run `black --target-version py35 ...` but flake8 doesn't know that, so currently with py38 flake8 fails suggesting that black should have reformatted 63 files. Indeed if I run: ``` black --line-length 119 --target-version py38 examples templates tests src utils ``` it indeed reformats 63 files. The only solution I found is to create a black config file as explained at https://github.com/psf/black#configuration-format, which is what this PR adds. Now flake8 knows that py35 is the standard and no longer gets confused regardless of the user's python version. * adjust the other files that will now rely on black's config file
37 lines
839 B
Makefile
37 lines
839 B
Makefile
.PHONY: quality style test test-examples docs
|
|
|
|
# Check that source code meets quality standards
|
|
|
|
quality:
|
|
black --check examples templates tests src utils
|
|
isort --check-only examples templates tests src utils
|
|
flake8 examples templates tests src utils
|
|
python utils/check_copies.py
|
|
python utils/check_repo.py
|
|
|
|
# Format source code automatically
|
|
|
|
style:
|
|
black examples templates tests src utils
|
|
isort examples templates tests src utils
|
|
|
|
# Make marked copies of snippets of codes conform to the original
|
|
|
|
fix-copies:
|
|
python utils/check_copies.py --fix_and_overwrite
|
|
|
|
# Run tests for the library
|
|
|
|
test:
|
|
python -m pytest -n auto --dist=loadfile -s -v ./tests/
|
|
|
|
# Run tests for examples
|
|
|
|
test-examples:
|
|
python -m pytest -n auto --dist=loadfile -s -v ./examples/
|
|
|
|
# Check that docs can build
|
|
|
|
docs:
|
|
cd docs && make html SPHINXOPTS="-W"
|