Skip to content

Commit 9195ac6

Browse files
authored
Merge pull request #355 from tensorlayer/make
add a Makefile to help perform some common tasks
2 parents 482c7be + b1cc354 commit 9195ac6

File tree

3 files changed

+37
-1
lines changed

3 files changed

+37
-1
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ script:
1515
# - pytest
1616

1717
# smoke tests
18+
# - make test # TODO: make it use python3 by default
1819
- python tests/test_yapf_format.py
1920
- python tests/test_pydocstyle.py
2021
- python tests/test_mnist_simple.py

CONTRIBUTING.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,10 @@ The following tools are used to ensure that your commits can pass through the CI
1010
* [isort](https://github.com/timothycrosley/isort) (sort imports), optional
1111
* [autoflake](https://github.com/myint/autoflake) (remove unused imports), optional
1212

13-
Please apply these tools in the changed files before submitting your PR.
13+
You can simply run
14+
15+
```
16+
make format
17+
```
18+
19+
to apply those tools before submitting your PR.

Makefile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
default:
2+
@echo "Usage:"
3+
@echo "\tmake lint # run pylint"
4+
@echo "\tmake format # run yapf, autoflake and isort"
5+
@echo "\tmake install3 # install tensorlayer in current workspace with pip3"
6+
7+
lint:
8+
pylint example/*.py
9+
pylint tensorlayer
10+
11+
test:
12+
python tests/test_yapf_format.py
13+
python tests/test_pydocstyle.py
14+
python tests/test_mnist_simple.py
15+
16+
format:
17+
yapf -i example/*.py
18+
yapf -i tensorlayer/*.py
19+
yapf -i tensorlayer/**/*.py
20+
21+
autoflake -i example/*.py
22+
autoflake -i tensorlayer/*.py
23+
autoflake -i tensorlayer/**/*.py
24+
25+
isort -rc example
26+
isort -rc tensorlayer
27+
28+
install3:
29+
pip3 install -U . --user

0 commit comments

Comments
 (0)