Skip to content

Commit

Permalink
Merge pull request #93271 from Repiteo/ci/clang-tidy
Browse files Browse the repository at this point in the history
CI: Add manual pre-commit hook for `clang-tidy`
  • Loading branch information
akien-mga committed Jun 18, 2024
2 parents 344ab04 + 576c9e4 commit a49b7b8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 74 deletions.
59 changes: 18 additions & 41 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,45 +1,22 @@
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,cppcoreguidelines-pro-type-member-init,modernize-redundant-void-arg,modernize-use-bool-literals,modernize-use-default-member-init,modernize-use-nullptr,readability-braces-around-statements,readability-redundant-member-init'
Checks: >-
-*,
cppcoreguidelines-pro-type-member-init,
modernize-redundant-void-arg,
modernize-use-bool-literals,
modernize-use-default-member-init,
modernize-use-nullptr,
readability-braces-around-statements,
readability-redundant-member-init
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none
HeaderFileExtensions: ['', h, hh, hpp, hxx, inc, glsl]
ImplementationFileExtensions: [c, cc, cpp, cxx, m, mm, java]
HeaderFilterRegex: (core|doc|drivers|editor|main|modules|platform|scene|servers|tests)/
FormatStyle: file
CheckOptions:
- key: cert-dcl16-c.NewSuffixes
value: 'L;LL;LU;LLU'
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
value: '0'
- key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors
value: '1'
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: '1'
- key: cppcoreguidelines-pro-type-member-init.IgnoreArrays
value: '1'
- key: cppcoreguidelines-pro-type-member-init.UseAssignment
value: '1'
- key: google-readability-function-size.StatementThreshold
value: '800'
- key: google-readability-namespace-comments.ShortNamespaceLines
value: '10'
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
- key: modernize-loop-convert.MaxCopySize
value: '16'
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: modernize-use-bool-literals.IgnoreMacros
value: '0'
- key: modernize-use-default-member-init.IgnoreMacros
value: '0'
- key: modernize-use-default-member-init.UseAssignment
value: '1'
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
- key: readability-braces-around-statements.ShortStatementLines
value: '0'
cppcoreguidelines-pro-type-member-init.IgnoreArrays: true
cppcoreguidelines-pro-type-member-init.UseAssignment: true
modernize-use-bool-literals.IgnoreMacros: false
modernize-use-default-member-init.IgnoreMacros: false
modernize-use-default-member-init.UseAssignment: true
...
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,22 @@ repos:
platform/android/java/lib/src/com/.*
)
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.3.5
hooks:
- id: clang-tidy
files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java|glsl)$
args: [--fix, --quiet, --use-color]
types_or: [text]
exclude: |
(?x)^(
tests/python_build/.*|
platform/android/java/lib/src/com/.*
)
additional_dependencies: [clang-tidy==18.1.1]
require_serial: true
stages: [manual] # Not automatically triggered, invoked via `pre-commit run --hook-stage manual clang-tidy`

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.4
hooks:
Expand Down
33 changes: 0 additions & 33 deletions misc/scripts/clang_tidy.sh

This file was deleted.

0 comments on commit a49b7b8

Please sign in to comment.