提交 e70dfe34 编写于 作者: S storypku

Docker.Build: pip3 install pylint

上级 bd6d854c
...@@ -39,5 +39,8 @@ apt-get -y update && \ ...@@ -39,5 +39,8 @@ apt-get -y update && \
shellcheck \ shellcheck \
lcov lcov
## Pylint
python3 -m pip install pylint
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
...@@ -75,10 +75,10 @@ def autorun(build_file_path): ...@@ -75,10 +75,10 @@ def autorun(build_file_path):
return return
workdir = os.path.dirname(build_file_path) workdir = os.path.dirname(build_file_path)
files_all = [ f for f in os.listdir(workdir) if \ files_all = [f for f in os.listdir(workdir) if \
os.path.isfile(os.path.join(workdir, f)) \ os.path.isfile(os.path.join(workdir, f)) \
and f != "BUILD" \ and f != "BUILD" \
and f != "CMakeLists.txt" ] and f != "CMakeLists.txt"]
ok = all(f.endswith(".proto") for f in files_all) ok = all(f.endswith(".proto") for f in files_all)
if not ok: if not ok:
print( print(
...@@ -91,8 +91,7 @@ def autorun(build_file_path): ...@@ -91,8 +91,7 @@ def autorun(build_file_path):
for protofile in files_all: for protofile in files_all:
dependency_text = generate_dependency_text(workdir, protofile) dependency_text = generate_dependency_text(workdir, protofile)
rules = generate_rule_for_protofile(workdir, protofile, rules = generate_rule_for_protofile(protofile, dependency_text)
dependency_text)
fout.write(rules) fout.write(rules)
fout.close() fout.close()
...@@ -100,7 +99,7 @@ def autorun(build_file_path): ...@@ -100,7 +99,7 @@ def autorun(build_file_path):
build_file_path)) build_file_path))
def generate_rule_for_protofile(workdir, protofile, dependency_text): def generate_rule_for_protofile(protofile, dependency_text):
cc_name = cc_proto_name(protofile) cc_name = cc_proto_name(protofile)
py_name = py_proto_name(protofile) py_name = py_proto_name(protofile)
pb_name = proto_name(protofile) pb_name = proto_name(protofile)
...@@ -109,12 +108,11 @@ def generate_rule_for_protofile(workdir, protofile, dependency_text): ...@@ -109,12 +108,11 @@ def generate_rule_for_protofile(workdir, protofile, dependency_text):
py_name=py_name, \ py_name=py_name, \
pb_name=pb_name, \ pb_name=pb_name, \
protofile=protofile) protofile=protofile)
else: return TEMPLATE_DEPS.format(cc_name=cc_name, \
return TEMPLATE_DEPS.format(cc_name=cc_name, \ py_name=py_name, \
py_name=py_name, \ pb_name=pb_name, \
pb_name=pb_name, \ protofile=protofile, \
protofile=protofile, \ context=dependency_text)
context=dependency_text)
def cc_proto_name(protofile): def cc_proto_name(protofile):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册