Skip to main content

Check C++ files configurably against Google's style guide

Project description

https://img.shields.io/pypi/v/cpplint.svg https://img.shields.io/pypi/pyversions/cpplint.svg https://img.shields.io/pypi/status/cpplint.svg https://img.shields.io/pypi/l/cpplint.svg https://img.shields.io/pypi/dd/cpplint.svg https://img.shields.io/pypi/dw/cpplint.svg https://img.shields.io/pypi/dm/cpplint.svg

Cpplint is a command-line tool to check C/C++ files for style issues according to Google’s C++ style guide.

Cpplint used to be developed and maintained by Google Inc. at google/styleguide. Nowadays, Google is no longer maintaining the public version of cpplint, and pretty much everything in their repo’s PRs and issues about cpplint have gone unimplemented.

This fork aims to update cpplint to modern specifications, and be (somewhat) more open to adding fixes and features to make cpplint usable in wider contexts.

Installation

Use [pipx](https://pipx.pypa.io) to install cpplint from PyPI, run:

$ pipx install cpplint

Usage

$ cpplint [OPTIONS] files

For full usage instructions, run:

$ cpplint --help

cpplint can also be run as a pre-commit hook by adding to .pre-commit-config.yaml:

- repo: https://github.com/cpplint/cpplint
  rev: 2.0.0
  hooks:
    - id: cpplint
      args:
        - --filter=-whitespace/line_length,-whitespace/parens

Changes

  • python 3 compatibility

  • more default file extensions

  • customizable file extensions with the –extensions argument

  • continuous integration on github

  • support for recursive file discovery via the –recursive argument

  • support for excluding files via –exclude

  • JUnit XML output format

  • Overriding repository root auto-detection via –repository

  • Support #pragma once as an alternative to header include guards

  • … and quite a bit more

Acknowledgements

Thanks to Google Inc. for open-sourcing their in-house tool.

Thanks to our contributors.

Maintainers

Former

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cpplint-2.0.2.tar.gz (373.8 kB view details)

Uploaded Source

Built Distribution

cpplint-2.0.2-py3-none-any.whl (82.0 kB view details)

Uploaded Python 3

File details

Details for the file cpplint-2.0.2.tar.gz.

File metadata

  • Download URL: cpplint-2.0.2.tar.gz
  • Upload date:
  • Size: 373.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cpplint-2.0.2.tar.gz
Algorithm Hash digest
SHA256 8a5971e4b5490133e425284f0c566c7ade0b959e61018d2c9af3ff7f357ddc57
MD5 dc1384a9839f1aac2a81bc0c6138c952
BLAKE2b-256 c58347a9e7513ba4d943a9dac2f6752b444377c91880f4f4968799b4f42d89cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for cpplint-2.0.2.tar.gz:

Publisher: release.yml on cpplint/cpplint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cpplint-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: cpplint-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 82.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cpplint-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7ec188b5a08e604294ae7e7f88ec3ece2699de857f0533b305620c8cf237cad5
MD5 ca0806f7a281d0dd7e236d640ed6ab31
BLAKE2b-256 666508d3a5039b565231c501b31d1a973d4222e9803c03b2c31a9c08bdec3e30

See more details on using hashes here.

Provenance

The following attestation bundles were made for cpplint-2.0.2-py3-none-any.whl:

Publisher: release.yml on cpplint/cpplint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page