Unverified Commit 9c0e457c authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[c++][ci] fix `include_what_you_use` errors from cpplint (#7052)



* dev

* dev

* dev

* Update static_analysis.yml

* Update .pre-commit-config.yaml

---------
Co-authored-by: default avatarJames Lamb <jaylamb20@gmail.com>
parent 1f3e3837
......@@ -289,7 +289,13 @@ def gen_parameter_code(
* This file is auto generated by LightGBM\.ci\parameter-generator.py from LightGBM\include\LightGBM\config.h file.
*/
"""
str_to_write += "#include<LightGBM/config.h>\nnamespace LightGBM {\n"
str_to_write += "#include <LightGBM/config.h>\n\n"
str_to_write += "#include <string>\n"
str_to_write += "#include <unordered_map>\n"
str_to_write += "#include <unordered_set>\n"
str_to_write += "#include <vector>\n\n"
str_to_write += "namespace LightGBM {\n"
# alias table
str_to_write += "const std::unordered_map<std::string, std::string>& Config::alias_table() {\n"
str_to_write += " static std::unordered_map<std::string, std::string> aliases({\n"
......
......@@ -28,7 +28,7 @@ repos:
- id: cpplint
args:
- --recursive
- --filter=-build/include_subdir,-build/include_what_you_use,-build/header_guard,-whitespace/indent_namespace,-whitespace/line_length
- --filter=-build/include_subdir,-build/header_guard,-whitespace/indent_namespace,-whitespace/line_length
- repo: local
hooks:
- id: check-omp-pragmas
......
......@@ -16,13 +16,16 @@
#include <LightGBM/utils/openmp_wrapper.h>
#include <LightGBM/utils/text_reader.h>
#include <string>
#include <chrono>
#include <cstdio>
#include <ctime>
#include <fstream>
#include <memory>
#include <sstream>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include "predictor.hpp"
......
......@@ -4,6 +4,9 @@
*/
#include <LightGBM/boosting.h>
#include <memory>
#include <string>
#include "dart.hpp"
#include "gbdt.h"
#include "rf.hpp"
......
......@@ -12,10 +12,16 @@
#include <LightGBM/utils/openmp_wrapper.h>
#include <LightGBM/sample_strategy.h>
#include <algorithm>
#include <chrono>
#include <ctime>
#include <memory>
#include <queue>
#include <sstream>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
namespace LightGBM {
......
......@@ -8,8 +8,11 @@
#include <LightGBM/utils/array_args.h>
#include <LightGBM/utils/common.h>
#include <algorithm>
#include <string>
#include <sstream>
#include <unordered_map>
#include <utility>
#include <vector>
#include "gbdt.h"
......
......@@ -6,6 +6,8 @@
#include <LightGBM/prediction_early_stop.h>
#include <LightGBM/utils/openmp_wrapper.h>
#include <unordered_map>
#include "gbdt.h"
namespace LightGBM {
......
......@@ -6,9 +6,11 @@
#include <LightGBM/utils/log.h>
#include <limits>
#include <algorithm>
#include <cmath>
#include <functional>
#include <limits>
#include <string>
#include <vector>
namespace LightGBM {
......
......@@ -4,6 +4,9 @@
*/
#include <LightGBM/sample_strategy.h>
#include <string>
#include "goss.hpp"
#include "bagging.hpp"
......
......@@ -20,13 +20,16 @@
#include <LightGBM/utils/random.h>
#include <LightGBM/utils/threading.h>
#include <string>
#include <cstdio>
#include <algorithm>
#include <cstdint>
#include <cstdio>
#include <functional>
#include <memory>
#include <mutex>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include "application/predictor.hpp"
......
......@@ -9,6 +9,8 @@
#include <LightGBM/cuda/cuda_algorithms.hpp>
#include <LightGBM/cuda/cuda_rocm_interop.h>
#include <algorithm>
namespace LightGBM {
template <typename T>
......
......@@ -12,6 +12,8 @@
#include <cmath>
#include <cstdint>
#include <cstring>
#include <limits>
#include <vector>
#include "dense_bin.hpp"
#include "multi_val_dense_bin.hpp"
......
......@@ -9,7 +9,12 @@
#include <LightGBM/utils/log.h>
#include <LightGBM/utils/random.h>
#include <algorithm>
#include <limits>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
namespace LightGBM {
......
......@@ -5,7 +5,13 @@
* \note
* This file is auto generated by LightGBM\.ci\parameter-generator.py from LightGBM\include\LightGBM\config.h file.
*/
#include<LightGBM/config.h>
#include <LightGBM/config.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
namespace LightGBM {
const std::unordered_map<std::string, std::string>& Config::alias_table() {
static std::unordered_map<std::string, std::string> aliases({
......
......@@ -8,6 +8,7 @@
#include <LightGBM/cuda/cuda_column_data.hpp>
#include <cstdint>
#include <vector>
namespace LightGBM {
......
......@@ -7,6 +7,8 @@
#include <LightGBM/cuda/cuda_metadata.hpp>
#include <vector>
namespace LightGBM {
CUDAMetadata::CUDAMetadata(const int gpu_device_id) {
......
......@@ -7,6 +7,8 @@
#include <LightGBM/cuda/cuda_row_data.hpp>
#include <vector>
namespace LightGBM {
CUDARowData::CUDARowData(const Dataset* train_data,
......
......@@ -11,11 +11,17 @@
#include <LightGBM/utils/openmp_wrapper.h>
#include <LightGBM/utils/threading.h>
#include <algorithm>
#include <chrono>
#include <cstdio>
#include <limits>
#include <memory>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
namespace LightGBM {
......
......@@ -10,8 +10,15 @@
#include <LightGBM/utils/log.h>
#include <LightGBM/utils/openmp_wrapper.h>
#include <algorithm>
#include <chrono>
#include <fstream>
#include <memory>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
namespace LightGBM {
......
......@@ -8,7 +8,10 @@
#include <LightGBM/utils/log.h>
#include <algorithm>
#include <cstdio>
#include <memory>
#include <sstream>
#include <string>
#include <unordered_map>
namespace LightGBM {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment