-
Notifications
You must be signed in to change notification settings - Fork 572
feat: Added Makefile #530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Added Makefile #530
Changes from all commits
6dedd0e
e2cbfcc
b777f08
c129ea5
60b0992
f39b87d
8e25e7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.PHONY: Commands for developers | ||
|
||
.PHONY: check-all | ||
check-all: ## Run all lint checks and unittest | ||
@echo "[Notice] If you'd like to run commands with same env to CI, please run \`tox\`." | ||
@bash ci.sh | ||
|
||
.PHONY: isort | ||
isort: ## Run isort | ||
python -m isort $(ARGS) -rc . | ||
|
||
.PHONY: autopep8 | ||
autopep8: ## Run autopep8 | ||
python -m autopep8 $(ARGS) -a -r -i . | ||
|
||
.PHONY: pylint | ||
pylint: ## Run pylint | ||
python -m pylint $(ARGS) --rcfile .pylintrc appium test | ||
|
||
.PHONY: mypy | ||
mypy: ## Run mypy | ||
python -m mypy appium test | ||
|
||
.PHONY: unittest | ||
unittest: ## Run unittest | ||
python -m pytest test/unit/ | ||
|
||
.PHONY: help | ||
help: ## Display this help screen | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ def events(self) -> Dict: | |
session = self.session | ||
return session['events'] | ||
except Exception as e: | ||
logger.warning('Could not find events information in the session. Error:', e) | ||
logger.warning('Could not find events information in the session. Error: %s', e) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Notes] Fixed pylint error |
||
return {} | ||
|
||
# pylint: disable=protected-access | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,27 @@ | ||
#!/bin/bash | ||
|
||
set -o pipefail | ||
|
||
EXIT_STATUS=0 | ||
if ! python -m autopep8 --exit-code -a -r --global-config .config-pep8 -i . ; then | ||
echo "Please run command 'python -m autopep8 -a -r --global-config .config-pep8 -i .' on your local and commit the result" | ||
|
||
if ! make autopep8 ARGS=--exit-code ; then | ||
echo "Please run command 'make autopep8' on your local and commit the result" | ||
EXIT_STATUS=1 | ||
fi | ||
|
||
if ! python -m isort --check-only -rc . ; then | ||
echo "Please run command 'python -m isort -rc .' on your local and commit the result" | ||
if ! make isort ARGS=--check-only ; then | ||
echo "Please run command 'make isort' on your local and commit the result" | ||
EXIT_STATUS=1 | ||
fi | ||
|
||
( | ||
LINT_RESULT=$(python -m pylint --rcfile .pylintrc appium test --errors-only 2>&1 | tee /dev/tty) | ||
if [[ $? -ne 0 ]] ; then | ||
EXIT_STATUS=1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Notes] This |
||
fi | ||
|
||
# FIXME: pylint x Python 3.7 cause this runtime error. | ||
# We must remove here when we drop Python 2 (and can update pylint) or | ||
# install newer pylint for Python 3.7 environment on CI | ||
if [[ $LINT_RESULT =~ "RuntimeError: generator raised StopIteration" ]] ; then | ||
EXIT_STATUS=0 | ||
fi | ||
) | ||
if ! make pylint ARGS=--errors-only ; then | ||
echo "Please run command 'make pylint' on your local and fix errors" | ||
EXIT_STATUS=1 | ||
fi | ||
|
||
( | ||
python -m pytest test/unit/ | ||
) | ||
if [[ $? -ne 0 ]] ; then | ||
if ! make unittest ; then | ||
EXIT_STATUS=1 | ||
fi | ||
|
||
( | ||
python -m mypy appium test | ||
) | ||
if [[ $? -ne 0 ]] ; then | ||
if ! make mypy ; then | ||
EXIT_STATUS=1 | ||
fi | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
sphinx >= 3.0, <4.0 | ||
sphinx >= 3.0, <4.0 | ||
sphinx_rtd_theme < 1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding
all
?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, added
check-all
command.