Skip to content

Commit 7e5ade2

Browse files
authored
Merge pull request #52 from hpe-container-platform-community/travis_flake_check_numpy_docs
turn on flake numpy docstring check
2 parents 4cd2d35 + 7137856 commit 7e5ade2

File tree

10 files changed

+387
-289
lines changed

10 files changed

+387
-289
lines changed

.travis.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ after_success:
2323

2424
jobs:
2525
include:
26+
- stage: flake8_code
27+
name: "Flake8 code checks"
28+
python: 3.8
29+
install:
30+
- pip3 install flake8 flake8-per-file-ignores
31+
script:
32+
- flake8 bin/ hpecp/ tests/
33+
- stage: flake8_docs
34+
name: "Flake8 doc checks"
35+
python: 3.8
36+
install:
37+
- pip3 install flake8 flake8-docstrings flake8-per-file-ignores
38+
script:
39+
- flake8 --exclude hpecp/client.py,hpecp/catalog.py,hpecp/config.py,hpecp/gateway.py,hpecp/logger.py,hpecp/lock.py,hpecp/k8s_cluster.py,hpecp/k8s_worker.py,hpecp/license.py,hpecp/exceptions.py,hpecp/user.py,hpecp/tenant.py,hpecp/role.py --docstring-convention numpy bin/ hpecp/
2640
- stage: coverage_library
2741
name: "Code coverage LIBRARY (./hpecp)"
2842
python: 3.8
@@ -41,13 +55,6 @@ jobs:
4155
- coverage erase
4256
- coverage run --source bin setup.py test
4357
- coverage report -m --fail-under 32
44-
- stage: flake8
45-
name: "Flake8 code checks"
46-
python: 3.8
47-
install:
48-
- pip3 install flake8 # TODO: install 'flake8-docstrings'
49-
script:
50-
- flake8 bin/ hpecp/ tests/ # TODO: add docstring 'flake8 --docstring-convention numpy hpecp/ bin/ tests/'
5158
- stage: format
5259
name: "Check code formatting"
5360
python: 3.8

DEVELOPING.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,15 @@ hpecp license platform-id
5656
- `GET /api/v1/role/99` (returns HTTP 404 - not found)
5757

5858

59-
#### BUILDING DOCS
59+
### DOCS
60+
61+
#### format
62+
63+
Numpy docstring format are required: https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard
64+
65+
Docstring formatting is verified with flake8 as Travis build step.
66+
67+
#### Building
6068

6169
In the Gitpod Terminal:
6270

@@ -113,6 +121,12 @@ Aim for 100% test coverage to ensure library will work with all specified python
113121
coverage erase && coverage run --source hpecp,bin setup.py test && coverage report -m
114122
```
115123

124+
### CODE QUALITY
125+
126+
```
127+
pip3 install flake8 flake8-docstrings
128+
flake8 --docstring-convention numpy bin/ hpecp/ tests/
129+
```
116130

117131
### FORMATTING
118132

bin/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# noqa: D104

0 commit comments

Comments
 (0)