diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1b138752ed..dd804eb588 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -64,7 +64,7 @@ repos: - --linelength=240 # https://google.github.io/styleguide/cppguide.html # relevant rules are whitelisted, see all options with: cpplint --filter= - - --filter=-build,-legal,-readability,-runtime,-whitespace,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+readability/braces + - --filter=-build,-legal,-readability,-runtime,-whitespace,+build/include_subdir,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+readability/braces - repo: local hooks: - id: test_translations diff --git a/common/swaglog.cc b/common/swaglog.cc index c0614c85f5..923f701ab2 100644 --- a/common/swaglog.cc +++ b/common/swaglog.cc @@ -12,7 +12,7 @@ #include #include -#include "json11.hpp" +#include "third_party/json11/json11.hpp" #include "common/util.h" #include "common/version.h" diff --git a/common/tests/test_swaglog.cc b/common/tests/test_swaglog.cc index 20455ec74c..021656a78b 100644 --- a/common/tests/test_swaglog.cc +++ b/common/tests/test_swaglog.cc @@ -3,7 +3,7 @@ #define CATCH_CONFIG_MAIN #include "catch2/catch.hpp" -#include "json11.hpp" +#include "third_party/json11/json11.hpp" #include "common/swaglog.h" #include "common/util.h" #include "common/version.h" diff --git a/common/transformations/coordinates.cc b/common/transformations/coordinates.cc index b729ac3d87..5b00b53a4f 100644 --- a/common/transformations/coordinates.cc +++ b/common/transformations/coordinates.cc @@ -1,13 +1,11 @@ #define _USE_MATH_DEFINES +#include "common/transformations/coordinates.hpp" + #include #include #include -#include "coordinates.hpp" - - - double a = 6378137; // lgtm [cpp/short-global-name] double b = 6356752.3142; // lgtm [cpp/short-global-name] double esq = 6.69437999014 * 0.001; // lgtm [cpp/short-global-name] diff --git a/common/transformations/coordinates.hpp b/common/transformations/coordinates.hpp index f5ba0d3fe7..32ec2ff66e 100644 --- a/common/transformations/coordinates.hpp +++ b/common/transformations/coordinates.hpp @@ -1,5 +1,7 @@ #pragma once +#include + #define DEG2RAD(x) ((x) * M_PI / 180.0) #define RAD2DEG(x) ((x) * 180.0 / M_PI) diff --git a/common/transformations/orientation.cc b/common/transformations/orientation.cc index 7909c0affb..00888c3a92 100644 --- a/common/transformations/orientation.cc +++ b/common/transformations/orientation.cc @@ -4,8 +4,8 @@ #include #include -#include "orientation.hpp" -#include "coordinates.hpp" +#include "common/transformations/orientation.hpp" +#include "common/transformations/coordinates.hpp" Eigen::Quaterniond ensure_unique(Eigen::Quaterniond quat){ if (quat.w() > 0){ diff --git a/common/transformations/orientation.hpp b/common/transformations/orientation.hpp index ebd7da0aee..150b12cade 100644 --- a/common/transformations/orientation.hpp +++ b/common/transformations/orientation.hpp @@ -1,6 +1,6 @@ #pragma once #include -#include "coordinates.hpp" +#include "common/transformations/coordinates.hpp" Eigen::Quaterniond ensure_unique(Eigen::Quaterniond quat); diff --git a/selfdrive/boardd/can_list_to_can_capnp.cc b/selfdrive/boardd/can_list_to_can_capnp.cc index c1778c51a2..72ca72688a 100644 --- a/selfdrive/boardd/can_list_to_can_capnp.cc +++ b/selfdrive/boardd/can_list_to_can_capnp.cc @@ -1,5 +1,5 @@ #include "cereal/messaging/messaging.h" -#include "panda.h" +#include "selfdrive/boardd/panda.h" void can_list_to_can_capnp_cpp(const std::vector &can_list, std::string &out, bool sendCan, bool valid) { MessageBuilder msg; diff --git a/selfdrive/locationd/liblocationd.cc b/selfdrive/locationd/liblocationd.cc index 6f298deab6..e2b85d93a1 100755 --- a/selfdrive/locationd/liblocationd.cc +++ b/selfdrive/locationd/liblocationd.cc @@ -1,4 +1,4 @@ -#include "locationd.h" +#include "selfdrive/locationd/locationd.h" extern "C" { typedef Localizer* Localizer_t; diff --git a/selfdrive/locationd/locationd.cc b/selfdrive/locationd/locationd.cc index 722ead7dd4..3a4286a18b 100755 --- a/selfdrive/locationd/locationd.cc +++ b/selfdrive/locationd/locationd.cc @@ -1,3 +1,5 @@ +#include "selfdrive/locationd/locationd.h" + #include #include @@ -5,8 +7,6 @@ #include #include -#include "locationd.h" - using namespace EKFS; using namespace Eigen; diff --git a/selfdrive/locationd/models/live_kf.cc b/selfdrive/locationd/models/live_kf.cc index f8c03365e1..915d0fd360 100755 --- a/selfdrive/locationd/models/live_kf.cc +++ b/selfdrive/locationd/models/live_kf.cc @@ -1,4 +1,4 @@ -#include "live_kf.h" +#include "selfdrive/locationd/models/live_kf.h" using namespace EKFS; using namespace Eigen; diff --git a/selfdrive/modeld/runners/run.h b/selfdrive/modeld/runners/run.h index c64f300fe2..7f6e1aa569 100644 --- a/selfdrive/modeld/runners/run.h +++ b/selfdrive/modeld/runners/run.h @@ -1,10 +1,10 @@ #pragma once -#include "runmodel.h" -#include "snpemodel.h" +#include "selfdrive/modeld/runners/runmodel.h" +#include "selfdrive/modeld/runners/snpemodel.h" #if defined(USE_THNEED) -#include "thneedmodel.h" +#include "selfdrive/modeld/runners/thneedmodel.h" #elif defined(USE_ONNX_MODEL) -#include "onnxmodel.h" +#include "selfdrive/modeld/runners/onnxmodel.h" #endif diff --git a/selfdrive/modeld/thneed/serialize.cc b/selfdrive/modeld/thneed/serialize.cc index 51e6d08699..6ed5c08e81 100644 --- a/selfdrive/modeld/thneed/serialize.cc +++ b/selfdrive/modeld/thneed/serialize.cc @@ -1,7 +1,7 @@ #include #include -#include "json11.hpp" +#include "third_party/json11/json11.hpp" #include "common/util.h" #include "common/clutil.h" #include "selfdrive/modeld/thneed/thneed.h" diff --git a/selfdrive/modeld/thneed/thneed.h b/selfdrive/modeld/thneed/thneed.h index 6475577734..47e18e0be3 100644 --- a/selfdrive/modeld/thneed/thneed.h +++ b/selfdrive/modeld/thneed/thneed.h @@ -12,7 +12,7 @@ #include -#include "msm_kgsl.h" +#include "third_party/linux/include/msm_kgsl.h" using namespace std; diff --git a/selfdrive/ui/qt/maps/map_settings.cc b/selfdrive/ui/qt/maps/map_settings.cc index 48a7733c52..a4386ded72 100644 --- a/selfdrive/ui/qt/maps/map_settings.cc +++ b/selfdrive/ui/qt/maps/map_settings.cc @@ -1,4 +1,4 @@ -#include "map_settings.h" +#include "selfdrive/ui/qt/maps/map_settings.h" #include diff --git a/system/camerad/cameras/camera_common.cc b/system/camerad/cameras/camera_common.cc index 1eb636b7a2..23b28357da 100644 --- a/system/camerad/cameras/camera_common.cc +++ b/system/camerad/cameras/camera_common.cc @@ -8,7 +8,7 @@ #include #include -#include "libyuv.h" +#include "third_party/libyuv/include/libyuv.h" #include #include "system/camerad/imgproc/utils.h" @@ -17,7 +17,7 @@ #include "common/swaglog.h" #include "common/util.h" #include "system/hardware/hw.h" -#include "msm_media_info.h" +#include "third_party/linux/include/msm_media_info.h" #include "system/camerad/cameras/camera_qcom2.h" #ifdef QCOM2 diff --git a/system/camerad/test/ae_gray_test.cc b/system/camerad/test/ae_gray_test.cc index aabd7534ee..8d18f7e93b 100644 --- a/system/camerad/test/ae_gray_test.cc +++ b/system/camerad/test/ae_gray_test.cc @@ -1,6 +1,6 @@ // unittest for set_exposure_target -#include "ae_gray_test.h" +#include "system/camerad/test/ae_gray_test.h" #include diff --git a/system/logcatd/logcatd_systemd.cc b/system/logcatd/logcatd_systemd.cc index 721726ed27..54b3782132 100644 --- a/system/logcatd/logcatd_systemd.cc +++ b/system/logcatd/logcatd_systemd.cc @@ -5,7 +5,7 @@ #include #include -#include "json11.hpp" +#include "third_party/json11/json11.hpp" #include "cereal/messaging/messaging.h" #include "common/timing.h" diff --git a/system/loggerd/encoder/ffmpeg_encoder.cc b/system/loggerd/encoder/ffmpeg_encoder.cc index b73f4e8f5d..dc20ea8791 100644 --- a/system/loggerd/encoder/ffmpeg_encoder.cc +++ b/system/loggerd/encoder/ffmpeg_encoder.cc @@ -11,7 +11,7 @@ #define __STDC_CONSTANT_MACROS -#include "libyuv.h" +#include "third_party/libyuv/include/libyuv.h" extern "C" { #include diff --git a/system/loggerd/encoder/v4l_encoder.cc b/system/loggerd/encoder/v4l_encoder.cc index 2f74c3785a..b09fa1e6ba 100644 --- a/system/loggerd/encoder/v4l_encoder.cc +++ b/system/loggerd/encoder/v4l_encoder.cc @@ -7,11 +7,11 @@ #include "common/util.h" #include "common/timing.h" -#include "libyuv.h" -#include "msm_media_info.h" +#include "third_party/libyuv/include/libyuv.h" +#include "third_party/linux/include/msm_media_info.h" // has to be in this order -#include "v4l2-controls.h" +#include "third_party/linux/include/v4l2-controls.h" #include #define V4L2_QCOM_BUF_FLAG_CODECCONFIG 0x00020000 #define V4L2_QCOM_BUF_FLAG_EOS 0x02000000 diff --git a/system/sensord/sensors/bmx055_accel.cc b/system/sensord/sensors/bmx055_accel.cc index 0c48d1e3ba..bdb0113de3 100644 --- a/system/sensord/sensors/bmx055_accel.cc +++ b/system/sensord/sensors/bmx055_accel.cc @@ -1,4 +1,4 @@ -#include "bmx055_accel.h" +#include "system/sensord/sensors/bmx055_accel.h" #include diff --git a/system/sensord/sensors/bmx055_gyro.cc b/system/sensord/sensors/bmx055_gyro.cc index ba41f3b47c..411b2f445e 100644 --- a/system/sensord/sensors/bmx055_gyro.cc +++ b/system/sensord/sensors/bmx055_gyro.cc @@ -1,4 +1,4 @@ -#include "bmx055_gyro.h" +#include "system/sensord/sensors/bmx055_gyro.h" #include #include diff --git a/system/sensord/sensors/bmx055_magn.cc b/system/sensord/sensors/bmx055_magn.cc index 950e608923..585bf1b2d2 100644 --- a/system/sensord/sensors/bmx055_magn.cc +++ b/system/sensord/sensors/bmx055_magn.cc @@ -1,4 +1,4 @@ -#include "bmx055_magn.h" +#include "system/sensord/sensors/bmx055_magn.h" #include diff --git a/system/sensord/sensors/bmx055_temp.cc b/system/sensord/sensors/bmx055_temp.cc index 68ee0da1d6..da7b86476c 100644 --- a/system/sensord/sensors/bmx055_temp.cc +++ b/system/sensord/sensors/bmx055_temp.cc @@ -1,4 +1,4 @@ -#include "bmx055_temp.h" +#include "system/sensord/sensors/bmx055_temp.h" #include diff --git a/system/sensord/sensors/i2c_sensor.cc b/system/sensord/sensors/i2c_sensor.cc index f563f93d2b..90220f551d 100644 --- a/system/sensord/sensors/i2c_sensor.cc +++ b/system/sensord/sensors/i2c_sensor.cc @@ -1,4 +1,4 @@ -#include "i2c_sensor.h" +#include "system/sensord/sensors/i2c_sensor.h" int16_t read_12_bit(uint8_t lsb, uint8_t msb) { uint16_t combined = (uint16_t(msb) << 8) | uint16_t(lsb & 0xF0); diff --git a/system/sensord/sensors/lsm6ds3_accel.cc b/system/sensord/sensors/lsm6ds3_accel.cc index 139b5df67a..03533e0657 100644 --- a/system/sensord/sensors/lsm6ds3_accel.cc +++ b/system/sensord/sensors/lsm6ds3_accel.cc @@ -1,4 +1,4 @@ -#include "lsm6ds3_accel.h" +#include "system/sensord/sensors/lsm6ds3_accel.h" #include #include diff --git a/system/sensord/sensors/lsm6ds3_gyro.cc b/system/sensord/sensors/lsm6ds3_gyro.cc index e6bdc6c8a9..0459b6ad64 100644 --- a/system/sensord/sensors/lsm6ds3_gyro.cc +++ b/system/sensord/sensors/lsm6ds3_gyro.cc @@ -1,4 +1,4 @@ -#include "lsm6ds3_gyro.h" +#include "system/sensord/sensors/lsm6ds3_gyro.h" #include #include diff --git a/system/sensord/sensors/lsm6ds3_temp.cc b/system/sensord/sensors/lsm6ds3_temp.cc index c2e2c83c1d..f481614154 100644 --- a/system/sensord/sensors/lsm6ds3_temp.cc +++ b/system/sensord/sensors/lsm6ds3_temp.cc @@ -1,4 +1,4 @@ -#include "lsm6ds3_temp.h" +#include "system/sensord/sensors/lsm6ds3_temp.h" #include diff --git a/system/sensord/sensors/mmc5603nj_magn.cc b/system/sensord/sensors/mmc5603nj_magn.cc index b69c602bdf..0e8ba967e3 100644 --- a/system/sensord/sensors/mmc5603nj_magn.cc +++ b/system/sensord/sensors/mmc5603nj_magn.cc @@ -1,4 +1,4 @@ -#include "mmc5603nj_magn.h" +#include "system/sensord/sensors/mmc5603nj_magn.h" #include #include diff --git a/system/ubloxd/ublox_msg.cc b/system/ubloxd/ublox_msg.cc index 48a39b7bef..7b4505dc81 100644 --- a/system/ubloxd/ublox_msg.cc +++ b/system/ubloxd/ublox_msg.cc @@ -1,4 +1,4 @@ -#include "ublox_msg.h" +#include "system/ubloxd/ublox_msg.h" #include diff --git a/tools/cabana/streams/socketcanstream.cc b/tools/cabana/streams/socketcanstream.cc index d5f9d115f2..3df8e31f3b 100644 --- a/tools/cabana/streams/socketcanstream.cc +++ b/tools/cabana/streams/socketcanstream.cc @@ -1,5 +1,4 @@ #include "tools/cabana/streams/socketcanstream.h" -#include "socketcanstream.h" #include #include diff --git a/tools/lib/vidindex/bitstream.c b/tools/lib/vidindex/bitstream.c index d174ffa8a7..dc6f43f14f 100644 --- a/tools/lib/vidindex/bitstream.c +++ b/tools/lib/vidindex/bitstream.c @@ -1,8 +1,8 @@ +#include "./bitstream.h" + #include #include -#include "bitstream.h" - static const uint32_t BS_MASKS[33] = { 0, 0x1L, 0x3L, 0x7L, 0xFL, 0x1FL, 0x3FL, 0x7FL, 0xFFL, 0x1FFL, 0x3FFL, 0x7FFL, diff --git a/tools/lib/vidindex/vidindex.c b/tools/lib/vidindex/vidindex.c index 4857c60dd2..1d7da2e193 100644 --- a/tools/lib/vidindex/vidindex.c +++ b/tools/lib/vidindex/vidindex.c @@ -9,7 +9,7 @@ #include #include -#include "bitstream.h" +#include "./bitstream.h" #define START_CODE 0x000001 diff --git a/tools/replay/camera.cc b/tools/replay/camera.cc index 2bc8c66aaa..49f3010c6c 100644 --- a/tools/replay/camera.cc +++ b/tools/replay/camera.cc @@ -1,10 +1,11 @@ #include "tools/replay/camera.h" -#include "tools/replay/util.h" -#include "msm_media_info.h" #include #include +#include "third_party/linux/include/msm_media_info.h" +#include "tools/replay/util.h" + std::tuple get_nv12_info(int width, int height) { int nv12_width = VENUS_Y_STRIDE(COLOR_FMT_NV12, width); int nv12_height = VENUS_Y_SCANLINES(COLOR_FMT_NV12, height); diff --git a/tools/replay/framereader.cc b/tools/replay/framereader.cc index f45996560e..303f0c60ca 100644 --- a/tools/replay/framereader.cc +++ b/tools/replay/framereader.cc @@ -3,7 +3,7 @@ #include #include -#include "libyuv.h" +#include "third_party/libyuv/include/libyuv.h" #ifdef __APPLE__ #define HW_DEVICE_TYPE AV_HWDEVICE_TYPE_VIDEOTOOLBOX