| 1 | .PHONY: format lint f tests cov htmlcov pep8 pylint docs dev-deps test-deps publish coveralls |
| 2 | |
| 3 | source_dirs = radon |
| 4 | isort = isort -rc $(source_dirs) |
| 5 | black = black --line-length 79 --skip-string-normalization \ |
| 6 | --target-version py27 $(source_dirs) |
| 7 | flake8 = flake8 $(source_dirs) |
| 8 | |
| 9 | format: |
| 10 | $(isort) |
| 11 | $(black) |
| 12 | |
| 13 | lint: |
| 14 | $(flake8) |
| 15 | |
| 16 | f: format lint |
| 17 | |
| 18 | tests: |
| 19 | python radon/tests/run.py |
| 20 | |
| 21 | cov: |
| 22 | coverage erase && coverage run --branch --include "radon/*" --omit "radon/__init__.py,radon/cli.py,radon/tests/*" radon/tests/run.py |
| 23 | coverage report -m |
| 24 | |
| 25 | htmlcov: cov |
| 26 | coverage html |
| 27 | |
| 28 | pep8: |
| 29 | pep8 radon --exclude "radon/tests" --ignore "E731" |
| 30 | |
| 31 | pylint: |
| 32 | pylint --rcfile pylintrc radon |
| 33 | |
| 34 | docs: |
| 35 | cd docs && make html |
| 36 | |
| 37 | test-deps: |
| 38 | pip install -r test_requirements.txt |
| 39 | |
| 40 | publish: |
| 41 | rm -rf dist/* |
| 42 | python setup.py sdist bdist_wheel |
| 43 | twine upload dist/* |
| 44 | python setup.py develop |
| 45 | |
| 46 | coveralls: test-deps cov |
| 47 | coveralls |