-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from cfournie/lint
Lint
- Loading branch information
Showing
11 changed files
with
351 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,31 @@ | ||
PYTHON_VERSION := `python -c 'import sys; print(sys.version_info.major)'` | ||
python_version := `python -c 'import sys; print(sys.version_info.major)'` | ||
python_files := find . -path '*/.*' -prune -o -name '*.py' -print0 | ||
|
||
all: install test lint | ||
|
||
clean: | ||
find . \( -name '*.pyc' -o -name '*.pyo' -o -name '*~' \) -print -delete >/dev/null | ||
find . -name '__pycache__' -exec rm -rvf '{}' + >/dev/null | ||
rm -fr *.egg-info | ||
|
||
install: | ||
pip install -e . | ||
@if [ "$(PYTHON_VERSION)" = "2" ]; then pip install -r python27_requirements.txt; fi | ||
pip install -r dev_requirements.txt | ||
test: install | ||
py.test -vv --cov=important tests/ | ||
important -v | ||
pip install -e . | ||
@if [ "$(python_version)" = "2" ]; then pip install -r python27_requirements.txt; fi | ||
pip install -r dev_requirements.txt | ||
|
||
test: clean install | ||
py.test -vv --cov=important tests/ | ||
important -v | ||
|
||
coverage: | ||
py.test -vv --cov=important --cov-report html tests/ | ||
py.test -vv --cov=important --cov-report html tests/ | ||
|
||
autolint: | ||
pip install autopep8 | ||
autopep8 --in-place --aggressive --aggressive *.py | ||
autopep8 --in-place --aggressive --aggressive **/*.py | ||
autopep8: | ||
@echo 'Auto Formatting...' | ||
@$(python_files) | xargs -0 autopep8 --max-line-length 120 --jobs 0 --in-place --aggressive | ||
|
||
lint: | ||
flake8 --ignore D . | ||
flake8 --ignore D . | ||
@echo 'Linting...' | ||
@pylint --rcfile=pylintrc important tests | ||
@flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.