cpp-include-lint
Since I was tired of having a messy bunch of #include at the top of my C++
sources I decided to do a script that sorts the #include lines of C/C++ files
with a fair criterion.
The sorting precedence between #include lines is the following:
- header with the same name as this source file
- headers between square brackets (<>), alphabetically
- headers between quotes (""), alphabetically
e.g.
database.cpp
#include "database.h"
#include <iostream>
#include <string>
#include <unordered_set>
#include <vector>
#include "arguments.h"
#include "logger.h"
#include "manager.h"
#include "timer.h"
INSTALLATION
pip install cpp-include-lint
USAGE
usage: cpp-include-lint [-h] [-r] [-d] [-f REGEX] [-q] input [output]
Sort #include directives of C/C++ files.
positional arguments:
input input path
output output path
optional arguments:
-h, --help show this help message and exit
-r, -R, --recursive lint all the files in the input folder recursively
-d, --dry-run just print the files that would have been linted
-f REGEX, --filter REGEX
filter files to lint using the given regular expression.
The default one is: ".*\.(h|hpp|c|cpp|tpp)"
-q, --quiet suppress information messages
EXAMPLES
- Lint a single source file in place
cpp-include-lint main.cpp
- Lint a single source file writing to another file
cpp-include-lint main.cpp /tmp/main.cpp
- Lint an entire directory recursively in place
cpp-include-lint /home/user/develop/project/src -R
- Lint an entire directory recursively to another directory
cpp-include-lint /home/user/develop/project/src /tmp/src -R
- Lint an entire directory recursively in place using a different file filter
cpp-include-lint /home/user/develop/project/src -R -f ".*\.(hxx|cxx)"
Metadata
Release files for cpp-include-lint 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cpp_include_lint-0.2-py3-none-any.whl | Python 3 | none | any | Details for cpp_include_lint-0.2-py3-none-any.whl |
Release files / cpp_include_lint-0.2-py3-none-any.whl
| Download URL | cpp_include_lint-0.2-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
80fe9f73e26a90e3789031590edf42edc55686cc964f14c2b1a17b798fee147a
|
|
BLAKE2b-256 checksum How to use checksums |
d14367be00a29f9d1cf2476b51f3e192d256bb38654d47b61b0fff39a8445b97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Security for cpp-include-lint 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.