cpplint: add filter `whitespace/parens` (#29565)

old-commit-hash: 5480d32bb5
beeps
Dean Lee 2 years ago committed by GitHub
parent 8960a0912b
commit db211ce617
  1. 2
      .pre-commit-config.yaml
  2. 3
      selfdrive/modeld/thneed/serialize.cc
  3. 3
      selfdrive/ui/qt/util.cc
  4. 2
      tools/cabana/signalview.h

@ -64,7 +64,7 @@ repos:
- --linelength=240 - --linelength=240
# https://google.github.io/styleguide/cppguide.html # https://google.github.io/styleguide/cppguide.html
# relevant rules are whitelisted, see all options with: cpplint --filter= # 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,+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,+whitespace/parens,+readability/braces
- repo: local - repo: local
hooks: hooks:
- id: test_translations - id: test_translations

@ -75,8 +75,7 @@ void Thneed::load(const char *filename) {
#endif #endif
if (clbuf == NULL) { if (clbuf == NULL) {
printf("clError: %s create image %zux%zu rp %zu with buffer %p\n", cl_get_error_string(errcode), printf("clError: %s create image %zux%zu rp %zu with buffer %p\n", cl_get_error_string(errcode),
desc.image_width, desc.image_height, desc.image_row_pitch, desc.buffer desc.image_width, desc.image_height, desc.image_row_pitch, desc.buffer);
);
} }
assert(clbuf != NULL); assert(clbuf != NULL);
} }

@ -197,8 +197,7 @@ QColor interpColor(float xv, std::vector<float> xp, std::vector<QColor> fp) {
(xv - xp[low]) * (fp[hi].red() - fp[low].red()) / (xp[hi] - xp[low]) + fp[low].red(), (xv - xp[low]) * (fp[hi].red() - fp[low].red()) / (xp[hi] - xp[low]) + fp[low].red(),
(xv - xp[low]) * (fp[hi].green() - fp[low].green()) / (xp[hi] - xp[low]) + fp[low].green(), (xv - xp[low]) * (fp[hi].green() - fp[low].green()) / (xp[hi] - xp[low]) + fp[low].green(),
(xv - xp[low]) * (fp[hi].blue() - fp[low].blue()) / (xp[hi] - xp[low]) + fp[low].blue(), (xv - xp[low]) * (fp[hi].blue() - fp[low].blue()) / (xp[hi] - xp[low]) + fp[low].blue(),
(xv - xp[low]) * (fp[hi].alpha() - fp[low].alpha()) / (xp[hi] - xp[low]) + fp[low].alpha() (xv - xp[low]) * (fp[hi].alpha() - fp[low].alpha()) / (xp[hi] - xp[low]) + fp[low].alpha());
);
} }
} }

@ -131,7 +131,7 @@ private:
QAbstractItemView::dataChanged(topLeft, bottomRight, roles); QAbstractItemView::dataChanged(topLeft, bottomRight, roles);
} }
void leaveEvent(QEvent *event) override { void leaveEvent(QEvent *event) override {
emit ((SignalView *)parentWidget())->highlight(nullptr); emit static_cast<SignalView *>(parentWidget())->highlight(nullptr);
QTreeView::leaveEvent(event); QTreeView::leaveEvent(event);
} }
}; };

Loading…
Cancel
Save