Skip to content
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

Clang-Tidy #362

Open
FG-TUM opened this issue Dec 18, 2024 · 0 comments
Open

Clang-Tidy #362

FG-TUM opened this issue Dec 18, 2024 · 0 comments
Labels
CI clean-up related to the clean-up of the code and tech dept

Comments

@FG-TUM
Copy link
Member

FG-TUM commented Dec 18, 2024

The Problem

We were discussing adding clang-tidy in some form to ls1.

Example Clang-Tidy File

My Clang-Tidy settings

Everything starting with - is disabled, anything else enables a feature. This is an automatically generated list so redundancies might do exist.

*
-android-*
-bugprone-bool-pointer-implicit-conversion
-bugprone-exception-escape
-cert-dcl16-c
-cert-dcl50-cpp
-cert-dcl59-cpp
-cert-env33-c
-clang-analyzer-*
-clang-diagnostic-*
-cppcoreguidelines-avoid-c-arrays
-cppcoreguidelines-avoid-goto
-cppcoreguidelines-avoid-magic-numbers
-cppcoreguidelines-macro-usage
-cppcoreguidelines-no-malloc
-cppcoreguidelines-non-private-member-variables-in-classes
-cppcoreguidelines-owning-memory
-cppcoreguidelines-pro-bounds-array-to-pointer-decay
-cppcoreguidelines-pro-bounds-constant-array-index
-cppcoreguidelines-pro-bounds-pointer-arithmetic
-cppcoreguidelines-pro-type-const-cast
-cppcoreguidelines-pro-type-cstyle-cast
-cppcoreguidelines-pro-type-reinterpret-cast
-cppcoreguidelines-pro-type-union-access
-cppcoreguidelines-pro-type-vararg
-cppcoreguidelines-special-member-functions
-fuchsia-*
-google-*
-hicpp-avoid-c-arrays
-hicpp-avoid-goto
-hicpp-braces-around-statements
-hicpp-function-size
-hicpp-named-parameter
-hicpp-no-array-decay
-hicpp-no-assembler
-hicpp-no-malloc
-hicpp-special-member-functions
-hicpp-uppercase-literal-suffix
-hicpp-vararg
-llvm-*
-llvmlibc-*
-misc-bool-pointer-implicit-conversion
-misc-definitions-in-headers
-misc-non-private-member-variables-in-classes
-misc-unused-alias-decls
-misc-unused-parameters
-misc-unused-using-decls
-modernize-avoid-c-arrays
-modernize-use-default-member-init
-modernize-use-using
-objc-*
-openmp-exception-escape
-readability-braces-around-statements
-readability-else-after-return
-readability-function-size
-readability-identifier-naming
-readability-implicit-bool-conversion
-readability-isolate-declaration
-readability-magic-numbers
-readability-named-parameter
-readability-redundant-member-init
-readability-redundant-preprocessor
-readability-simplify-boolean-expr
-readability-uppercase-literal-suffix
-zircon-*
google-default-arguments
google-explicit-constructor
google-runtime-operator
-openmp-use-default-none
-modernize-use-nodiscard
-modernize-use-trailing-return-type
-readability-identifier-length
-altera-unroll-loops
-bugprone-easily-swappable-parameters
-cppcoreguidelines-avoid-capture-default-when-capturing-this

Intergation

Options what we can do with it in increasing escalation order:

  1. Add a .clang-tidy file to the repository.
  2. Print new warnings introduced in a PR.
  3. Print ALL warnings in the CI.
  4. Fail the CI if any warnings are shown.

Suggestion where to go from here

Let's agree on a .clang-tidy file and add it to the repository. If feasible, we could do suggestion 2 but anything higher seems not useful.

@FG-TUM FG-TUM added CI clean-up related to the clean-up of the code and tech dept labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI clean-up related to the clean-up of the code and tech dept
Projects
None yet
Development

No branches or pull requests

1 participant