Files
transmission/libtransmission/.clang-tidy
Charles Kerr 2649e7acdd refactor: use std::filesystem for more file utils (#8296)
* fix: warning: declaration shadows a variable in the global namespace [clang-diagnostic-shadow]

* fix: warning: use 'contains' to check for membership [readability-container-contains]

* fix: warning: variable gl_confdir can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]

* warning: function 'TorrentFilter::match_mode' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]

* refactor: use std::filesystem for tr_sys_path_is_same()

* refactor: use std::filesystem for tr_sys_path_exists()

* refactor: use std::filesystem for tr_sys_path_is_relative()

* refactor: use std::filesystem for tr_sys_path_get_info()

* refactor: use std::filesystem for tr_sys_dir_create()

* refactor: add `maybe_set_error()` helper

* refactor: change behavior to match previous impl

* fix: tr_sys_path_is_same() checks

refactor: address code review feedback

* refactor: address code review feedback

* chore: fix readability-else-after-return clang-tidy warning

* fix: warning: Value stored to 'created' during its initialization is never read [clang-analyzer-deadcode.DeadStores]

fix: warning: parameter 'permissions' is unused [misc-unused-parameters]

* ci: work around a MSVC STL 14.44.35207 clang-tidy false warning

* refactor: simplify return logic of tr_sys_path_is_same()
2026-02-01 15:37:37 -06:00

75 lines
3.4 KiB
YAML

---
HeaderFilterRegex: .*/libtransmission/.*
# TODO: Enable `portability-template-virtual-member-function` after https://github.com/llvm/llvm-project/issues/139031 is fixed
# TODO: Enable `cppcoreguidelines-pro-bounds-pointer-arithmetic` after converting all pointers to std::span
# TODO: Enable `modernize-use-integer-sign-comparison` (P0586R2) after GCC >= 10.1, clang >= 13
# -clang-analyzer-optin.core.EnumCastOutOfRange: disabled due false <filesystem> warning in file.cc calling
# std::filesystem::last_write_time() on windows ci builds with MSVC STL 14.44.35207.
# Try re-enabling when the CI runner upgrades to a newer version.
#
# PRs welcome to fix & re-enable any of these explicitly-disabled checks
#
# -modernize-use-ranges: GCC 10.1, clang 15
# -readability-container-contains (P0458R2): GCC 9.1, clang 13
# Ref: https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html
# Ref: https://libcxx.llvm.org/Status/Cxx20.html
Checks: >
bugprone-*,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-narrowing-conversions,
cert-*,
-cert-err58-cpp,
-cert-int09-c,
clang-analyzer-*,
-clang-analyzer-optin.core.EnumCastOutOfRange,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-const-or-ref-data-members,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-narrowing-conversions,
-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-reinterpret-cast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
google-explicit-constructor,
misc-*,
-misc-include-cleaner,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
modernize-*,
-modernize-use-integer-sign-comparison,
-modernize-use-ranges,
-modernize-use-trailing-return-type,
performance-*,
-performance-move-const-arg,
portability-*,
-portability-template-virtual-member-function,
readability-*,
-readability-container-contains,
-readability-enum-initial-value,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-magic-numbers,
-readability-qualified-auto,
CheckOptions:
- { key: cppcoreguidelines-avoid-do-while.IgnoreMacros, value: true }
- { key: cppcoreguidelines-rvalue-reference-param-not-moved.IgnoreUnnamedParams, value: true }
- { key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor, value: true }
- { key: readability-identifier-naming.ConstexprVariableCase, value: CamelCase }
- { key: readability-identifier-naming.ParameterCase, value: lower_case }
- { key: readability-identifier-naming.PrivateMemberSuffix, value: _ }
- { key: readability-identifier-naming.ProtectedMemberSuffix, value: _ }
- { key: readability-identifier-naming.VariableCase, value: lower_case }
- { key: readability-implicit-bool-conversion.UseUpperCaseLiteralSuffix, value: true }