Commit Graph

6 Commits

Author SHA1 Message Date
Ted Pudlik
6d642e4a14 clang-tidy: Fix and enforce additional checks
This fixes all violations of the following checks, and turns on their
enforcement:

*   bugprone-argument-comment
*   bugprone-fold-init-type
*   bugprone-move-forwarding-reference
*   bugprone-string-constructor
*   bugprone-use-after-move

Bug: 45
No-Docs-Update-Reason: clang-tidy change only.
Change-Id: Ifd1f46161aba3ae4c37983f6707d6a5259a40e3f
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/66444
Commit-Queue: Ted Pudlik <tpudlik@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
2021-10-28 16:49:43 +00:00
Ted Pudlik
585a0c59ef clang-tidy: Enable misc-unused-using-decls
Bug: 45
No-Docs-Update-Reason: clang-tidy change only.
Change-Id: I9e99afcfc8a20feb46c986203977bc23c40a28fb
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/66620
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Ted Pudlik <tpudlik@google.com>
2021-10-28 01:14:30 +00:00
Ted Pudlik
17d5e71d27 Enable additional clang-tidy checks
These checks are all fast, worthwhile, and currently pass.

Also update comment in static_analysis_toolchain.gni.

Runtime impact: On my workstation I ran,

    for i in 1 2 3;
    do gn clean out; gn gen out; time ninja -C out static_analysis;
    done

with and without this change.  The mean CPU time (user+sys) increased by
about 25%, from 559 s to 707 s.  I think this is acceptable.

No-Docs-Update-Reason: We do not currently discuss in the documentation which clang-tidy checks are run for upstream pigweed itself.
Change-Id: If28652ecbd3ca6c876e6942d08d24a30717e8294
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/66440
Commit-Queue: Ted Pudlik <tpudlik@google.com>
Reviewed-by: Rob Mohr <mohrr@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
2021-10-25 23:19:50 +00:00
Ted Pudlik
36986c0d87 Remove outdated comment
Change-Id: I2e2ba663ebe75004a13ee3ba65e80da6f85711d7
No-Docs-Update-Reason: clang-tidy config change only.
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/66246
Commit-Queue: Ted Pudlik <tpudlik@google.com>
Pigweed-Auto-Submit: Ted Pudlik <tpudlik@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2021-10-21 00:47:43 +00:00
Henri Chataing
77f2f358c3 all: Pass clang-tidy modernize-use-bool-literals check
Change-Id: Iddf04fac95d04a4816a0d1d022f04450679377af
No-Docs-Update-Reason: Format fixes
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/56925
Commit-Queue: Henri Chataing <henrichataing@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
2021-08-30 12:52:25 +00:00
Henri Chataing
f06e42b039 pw_presubmit: Fix clang_tidy pass
- Implement workarounds to fix system include paths in
  generated compile_commands.json files: clang-tidy is otherwise
  often unable to find some system headers.
- Add basic .clang-tidy configuration
- To run the pass in pigweed presubmits:
  pw presubmit --step clang_tidy
  pw presubmit -p other_checks

Bug: 45
No-Docs-Update-Reason: Fix in internal API
Change-Id: I3f6cae98bfecaff86543804b28083bf304ad6a60
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/55000
Commit-Queue: Henri Chataing <henrichataing@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
2021-08-09 16:01:28 +00:00