2019-09-23 22:00:40 +08:00
|
|
|
FILES_TO_LINT = libp2p tests tests_interop examples setup.py
|
2019-08-17 05:08:54 +08:00
|
|
|
PB = libp2p/crypto/pb/crypto.proto libp2p/pubsub/pb/rpc.proto libp2p/security/insecure/pb/plaintext.proto libp2p/security/secio/pb/spipe.proto
|
2019-08-16 17:08:22 +08:00
|
|
|
PY = $(PB:.proto=_pb2.py)
|
|
|
|
PYI = $(PB:.proto=_pb2.pyi)
|
|
|
|
|
|
|
|
# Set default to `protobufs`, otherwise `format` is called when typing only `make`
|
|
|
|
all: protobufs
|
2019-08-03 18:02:27 +08:00
|
|
|
|
|
|
|
format:
|
|
|
|
black $(FILES_TO_LINT)
|
|
|
|
isort --recursive $(FILES_TO_LINT)
|
2019-10-24 14:41:10 +08:00
|
|
|
docformatter -ir $(FILES_TO_LINT)
|
2019-08-03 18:02:27 +08:00
|
|
|
|
2019-08-03 01:52:53 +08:00
|
|
|
lintroll:
|
2019-08-14 05:32:54 +08:00
|
|
|
mypy -p libp2p -p examples --config-file mypy.ini
|
2019-08-03 18:02:27 +08:00
|
|
|
black --check $(FILES_TO_LINT)
|
|
|
|
isort --recursive --check-only $(FILES_TO_LINT)
|
2019-08-04 00:11:49 +08:00
|
|
|
flake8 $(FILES_TO_LINT)
|
2019-08-03 03:20:48 +08:00
|
|
|
|
2019-08-16 17:08:22 +08:00
|
|
|
protobufs: $(PY)
|
|
|
|
|
|
|
|
%_pb2.py: %.proto
|
|
|
|
protoc --python_out=. --mypy_out=. $<
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(PY) $(PYI)
|