[go: up one dir, main page]

Jump to content

Cpplint

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Tom.Reding (talk | contribs) at 19:51, 29 June 2016 (→‎References: Rem stub tag(s) (class = non-stub & non-list) using AWB). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

cpplint or cpplint.py is an open source lint-like tool developed by Google, designed to ensure that C++ code conforms to Google's coding style guides.

Therefore cpplint implements what Google considers to be "best practices" in C++ coding. The script cpplint.py reads source code files and flags deviations from the style guide. It also identifies syntax errors. It is rules based, and uses a number of heuristics to identify bad code.[1]

cpplint.py suffers from both false positives and false negatives. False positives can be eliminated by tagging lines with // NOLINT[2] (or // NOLINT(rule) to suppress only the incriminated rule category).

Moreover rules can be fine-grained selected using the options --verbose and --filter. Line length rule can be configured with option --linelength and file extensions can be configured with --extensions (by default: 'h', 'cpp', 'cc', 'cu' and 'cuh'). Some options can be stored in a configuration file CPPLINT.cfg.

cpplint is implemented as Python script.[3] cpplint is distributed under the 3 clause BSD license.

References

  1. ^ Dutko, Adam. "THE RELATIONAL DATABASE: A NEW STATIC ANALYSIS TOOL?" (PDF).
  2. ^ Weinberger, Benjy. "Google C++ Style Guide, section cpplint".
  3. ^ "GIT URL for cpplint.py". {{cite web}}: |first= has generic name (help); |first= missing |last= (help)