New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 867607 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

Add a Tricium C++ linter/analyzer

Project Member Reported by diegomtzg@google.com, Jul 25

Issue description

From go/tricium-ideas: Simple Python-based linter for C++
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 25

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/infra/+/4cf89d6d7d96f5a3822f7b18eb039cc1f520bc2f

commit 4cf89d6d7d96f5a3822f7b18eb039cc1f520bc2f
Author: Diego Martinez <diegomtzg@google.com>
Date: Wed Jul 25 22:23:52 2018

[tricium] Add CppLint Analyzer

Bug:  867607 
Change-Id: Ifcd3253d533b49942c90a8ed91819c8b964de9cc
Reviewed-on: https://chromium-review.googlesource.com/1150625
Commit-Queue: Diego Martinez <diegomtzg@google.com>
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Reviewed-by: Quinten Yearsley <qyearsley@chromium.org>

[add] https://crrev.com/4cf89d6d7d96f5a3822f7b18eb039cc1f520bc2f/go/src/infra/tricium/functions/cpplint/.gitignore
[add] https://crrev.com/4cf89d6d7d96f5a3822f7b18eb039cc1f520bc2f/go/src/infra/tricium/functions/cpplint/cpplint_parser.go
[add] https://crrev.com/4cf89d6d7d96f5a3822f7b18eb039cc1f520bc2f/go/src/infra/tricium/functions/cpplint/cpplint_parser_test.go
[add] https://crrev.com/4cf89d6d7d96f5a3822f7b18eb039cc1f520bc2f/go/src/infra/tricium/functions/cpplint/cpplint_parser
[add] https://crrev.com/4cf89d6d7d96f5a3822f7b18eb039cc1f520bc2f/go/src/infra/tricium/functions/cpplint/test/test.cpp
[add] https://crrev.com/4cf89d6d7d96f5a3822f7b18eb039cc1f520bc2f/go/src/infra/tricium/functions/cpplint/README.md
[add] https://crrev.com/4cf89d6d7d96f5a3822f7b18eb039cc1f520bc2f/go/src/infra/tricium/functions/cpplint/cipd.yaml
[add] https://crrev.com/4cf89d6d7d96f5a3822f7b18eb039cc1f520bc2f/go/src/infra/tricium/functions/cpplint/Makefile
[add] https://crrev.com/4cf89d6d7d96f5a3822f7b18eb039cc1f520bc2f/go/src/infra/tricium/functions/cpplint/test/tricium/data/files.json
[add] https://crrev.com/4cf89d6d7d96f5a3822f7b18eb039cc1f520bc2f/go/src/infra/tricium/functions/cpplint/cpplint.infra_testing

Cc: -qyearsley@google.com juliehockett@google.com
Julie, do you know whether this might be something that someone in Fuchsia would be interested in enabling or trying out?

Some background: cpplint.py checks for some cases where C++ code fails to conform to The Google style guide, but it has fewer possible checks than clang-tidy, and works differently than clang-tidy. At the moment, we're not really sure which of these warnings is going to be useful.

Longer-term, I'm expecting that cpplint.py could potentially be a kind of supplement to clang-format and clang-tidy, since there might be a few types of warnings that it produces that don't overlap with the previous two.
I'm less familiar with the suite of checks in cpplint.py -- I'd be interested to try it out, but a real need for us would be the ability to disable anything we don't want. We *mostly* follow the Google style guide, with a few key points of departure and I wouldn't want to create noise for style points we don't want to enforce. Is that a possible extension?
Status: Fixed (was: Assigned)
Late reply:

So, just like Pylint, I think there's no current good solution for per-project analyzer config of analyzer.

One possible path right now which I think would be good would be to try out this CppLint analyzer with a relatively conservative set of checks. I still don't know what these checks should be.

I'd like to gather some stats about the top warnings in different repos, and then survey some people about which ones are likely to be a good (high-confidence, useful, conservative) starting set. I think this set could potentially be used for both Fuchsia and Chromium...

Anyway I'll mark this bug as "done" and continue this conversation on tricium-dev.
Project Member

Comment 5 by bugdroid1@chromium.org, Aug 10

