Open onyb opened 2 years ago
@onyb if you're referring to https://github.com/brave/brave-core/pull/12797/files#diff-832b548af9f742c2cd91f0f70f8e85102e93c3ca4ded730672f894b1d139d580R273 then you're misreading the docs. That is referring to return values, not params. Also we use upstream cpplint rules so if they're wrong, it's wrong in upstream.
closing as won't fix because we are consistent with upstream
@onyb if you're referring to https://github.com/brave/brave-core/pull/12797/files#diff-832b548af9f742c2cd91f0f70f8e85102e93c3ca4ded730672f894b1d139d580R273 then you're misreading the docs. That is referring to return values, not params. Also we use upstream cpplint rules so if they're wrong, it's wrong in upstream.
That was a reference to foo(std::string* out)
vs foo(std::string& out)
discussion which we had in that PR.
Upstream linter actually has that rule disabled via filters set for cpplint object: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2248714/4/presubmit_canned_checks.py#44 and we don't follow that behavior.
I believe this is worth fixing, so reopening @bridiver
@supermassive ok, I see where we are missing that now because they are passing those to cpplint instead of changing the cpplint.cfg. We can do something similar in lint.py or maybe we can look at running presubmit checks instead
Google recommends the following style as a best practice.
This is not consistent with the current cpplint rules, which shows the following error when using non-const references in function arguments:
cc: @supermassive