cpplint: `build/include_what_you_use` (#29556)

* include_what_you_use

* remove comments

* include <memory>

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 2d99521e75
This commit is contained in:
Dean Lee 2023-08-24 04:25:17 +08:00 committed by GitHub
parent ca666855d5
commit 97e9d55588
102 changed files with 260 additions and 7 deletions

View File

@ -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/deprecated,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+readability/braces
- --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,+readability/braces
- repo: local
hooks:
- id: test_translations

View File

@ -1,5 +1,7 @@
#include "common/gpio.h"
#include <string>
#ifdef __APPLE__
int gpio_init(int pin_nr, bool output) {
return 0;

View File

@ -1,5 +1,7 @@
#include "common/ratekeeper.h"
#include <algorithm>
#include "common/swaglog.h"
#include "common/timing.h"
#include "common/util.h"

View File

@ -1,3 +1,5 @@
#include <string>
#include "common/watchdog.h"
#include "common/util.h"

View File

@ -18,6 +18,7 @@
#include <cstdio>
#include <cstdlib>
#include <future>
#include <memory>
#include <thread>
#include "cereal/gen/cpp/car.capnp.h"

View File

@ -1,5 +1,8 @@
#pragma once
#include <string>
#include <vector>
#include "selfdrive/boardd/panda.h"
bool safety_setter_thread(std::vector<Panda *> pandas);

View File

@ -4,6 +4,7 @@
#include <cassert>
#include <stdexcept>
#include <vector>
#include "cereal/messaging/messaging.h"
#include "common/swaglog.h"

View File

@ -6,6 +6,7 @@
#include <list>
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "cereal/gen/cpp/car.capnp.h"

View File

@ -1,7 +1,9 @@
#include <sys/time.h>
#include <sys/resource.h>
#include <algorithm>
#include <cmath>
#include <vector>
#include "locationd.h"

View File

@ -1,6 +1,7 @@
#pragma once
#include <eigen3/Eigen/Dense>
#include <deque>
#include <fstream>
#include <memory>
#include <map>

View File

@ -3,6 +3,8 @@
#include <string>
#include <cmath>
#include <memory>
#include <unordered_map>
#include <vector>
#include <eigen3/Eigen/Core>
#include <eigen3/Eigen/Dense>

View File

@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "selfdrive/modeld/runners/runmodel.h"
class ONNXModel : public RunModel {

View File

@ -3,6 +3,10 @@
#include "selfdrive/modeld/runners/snpemodel.h"
#include <cstring>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "common/util.h"
#include "common/timing.h"

View File

@ -1,6 +1,10 @@
#pragma once
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#include <memory>
#include <string>
#include <utility>
#include <DlContainer/IDlContainer.hpp>
#include <DlSystem/DlError.hpp>
#include <DlSystem/ITensor.hpp>

View File

@ -1,5 +1,7 @@
#include "selfdrive/modeld/runners/thneedmodel.h"
#include <string>
#include "common/swaglog.h"
ThneedModel::ThneedModel(const std::string path, float *_output, size_t _output_size, int runtime, bool luse_tf8, cl_context context) {

View File

@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "selfdrive/modeld/runners/runmodel.h"
#include "selfdrive/modeld/thneed/thneed.h"

View File

@ -4,6 +4,7 @@
#include <cstdlib>
#include <fstream>
#include <map>
#include <string>
#include <QDebug>
#include <QDir>

View File

@ -12,6 +12,8 @@
#include <QJsonDocument>
#include <QNetworkRequest>
#include <string>
#include "common/params.h"
#include "common/util.h"
#include "system/hardware/hw.h"

View File

@ -1,5 +1,9 @@
#include "selfdrive/ui/qt/maps/map_helpers.h"
#include <algorithm>
#include <string>
#include <utility>
#include <QJsonDocument>
#include <QJsonObject>

View File

@ -1,6 +1,8 @@
#pragma once
#include <optional>
#include <string>
#include <utility>
#include <eigen3/Eigen/Dense>
#include <QMapboxGL>
#include <QGeoCoordinate>

View File

@ -1,5 +1,8 @@
#pragma once
#include <map>
#include <vector>
#include <QHash>
#include <QHBoxLayout>
#include <QLabel>

View File

@ -1,5 +1,7 @@
#include "map_settings.h"
#include <utility>
#include <QApplication>
#include <QDebug>

View File

@ -1,5 +1,7 @@
#pragma once
#include <vector>
#include <QFrame>
#include <QJsonArray>
#include <QJsonDocument>

View File

@ -1,5 +1,6 @@
#include "selfdrive/ui/qt/offroad/driverview.h"
#include <algorithm>
#include <QPainter>
#include "selfdrive/ui/qt/qt_window.h"

View File

@ -1,5 +1,7 @@
#pragma once
#include <vector>
#include "selfdrive/ui/qt/offroad/wifiManager.h"
#include "selfdrive/ui/qt/widgets/input.h"
#include "selfdrive/ui/qt/widgets/ssh_keys.h"

View File

@ -1,5 +1,7 @@
#include "selfdrive/ui/qt/offroad/onboarding.h"
#include <string>
#include <QLabel>
#include <QPainter>
#include <QQmlContext>

View File

@ -3,6 +3,8 @@
#include <cassert>
#include <cmath>
#include <string>
#include <tuple>
#include <vector>
#include <QDebug>

View File

@ -1,5 +1,8 @@
#pragma once
#include <map>
#include <string>
#include <QButtonGroup>
#include <QFrame>
#include <QLabel>

View File

@ -1,6 +1,9 @@
#include "selfdrive/ui/qt/onroad.h"
#include <algorithm>
#include <cmath>
#include <map>
#include <memory>
#include <QDebug>
#include <QMouseEvent>

View File

@ -1,5 +1,7 @@
#pragma once
#include <memory>
#include <QPushButton>
#include <QStackedLayout>
#include <QWidget>

View File

@ -10,6 +10,8 @@
#include <curl/curl.h>
#include <string>
#include "common/util.h"
#include "system/hardware/hw.h"
#include "selfdrive/ui/qt/api.h"

View File

@ -1,5 +1,7 @@
#pragma once
#include <memory>
#include <QFrame>
#include <QMap>

View File

@ -1,5 +1,6 @@
#include "selfdrive/ui/qt/spinner.h"
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>

View File

@ -1,5 +1,9 @@
#include "selfdrive/ui/qt/util.h"
#include <map>
#include <string>
#include <vector>
#include <QApplication>
#include <QFile>
#include <QFileInfo>

View File

@ -1,6 +1,7 @@
#pragma once
#include <optional>
#include <vector>
#include <QDateTime>
#include <QFileSystemWatcher>

View File

@ -7,6 +7,9 @@
#endif
#include <cmath>
#include <set>
#include <string>
#include <utility>
#include <QOpenGLBuffer>
#include <QOffscreenSurface>

View File

@ -1,7 +1,12 @@
#pragma once
#include <deque>
#include <map>
#include <memory>
#include <mutex>
#include <set>
#include <string>
#include <utility>
#include <QOpenGLFunctions>
#include <QOpenGLShaderProgram>

View File

@ -1,5 +1,8 @@
#pragma once
#include <string>
#include <vector>
#include <QButtonGroup>
#include <QFrame>
#include <QHBoxLayout>

View File

@ -1,5 +1,7 @@
#pragma once
#include <vector>
#include <QFrame>
#include <QPushButton>
#include <QStackedLayout>

View File

@ -1,5 +1,10 @@
#include "selfdrive/ui/qt/widgets/offroad_alerts.h"
#include <algorithm>
#include <string>
#include <vector>
#include <utility>
#include <QHBoxLayout>
#include <QJsonDocument>
#include <QJsonObject>

View File

@ -1,6 +1,7 @@
#pragma once
#include <map>
#include <string>
#include <QLabel>
#include <QPushButton>

View File

@ -1,3 +1,5 @@
#include <tuple>
#include <QMap>
#include <QSoundEffect>
#include <QString>

View File

@ -1,5 +1,6 @@
#include "selfdrive/ui/ui.h"
#include <algorithm>
#include <cassert>
#include <cmath>

View File

@ -1,5 +1,6 @@
#pragma once
#include <map>
#include <memory>
#include <string>
#include <optional>

View File

@ -5,6 +5,7 @@
#include <cassert>
#include <cstdio>
#include <chrono>
#include <string>
#include <thread>
#include "libyuv.h"

View File

@ -6,12 +6,15 @@
#include <sys/mman.h>
#include <unistd.h>
#include <algorithm>
#include <atomic>
#include <cassert>
#include <cerrno>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include "media/cam_defs.h"
#include "media/cam_isp.h"

View File

@ -2,6 +2,9 @@
#include <cstdlib>
#include <fstream>
#include <map>
#include <string>
#include "cereal/messaging/messaging.h"
// no-op base hw class

View File

@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "system/hardware/base.h"
#include "common/util.h"

View File

@ -1,5 +1,7 @@
#pragma once
#include <string>
#include "system/hardware/base.h"
class HardwarePC : public HardwareNone {

View File

@ -2,6 +2,8 @@
#include <cstdlib>
#include <fstream>
#include <map>
#include <string>
#include "common/params.h"
#include "common/util.h"

View File

@ -2,6 +2,7 @@
#include <cassert>
#include <cstdint>
#include <memory>
#include <thread>
#include "cereal/messaging/messaging.h"

View File

@ -1,4 +1,5 @@
#include <cassert>
#include <string>
#include <sys/ioctl.h>
#include <poll.h>

View File

@ -13,7 +13,10 @@
#include <ctime>
#include <fstream>
#include <iostream>
#include <map>
#include <streambuf>
#include <string>
#include <vector>
#include "common/params.h"
#include "common/swaglog.h"

View File

@ -1,11 +1,12 @@
#pragma once
#include <cassert>
#include <pthread.h>
#include <cassert>
#include <cstdint>
#include <cstdio>
#include <memory>
#include <string>
#include <capnp/serialize.h>
#include <kj/array.h>

View File

@ -1,6 +1,10 @@
#include <sys/xattr.h>
#include <map>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include "system/loggerd/encoder/encoder.h"
#include "system/loggerd/loggerd.h"

View File

@ -1,5 +1,7 @@
#pragma once
#include <vector>
#include "cereal/messaging/messaging.h"
#include "cereal/services.h"
#include "cereal/visionipc/visionipc_client.h"

View File

@ -2,6 +2,7 @@
#include <cstdint>
#include <unistd.h>
#include <vector>
#include "cereal/gen/cpp/log.capnp.h"
#include "common/i2c.h"

View File

@ -2,6 +2,7 @@
#include <unistd.h>
#include <algorithm>
#include <cassert>
#include <chrono>
#include <cmath>
@ -9,6 +10,7 @@
#include <cstdlib>
#include <ctime>
#include <unordered_map>
#include <utility>
#include "common/swaglog.h"

View File

@ -2,10 +2,11 @@
#include <cassert>
#include <cstdint>
#include <ctime>
#include <memory>
#include <string>
#include <unordered_map>
#include <ctime>
#include <utility>
#include "cereal/messaging/messaging.h"
#include "common/util.h"

View File

@ -1,5 +1,7 @@
#include "tools/cabana/binaryview.h"
#include <algorithm>
#include <QFontDatabase>
#include <QHeaderView>
#include <QMouseEvent>

View File

@ -1,5 +1,8 @@
#pragma once
#include <tuple>
#include <vector>
#include <QList>
#include <QSet>
#include <QStyledItemDelegate>

View File

@ -1,5 +1,8 @@
#include "tools/cabana/chart/chart.h"
#include <algorithm>
#include <limits>
#include <QActionGroup>
#include <QApplication>
#include <QDrag>

View File

@ -1,5 +1,8 @@
#pragma once
#include <tuple>
#include <utility>
#include <QGraphicsPixmapItem>
#include <QGraphicsProxyWidget>
#include <QtCharts/QChartView>

View File

@ -1,5 +1,7 @@
#include "tools/cabana/chart/chartswidget.h"
#include <algorithm>
#include <QApplication>
#include <QFutureSynchronizer>
#include <QMenu>

View File

@ -1,5 +1,8 @@
#pragma once
#include <unordered_map>
#include <utility>
#include <QGridLayout>
#include <QLabel>
#include <QScrollArea>

View File

@ -1,5 +1,6 @@
#include "tools/cabana/chart/sparkline.h"
#include <limits>
#include <QPainter>
#include "tools/cabana/streams/abstractstream.h"

View File

@ -1,5 +1,7 @@
#pragma once
#include <algorithm>
#include <QPixmap>
#include <QPointF>
#include <vector>

View File

@ -1,5 +1,7 @@
#include "tools/cabana/chart/tiplabel.h"
#include <utility>
#include <QApplication>
#include <QStylePainter>
#include <QToolTip>

View File

@ -1,5 +1,7 @@
#pragma once
#include <utility>
#include <QUndoCommand>
#include <QUndoStack>

View File

@ -1,5 +1,7 @@
#include "tools/cabana/dbc/dbc.h"
#include <algorithm>
#include "tools/cabana/util.h"
uint qHash(const MessageId &item) {

View File

@ -1,10 +1,14 @@
#pragma once
#include <limits>
#include <string>
#include <utility>
#include <vector>
#include <QColor>
#include <QList>
#include <QMetaType>
#include <QString>
#include <limits>
#include "opendbc/can/common_dbc.h"

View File

@ -3,6 +3,7 @@
#include <memory>
#include <map>
#include <set>
#include <vector>
#include "tools/cabana/dbc/dbcfile.h"

View File

@ -1,5 +1,7 @@
#include "tools/cabana/historylog.h"
#include <functional>
#include <QPainter>
#include <QPushButton>
#include <QVBoxLayout>

View File

@ -1,6 +1,8 @@
#pragma once
#include <deque>
#include <vector>
#include <QCheckBox>
#include <QComboBox>
#include <QHeaderView>

View File

@ -1,6 +1,9 @@
#include "tools/cabana/mainwin.h"
#include <algorithm>
#include <iostream>
#include <string>
#include <QClipboard>
#include <QDesktopWidget>
#include <QFile>

View File

@ -1,4 +1,10 @@
#include "tools/cabana/messageswidget.h"
#include <algorithm>
#include <limits>
#include <utility>
#include <vector>
#include <QHBoxLayout>
#include <QPainter>
#include <QPushButton>

View File

@ -1,5 +1,9 @@
#pragma once
#include <algorithm>
#include <utility>
#include <vector>
#include <QAbstractTableModel>
#include <QCheckBox>
#include <QContextMenuEvent>

View File

@ -1,5 +1,7 @@
#include "tools/cabana/signalview.h"
#include <algorithm>
#include <QCompleter>
#include <QDialogButtonBox>
#include <QHBoxLayout>

View File

@ -1,5 +1,7 @@
#pragma once
#include <memory>
#include <QAbstractItemModel>
#include <QLabel>
#include <QLineEdit>

View File

@ -1,5 +1,8 @@
#include "tools/cabana/streams/abstractstream.h"
#include <algorithm>
#include <vector>
#include <QTimer>
AbstractStream *can = nullptr;

View File

@ -3,7 +3,11 @@
#include <array>
#include <atomic>
#include <deque>
#include <memory>
#include <tuple>
#include <unordered_map>
#include <vector>
#include <QColor>
#include <QHash>

View File

@ -1,5 +1,8 @@
#include "tools/cabana/streams/devicestream.h"
#include <memory>
#include <string>
#include <QButtonGroup>
#include <QFormLayout>
#include <QRadioButton>

View File

@ -1,5 +1,8 @@
#include "tools/cabana/streams/livestream.h"
#include <algorithm>
#include <memory>
struct LiveStream::Logger {
Logger() : start_ts(seconds_since_epoch()), segment_num(-1) {}

View File

@ -1,5 +1,9 @@
#pragma once
#include <deque>
#include <memory>
#include <vector>
#include <QBasicTimer>
#include "tools/cabana/streams/abstractstream.h"

View File

@ -1,5 +1,7 @@
#include "tools/cabana/streams/pandastream.h"
#include <vector>
#include <QLabel>
#include <QMessageBox>
#include <QPushButton>

View File

@ -1,5 +1,8 @@
#pragma once
#include <memory>
#include <vector>
#include <QComboBox>
#include <QFormLayout>
#include <QVBoxLayout>

View File

@ -1,5 +1,11 @@
#pragma once
#include <algorithm>
#include <memory>
#include <set>
#include <tuple>
#include <vector>
#include "common/prefix.h"
#include "tools/cabana/streams/abstractstream.h"

View File

@ -1,5 +1,7 @@
#pragma once
#include <memory>
#include <QtSerialBus/QCanBus>
#include <QtSerialBus/QCanBusDevice>
#include <QtSerialBus/QCanBusDeviceInfo>

View File

@ -1,5 +1,8 @@
#pragma once
#include <algorithm>
#include <limits>
#include <QAbstractTableModel>
#include <QLabel>
#include <QPushButton>

View File

@ -1,5 +1,7 @@
#include "tools/cabana/tools/findsimilarbits.h"
#include <algorithm>
#include <QGridLayout>
#include <QHeaderView>
#include <QHBoxLayout>

View File

@ -1,7 +1,10 @@
#include "tools/cabana/util.h"
#include <algorithm>
#include <array>
#include <csignal>
#include <limits>
#include <string>
#include <sys/socket.h>
#include <unistd.h>

View File

@ -1,6 +1,8 @@
#pragma once
#include <cmath>
#include <vector>
#include <utility>
#include <QApplication>
#include <QByteArray>

View File

@ -1,5 +1,10 @@
#include "tools/cabana/videowidget.h"
#include <algorithm>
#include <memory>
#include <string>
#include <utility>
#include <QButtonGroup>
#include <QHBoxLayout>
#include <QMouseEvent>

View File

@ -1,7 +1,11 @@
#pragma once
#include <atomic>
#include <map>
#include <memory>
#include <mutex>
#include <tuple>
#include <vector>
#include <QFuture>
#include <QLabel>

View File

@ -1,6 +1,10 @@
#pragma once
#include <unistd.h>
#include <memory>
#include <utility>
#include "cereal/visionipc/visionipc_server.h"
#include "common/queue.h"
#include "tools/replay/framereader.h"

View File

@ -1,7 +1,11 @@
#include "tools/replay/consoleui.h"
#include <QApplication>
#include <initializer_list>
#include <string>
#include <tuple>
#include <utility>
#include <QApplication>
#include "common/version.h"

View File

@ -2,6 +2,7 @@
#include "tools/replay/util.h"
#include <cassert>
#include <algorithm>
#include "libyuv.h"
#include "cereal/visionipc/visionbuf.h"

View File

@ -5,7 +5,10 @@
#include <memory_resource>
#endif
#include <memory>
#include <set>
#include <string>
#include <vector>
#include "cereal/gen/cpp/log.capnp.h"
#include "system/camerad/cameras/camera_common.h"

View File

@ -1,6 +1,14 @@
#pragma once
#include <algorithm>
#include <map>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#include <utility>
#include <QThread>

View File

@ -6,11 +6,13 @@
#include <QJsonDocument>
#include <QRegExp>
#include <QtConcurrent>
#include <array>
#include <memory>
#include <set>
#include <string>
#include "system/hardware/hw.h"
#include "selfdrive/ui/qt/api.h"
#include "system/hardware/hw.h"
#include "tools/replay/replay.h"
#include "tools/replay/util.h"

Some files were not shown because too many files have changed in this diff Show More