Skip to content

docs: update README.md #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
cpp-linter-hooks is a [pre-commit](https://pre-commit.com/) hook that uses `clang-format` and `clang-tidy` to format C/C++ code.

> [!NOTE]
> This hook automatically downloads specific versions of `clang-format` or `clang-tidy` [binaries](https://github.com/cpp-linter/clang-tools-static-binaries) and installs them on your system.
> This hook automatically downloads specific versions of `clang-format` or `clang-tidy` [clang-tools-static-binaries](https://github.com/cpp-linter/clang-tools-static-binaries) and installs them on your system.

## Usage

Expand All @@ -21,7 +21,7 @@ To use cpp-linter-hooks, add the following configuration to your `.pre-commit-co
```yaml
repos:
- repo: https://github.com/cpp-linter/cpp-linter-hooks
rev: v0.8.1 # Use the ref you want to point at
rev: v0.8.1 # Use the tag or commit you want
hooks:
- id: clang-format
args: [--style=Google] # Other coding style: LLVM, GNU, Chromium, Microsoft, Mozilla, WebKit.
Expand All @@ -39,9 +39,9 @@ repos:
rev: v0.8.1
hooks:
- id: clang-format
args: [--style=file] # to load .clang-format
args: [--style=file] # Loads style from .clang-format file
- id: clang-tidy
args: [--checks=.clang-tidy] # path/to/.clang-tidy
args: [--checks=.clang-tidy] # Loads checks from .clang-tidy file
```

To use specific versions of [clang-tools](https://github.com/cpp-linter/clang-tools-pip?tab=readme-ov-file#supported-versions):
Expand All @@ -54,7 +54,7 @@ repos:
- id: clang-format
args: [--style=file, --version=18] # Specifies version
- id: clang-tidy
args: [--checks=.clang-tidy, --version=18] # Specifies version
args: [--checks=.clang-tidy, --version=18] # Specifies version
```

> [!IMPORTANT]
Expand All @@ -65,10 +65,10 @@ repos:
- repo: https://github.com/cpp-linter/cpp-linter-hooks
rev: v0.8.1
hooks:
- id: clang-format
- id: clang-format
args: [--style=file, --version=18]
files: ^(src|include)/.*\.(cpp|cc|cxx|h|hpp)$ # limit the scope
- id: clang-tidy
files: ^(src|include)/.*\.(cpp|cc|cxx|h|hpp)$ # Limits to specific dirs and file types
- id: clang-tidy
args: [--checks=.clang-tidy, --version=18]
files: ^(src|include)/.*\.(cpp|cc|cxx|h|hpp)$
```
Expand Down
Loading