From e70dfe342e03183dca98f5c8d5921e6fd9782da6 Mon Sep 17 00:00:00 2001 From: storypku Date: Sat, 16 May 2020 23:32:52 +0800 Subject: [PATCH] Docker.Build: pip3 install pylint --- docker/build/installers/install_qa_tools.sh | 3 +++ scripts/proto_build_generator.py | 20 +++++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/docker/build/installers/install_qa_tools.sh b/docker/build/installers/install_qa_tools.sh index aefdaa215b..b91db69bf1 100755 --- a/docker/build/installers/install_qa_tools.sh +++ b/docker/build/installers/install_qa_tools.sh @@ -39,5 +39,8 @@ apt-get -y update && \ shellcheck \ lcov +## Pylint +python3 -m pip install pylint + apt-get clean && \ rm -rf /var/lib/apt/lists/* diff --git a/scripts/proto_build_generator.py b/scripts/proto_build_generator.py index ed47550787..5d626592d8 100755 --- a/scripts/proto_build_generator.py +++ b/scripts/proto_build_generator.py @@ -75,10 +75,10 @@ def autorun(build_file_path): return 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)) \ and f != "BUILD" \ - and f != "CMakeLists.txt" ] + and f != "CMakeLists.txt"] ok = all(f.endswith(".proto") for f in files_all) if not ok: print( @@ -91,8 +91,7 @@ def autorun(build_file_path): for protofile in files_all: dependency_text = generate_dependency_text(workdir, protofile) - rules = generate_rule_for_protofile(workdir, protofile, - dependency_text) + rules = generate_rule_for_protofile(protofile, dependency_text) fout.write(rules) fout.close() @@ -100,7 +99,7 @@ def autorun(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) py_name = py_proto_name(protofile) pb_name = proto_name(protofile) @@ -109,12 +108,11 @@ def generate_rule_for_protofile(workdir, protofile, dependency_text): py_name=py_name, \ pb_name=pb_name, \ protofile=protofile) - else: - return TEMPLATE_DEPS.format(cc_name=cc_name, \ - py_name=py_name, \ - pb_name=pb_name, \ - protofile=protofile, \ - context=dependency_text) + return TEMPLATE_DEPS.format(cc_name=cc_name, \ + py_name=py_name, \ + pb_name=pb_name, \ + protofile=protofile, \ + context=dependency_text) def cc_proto_name(protofile): -- GitLab