https://github.com/gringolito/cpp-pre-commit-hooks
C++ hooks for pre-commit based on Google C++ Style Guide
https://github.com/gringolito/cpp-pre-commit-hooks
cpp google-style pre-commit pre-commit-hooks
Last synced: 10 months ago
JSON representation
C++ hooks for pre-commit based on Google C++ Style Guide
- Host: GitHub
- URL: https://github.com/gringolito/cpp-pre-commit-hooks
- Owner: gringolito
- License: other
- Created: 2020-08-08T19:22:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-09T00:48:36.000Z (over 5 years ago)
- Last Synced: 2025-01-04T15:36:07.969Z (12 months ago)
- Topics: cpp, google-style, pre-commit, pre-commit-hooks
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cpp-pre-commit-hooks
C++ hooks for pre-commit based on Google's C++ Style Guide
[](https://github.com/gringolito/cpp-pre-commit-hooks/actions)
## Usage
To use these hooks, simply place the following snippet in you `.pre-commit-config.yaml`
(more details below):
```yaml
repos:
- repo: https://github.com/gringolito/cpp-pre-commit-hooks
rev: master
hooks:
- id: check-using-namespace-directive
```
## check-using-namespace-directive
This hook verifies the usage of the `using namespace` directive according to the
[Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html#Namespaces).
The argument `--allow-in-source` can be passed to this hook to provide a more
relaxed behavior and allow the usage of the `using namespace` directive in C++
source (`.c`, `.cc`, `.cpp`, and `.cxx`) files.
```yaml
- repo: https://github.com/gringolito/cpp-pre-commit-hooks
rev: master
hooks:
- id: check-using-namespace-directive
# args: [--allow-in-source]
```