Skip to content

[TEST] enable pre-commit#15876

Closed
luotao1 wants to merge 5 commits intoPaddlePaddle:developfrom
luotao1:pre_commit
Closed

[TEST] enable pre-commit#15876
luotao1 wants to merge 5 commits intoPaddlePaddle:developfrom
luotao1:pre_commit

Conversation

@luotao1
Copy link
Contributor

@luotao1 luotao1 commented Feb 22, 2019

DO NOT MERGE.

@luotao1
Copy link
Contributor Author

luotao1 commented Feb 22, 2019

travis-ci上的cpplint没起作用。在05241a0 中删去一个string头文件后,本地效果为

CRLF end-lines remover...............................(no files to check)Skipped
yapf.................................................(no files to check)Skipped
Check for added large files..............................................Passed
Check for merge conflicts................................................Passed
Check for broken symlinks................................................Passed
Detect Private Key...................................(no files to check)Skipped
Fix End of Files.........................................................Passed
clang-format.............................................................Passed
cpplint..................................................................Failed
hookid: cpplint-cpp-source

Ignoring .travis.yml; not a valid file name (c, cc, h, hpp, c++, h++, cu, cpp, hxx, cxx, cuh)
Done processing .travis.yml
paddle/fluid/framework/async_executor.h:90:  Add #include <string> for string  [build/include_what_you_use] [4]
Done processing paddle/fluid/framework/async_executor.h
Total errors found: 1

pylint...............................................(no files to check)Skipped
go fmt...............................................(no files to check)Skipped
copyright_checker........................................................Passed

但travis-ci能过,https://travis-ci.org/PaddlePaddle/Paddle/builds/496920263#L782。
初步怀疑cpplint没装对。

@luotao1
Copy link
Contributor Author

luotao1 commented Feb 22, 2019

c9edb61 已经能正确查出所有cpplint的错误。travis-ci跑一遍时间为10分钟,时间上是可以接受的。 @dzhwinter @tianshuo78520a
暴露的错误非常多,比如

paddle/fluid/operators/mul_op.cc:135:  Add #include <unordered_map> for unordered_map<>  [build/include_what_you_use] [4]
paddle/fluid/operators/mul_op.cc:169:  Add #include <memory> for unique_ptr<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ngraph_bridge.cc:34:  Add #include <memory> for shared_ptr<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ngraph_bridge.h:43:  Add #include <memory> for shared_ptr<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ngraph_engine.cc:197:  Add #include <utility> for move  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ngraph_engine.cc:291:  Add #include <unordered_set> for unordered_set<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ngraph_engine.cc:456:  Add #include <memory> for shared_ptr<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ngraph_engine.h:0:  No #ifndef header guard found, suggested CPP variable is: PADDLE_FLUID_OPERATORS_NGRAPH_NGRAPH_ENGINE_H_  [build/header_guard] [5]
paddle/fluid/operators/ngraph/ngraph_engine.h:57:  Add #include <unordered_set> for unordered_set<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ngraph_engine.h:81:  Add #include <memory> for shared_ptr<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ops/accuracy_op.h:30:  Add #include <unordered_map> for unordered_map<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ops/accuracy_op.h:58:  Add #include <memory> for make_shared<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ops/activation_op.h:41:  Add #include <memory> for shared_ptr<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ops/activation_op.h:41:  Add #include <unordered_map> for unordered_map<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ops/batch_norm_op.h:98:  Add #include <unordered_map> for unordered_map<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ops/batch_norm_op.h:143:  Add #include <memory> for make_shared<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ops/binary_unary_op.h:42:  Add #include <unordered_map> for unordered_map<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ops/binary_unary_op.h:45:  Add #include <memory> for make_shared<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ops/conv2d_op.h:192:  Add #include <unordered_map> for unordered_map<>  [build/include_what_you_use] [4]
paddle/fluid/operators/ngraph/ops/conv2d_op.h:220:  Add #include <memory> for make_shared<>  [build/include_what_you_use] [4]

https://travis-ci.org/PaddlePaddle/Paddle/builds/496983517#L5464

pylint应该有同样问题。 @gongweibao

@luotao1 luotao1 mentioned this pull request Feb 25, 2019
@luotao1 luotao1 closed this Feb 27, 2019
@luotao1 luotao1 deleted the pre_commit branch February 27, 2019 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant