Add flake8 check

max-line-length=120
This commit is contained in:
Hsiao-Wei Wang 2019-05-09 13:11:07 +08:00
parent 9ee240bfcc
commit d7c1305ce4
No known key found for this signature in database
GPG Key ID: 95B070122902DEA4
2 changed files with 21 additions and 0 deletions

View File

@ -84,11 +84,25 @@ jobs:
command: make citest command: make citest
- store_test_results: - store_test_results:
path: test_libs/pyspec/test-reports path: test_libs/pyspec/test-reports
lint:
docker:
- image: circleci/python:3.6
working_directory: ~/specs-repo
steps:
- restore_cache:
key: v1-specs-repo-{{ .Branch }}-{{ .Revision }}
- restore_cached_venv:
venv_name: v1-pyspec
reqs_checksum: '{{ checksum "test_libs/pyspec/requirements.txt" }}-{{ checksum "test_libs/pyspec/requirements-testing.txt" }}'
- run:
name: Run linter
command: make install_lint && make pyspec && make lint
workflows: workflows:
version: 2.1 version: 2.1
test_spec: test_spec:
jobs: jobs:
- checkout_specs - checkout_specs
- lint
- install_test: - install_test:
requires: requires:
- checkout_specs - checkout_specs

View File

@ -39,6 +39,13 @@ test: $(PY_SPEC_ALL_TARGETS)
citest: $(PY_SPEC_ALL_TARGETS) citest: $(PY_SPEC_ALL_TARGETS)
cd $(PY_SPEC_DIR); mkdir -p test-reports/eth2spec; . venv/bin/activate; python -m pytest --junitxml=test-reports/eth2spec/test_results.xml . cd $(PY_SPEC_DIR); mkdir -p test-reports/eth2spec; . venv/bin/activate; python -m pytest --junitxml=test-reports/eth2spec/test_results.xml .
install_lint:
cd $(PY_SPEC_DIR); python3 -m venv venv; . venv/bin/activate; pip3 install flake8==3.5.0
lint:
cd $(PY_SPEC_DIR); . venv/bin/activate; \
flake8 --max-line-length=120 ./eth2spec;
# "make pyspec" to create the pyspec for all phases. # "make pyspec" to create the pyspec for all phases.
pyspec: $(PY_SPEC_ALL_TARGETS) pyspec: $(PY_SPEC_ALL_TARGETS)