Skip pb files in linters
In isort, black, and flake8, respectively. Add `format` in Makefile Run top level packages only With `setup.py`, to avoid running other unrelated directories. Refactor
This commit is contained in:
parent
c8005c8113
commit
4fef80595c
11
Makefile
11
Makefile
|
@ -1,8 +1,15 @@
|
|||
FILES_TO_LINT = libp2p tests examples setup.py
|
||||
|
||||
format:
|
||||
black $(FILES_TO_LINT)
|
||||
isort --recursive $(FILES_TO_LINT)
|
||||
|
||||
lintroll:
|
||||
# NOTE: disabling `mypy` until we get typing sorted in this repo
|
||||
# mypy -p libp2p -p examples --config-file {toxinidir}/mypy.ini
|
||||
black --check examples libp2p/__init__.py libp2p/host libp2p/kademlia libp2p/network libp2p/peer libp2p/protocol_muxer libp2p/pubsub/*.py libp2p/routing libp2p/security libp2p/stream_muxer libp2p/transport tests setup.py
|
||||
isort --recursive --check-only examples libp2p/__init__.py libp2p/host libp2p/kademlia libp2p/network libp2p/peer libp2p/protocol_muxer libp2p/pubsub/*.py libp2p/routing libp2p/security libp2p/stream_muxer libp2p/transport tests setup.py
|
||||
# TODO: add flake8
|
||||
black --check $(FILES_TO_LINT)
|
||||
isort --recursive --check-only $(FILES_TO_LINT)
|
||||
|
||||
protobufs:
|
||||
cd libp2p/pubsub/pb && protoc --python_out=. rpc.proto
|
||||
|
|
22
pyproject.toml
Normal file
22
pyproject.toml
Normal file
|
@ -0,0 +1,22 @@
|
|||
[tool.black]
|
||||
line-length = 88
|
||||
target_version = ['py37']
|
||||
include = '\.pyi?$'
|
||||
exclude = '''
|
||||
|
||||
(
|
||||
/(
|
||||
\.eggs # exclude a few common directories in the
|
||||
| \.git # root of the project
|
||||
| \.hg
|
||||
| \.mypy_cache
|
||||
| \.tox
|
||||
| \.venv
|
||||
| _build
|
||||
| buck-out
|
||||
| build
|
||||
| dist
|
||||
)/
|
||||
| \w*_pb2\w*\.py # pb2 files
|
||||
)
|
||||
'''
|
Loading…
Reference in New Issue
Block a user