Labels: merge-merged-config
The following revision refers to this bug:
  https://chromium.googlesource.com/playground/gerrit-tricium/+/432ea0b5fcba2bf0fcde776c6f3e837b10a64778

commit 432ea0b5fcba2bf0fcde776c6f3e837b10a64778
Author: Quinten Yearsley <qyearsley@chromium.org>
Date: Fri Aug 10 17:40:39 2018

Update playground tricium-dev, adding cpplint

TBR=maruel
TBR_REASON=playground repo

Bug:  867607 
Change-Id: Ifb26e4fb042da6fc0f306bf099c80e4b3a677902

[modify] https://crrev.com/432ea0b5fcba2bf0fcde776c6f3e837b10a64778/tricium-dev.cfg

Project Member

Comment 6 by bugdroid1@chromium.org, Aug 10

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/infra/+/11ebccc685519878e65ddb2232cd56c478d06dd8

commit 11ebccc685519878e65ddb2232cd56c478d06dd8
Author: Quinten Yearsley <qyearsley@chromium.org>
Date: Fri Aug 10 18:29:22 2018

[tricium cpplint] Exclude whitespace warnings in cpplint

Only affect on behavior from this CL should be to filter
on confidence and message type.

In addition, this CL contains a few minor changes:
 - Minor changes to comments
 - Adjust message format
 - Update Makefile
 - Move regexp compilation to top level
 - Remove exPath = ""

Purpose: Planning to test cpplint in playground repo

Bug:  867607 
Change-Id: I1cb5f7ff253ca27d9c0efd1b10df33c9507e62f8
Reviewed-on: https://chromium-review.googlesource.com/1171196
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>

[modify] https://crrev.com/11ebccc685519878e65ddb2232cd56c478d06dd8/go/src/infra/tricium/functions/cpplint/cpplint_parser_test.go
[modify] https://crrev.com/11ebccc685519878e65ddb2232cd56c478d06dd8/go/src/infra/tricium/functions/cpplint/Makefile
[modify] https://crrev.com/11ebccc685519878e65ddb2232cd56c478d06dd8/go/src/infra/tricium/functions/cpplint/cpplint_parser.go
[modify] https://crrev.com/11ebccc685519878e65ddb2232cd56c478d06dd8/go/src/infra/tricium/functions/cpplint/README.md

Project Member

Comment 7 by bugdroid1@chromium.org, Aug 11

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/infra/+/1c960e6f53a47f6bc99af1263959fd6bd52e50b6

commit 1c960e6f53a47f6bc99af1263959fd6bd52e50b6
Author: Quinten Yearsley <qyearsley@chromium.org>
Date: Sat Aug 11 16:36:49 2018

[tricium cpplint] Add disable instructions to comment message

If it's helpful to do this for pylint, maybe it's also helpful
to do it for cpplint.

Bug:  867607 
Change-Id: Ic98d2fe201a8d28f6fc76cb16d99604bac9eafca
Reviewed-on: https://chromium-review.googlesource.com/1171803
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>

[modify] https://crrev.com/1c960e6f53a47f6bc99af1263959fd6bd52e50b6/go/src/infra/tricium/functions/cpplint/cpplint_parser_test.go
[modify] https://crrev.com/1c960e6f53a47f6bc99af1263959fd6bd52e50b6/go/src/infra/tricium/functions/cpplint/cpplint_parser.go

Project Member

Comment 8 by bugdroid1@chromium.org, Aug 13

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/infra/+/1843f62865a1125e8425e866365e8da06e6c153e

commit 1843f62865a1125e8425e866365e8da06e6c153e
Author: Quinten Yearsley <qyearsley@chromium.org>
Date: Mon Aug 13 17:35:22 2018

[tricium cpplint] Disable header guard check

Bug:  867607 
Change-Id: I66afc34b54d6311c12095a3fa2a18a12d38c0dc8
Reviewed-on: https://chromium-review.googlesource.com/1171816
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>

[modify] https://crrev.com/1843f62865a1125e8425e866365e8da06e6c153e/go/src/infra/tricium/functions/cpplint/cpplint_parser.go

Sign in to add a comment