Name already in use
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.rst
cpplint — static code checker for C++
Cpplint is a command-line tool to check C/C++ files for style issues following Google’s C++ style guide. Cpplint is developed and maintained by Google Inc. at google/styleguide, also see the wikipedia entry
While Google maintains cpplint, Google is not (very) responsive to issues and pull requests, this fork aims to be (somewhat) more open to add fixes to cpplint to enable fixes, when those fixes make cpplint usable in wider contexts. Also see discussion here google#528.
To install cpplint from PyPI, run:
Then run it with:
For full usage instructions, run:
The modifications in this fork are minor fixes and cosmetic changes, such as:
- 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 a few more (most of which are open PRs on upstream)
Thanks to Google Inc. for open-sourcing their in-house tool. Thanks to maintainers of the fork
cpplint 1.6.1
Cpplint is a command-line tool to check C/C++ files for style issues following Google’s C++ style guide. Cpplint is developed and maintained by Google Inc. at google/styleguide, also see the wikipedia entry
While Google maintains cpplint, Google is not (very) responsive to issues and pull requests, this fork aims to be (somewhat) more open to add fixes to cpplint to enable fixes, when those fixes make cpplint usable in wider contexts. Also see discussion here https://github.com/google/styleguide/pull/528.
Installation
To install cpplint from PyPI, run:
Then run it with:
For full usage instructions, run:
Changes
The modifications in this fork are minor fixes and cosmetic changes, such as:
Acknowledgements
Thanks to Google Inc. for open-sourcing their in-house tool. Thanks to maintainers of the fork
Static code checker for C++
Cpplint is a command-line tool to check C/C++ files for style issues following Google’s C++ style guide. Cpplint is developed and maintained by Google Inc. at google/styleguide, also see the wikipedia entry
While Google maintains cpplint, Google is not (very) responsive to issues and pull requests, this fork aims to be (somewhat) more open to add fixes to cpplint to enable fixes, when those fixes make cpplint usable in wider contexts. Also see discussion here https://github.com/google/styleguide/pull/528.
To install cpplint from PyPI, run:
Then run it with:
For full usage instructions, run:
The modifications in this fork are minor fixes and cosmetic changes, such as:
- python 3 compatibility
- more default file extensions
- customizable file extensions with the —extensions argument
- continuous integration on travis
- 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 a few more (most of which are open PRs on upstream)
Thanks to Google Inc. for open-sourcing their in-house tool. Thanks to maintainers of the fork
Comments
Move project to cpplint/cpplint
If we move the project to a organisation we can have multiple collaborators on the project and share the maintenance. We use this version of cpplint internally at work and would happily spend time maintaining the project, issues and PRs.
Add language about Unix directory aliases (fixes #139)
Thanks for this great project! cpplint has helped us a lot in LightGBM.
This pull request attempts to address https://github.com/cpplint/cpplint/issues/139#issuecomment-629594423. See the conversation on that issue for background.
Essentially, if something.cpp uses #include "./something.h" , it can generate the warning
src/foo.cpp:2: src/something.cpp should include its header file src/something.h [build/include] [5]
That message might be confusing to people (like me) who didn’t know that Unix directory aliases like ./ are not allowed by the Google style guide.
This PR adds a more informative warning for such cases.
Thanks for your time and consideration!
—exclude not work on Windows with cpplint 1.4.4 Python 3.7.3
I’m trying to use cpplint for code static analysis and here I’m in the trouble with excluded directories 🙁
Long time ago I used a batch script to list all directory and files into a file list and feed cpplint to get the results, but there’s distadvantages that when the files it too many it’ll overflow the max length of command line to work.
I’ve already try to use all the follow code, but none works:
cpplint always lint the very src/third_party directory, please help me, I’m struggling with this issue about several weeks. Hopeless 🙁
cpplint is installed by:
Linux system headers not detected as system headers
PR #133 swapped the dynamic system header detection from <> brackets to a hard coded list of names. This causes false positives in files with Linux specific includes. Unless I’m mistaken and files under /usr/include should not be classified as system headers.
add elif as an exception for CheckSpacingForFunctionCall()
The current version of the code allows for white spaces after preprocessor directive #if (FOO == 1) but not after #elif (FOO == 1) .
The code below will throw this error: test.cpp:4: Extra space before ( in function call [whitespace/parens] [4]
This pull request fixes that.
Update cpplint.py to r456 — rebased
So this is my attempt at fixing the merge conflict in #19. I guess this may break several tests, so there may be several iterations to do. The main conflicts to solve were about the _IsSourceExtension() function and the _test_suffixes variable.
As a sidenote, it would be nicer to keep the git history clean, by fetching commit from the google styleguide and making a merge commit, where the merge result would be something like this PR.
456 — Tweak lint to sometimes allow < on line following array initialization. 455 - Recognize more types. 454 - Try a bit harder to detect templated types. 453 - Changed error message wording on build/storage_class to be less ambiguous. 452 - Recognize more types to silence false positives for brace warnings. 451 - 450 - 449 - Ignore whitespace/tab for Linux Kernel files. 448 - Remove some more false positive lint warnings for int64
Conflicts:
cpplint.py
cpplint_unittest.py
Conflicts:
cpplint.py
cpplint_unittest.py
Fix issue when function arguments with mutiply class or struct keywords
Issue introduction: CPPLint already have protection when function arguments with extra "class" or "struct" keywords, following scenario is fine:
But in case multiply "struct" function arguments existed in a function like below(add "new_struct2" parameter):
It will cause false positive reporting as below: demo.cpp:11: Closing brace should be aligned with beginning of struct demo_struct [whitespace/indent] [3]
Issue analysis: In case meet multiply struct parameters, will push "_ClassInfo" instances mutiply times into the "stack" array of NestingState class , when ";" or ")" token is encountered before OpenBrace is not seen, will pop ONLY one "_ClassInfo" instance from the stack. that makes at least one "struct" parameters be regarded as a "_ClassInfo" block but not a "struct" parameter. Then produce above warning.
Issue reslove: Greedy pop the "_ClassInfo" instance from the stack until "_ClassInfo" instance have open brace when ";" or ")" token is encountered.
in 1.4.1 getting ‘Uncommented text after #endif is non-standard. Use a comment.’
We get a failure on every #endif with 1.4.1 I think the following rege is wrong as it marks a line contianing only ‘#endif’ (with no other characters) as a failure
Please merge with main branch to enable style check on .cu and .cuh files
Is it possible to update the cpplint.py from google (the main branch)? I am mainly looking for the style check feature on cuda source and header files (.cu and .cuh). Will be awesome to see this in the cpplint for pip install.
Running cpplint on Windows 10 cmd.exe results in «failed to create process»
The cpplint console entry point ( cpplint.exe ) does not seem to be working on Windows 10 with Python 3.5.
The same behavior happens outside of a venv .
Handle Other Header Files for Build Include Subdir
build/include_subdir should handle arbitrarily header file extensions.
avoid false positives on transform issue27
This PR addresses https://github.com/cpplint/cpplint/issues/27
I noticed some false positives when using transform in other namespaces. There may be some new false negatives when using namespace std is used and std:: is omitted, but it seems worth it.
using readability/fn_size with configurable parameter of lines
Hi, I would like to set the maximal fn_size to 100 in my project and I already added a filter for readability/fn_size, but I couldn’t find how exactly it can configure the number of lines, is it supported or should I change the code manually?
Add support for NOLINTBEGIN/END
Add support for specifying no lint on multiple lines using a NOLINTBEGIN comment to start the block and one or more NOLINTEND comments. Multiple NOLINTBEGIN comments can stack different categories and the same number NOLINTEND comments need to be used to re-enable the category.
This is similar to the clang-tidy NOLINTBEGIN/END feature.
Also, add support for specifying multiple categories in a single NOLINT comment using commas as separators.
C++20 `[[likely]]` / `[[unlikely]]` attribute support
In C++ attribute: likely , unlikely (since C++20), we can add [[likely]] / [[unlikely]] on if-else clauses. But cpplint does not recognize the [[likely]] / [[unlikely]] attributes after if / else / else if :
#include recognized as C system header
I have the following set of includes in my header file:
If I leave them in this order, then I get the following error message:
Found C system header after C++ system header. Should be: stream_helpers.h, c system, c++ system, other. [build/include_order] [4]
In order to make the linter happy, I need to do this:
If I don’t include the // comment below the #include <span> line, then my clang-format rule reorders the headers alphabetically but then cpplint fails.
Пакет: cpplint (1.5.5-2) [universe]
Please consider filing a bug or asking a question via Launchpad before contacting the maintainer directly.
Original Maintainer (usually from Debian):
- Wolfgang Silbermayr
It should generally not be necessary for users to contact the original maintainer.
Внешние ресурсы:
Подобные пакеты:
Static code checker for C++
Другие пакеты, относящиеся к cpplint
- зависимости
- рекомендации
- предложения
- enhances
- dep: python3 interactive high-level object-oriented language (default python3 version)
Загрузка cpplint
Архитектура | Размер пакета | В установленном виде | Файлы |
---|---|---|---|
all | 71,4 Кб | 292,0 Кб | [список файлов] |
This page is also available in the following languages:
Авторские права © 2023 Canonical Ltd.; См. условия лицензии. Ubuntu это торговый знак компании Canonical Ltd. Об этом сайте.