client: lib_linter: specify .clang-format location
This commit allows *custom* C++ plugins to be linted/formatted in the same way as their repo counterparts (using the same repo rulesets). Previously, when runing the linter, only *repo* C++ plugins would be formatted. Since custom plugin formatting for both Bash and PHP are already in place, this simply extends the feature to C++.
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# docker-finance | modern accounting for the power-user
|
# docker-finance | modern accounting for the power-user
|
||||||
#
|
#
|
||||||
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -170,7 +170,12 @@ function lib_linter::__lint_cpp()
|
|||||||
local -r _path=("$@")
|
local -r _path=("$@")
|
||||||
local -r _exts=("hh" "cc" "cpp" "C")
|
local -r _exts=("hh" "cc" "cpp" "C")
|
||||||
|
|
||||||
local -r _clang_format="clang-format -i"
|
local _clang_file
|
||||||
|
_clang_file="$(find ${DOCKER_FINANCE_CLIENT_REPO} -name .clang-format)"
|
||||||
|
[ -z "$_clang_file" ] && lib_utils::die_fatal ".clang-format not found"
|
||||||
|
declare -r _clang_file
|
||||||
|
|
||||||
|
local -r _clang_format="clang-format -i --style=file:${_clang_file}"
|
||||||
local -r _cpplint="cpplint --root=${DOCKER_FINANCE_CLIENT_REPO} --filter=-whitespace/braces,-whitespace/newline,-whitespace/line_length,-build/c++11 --headers=hh --extensions=hh,cc,cpp,C"
|
local -r _cpplint="cpplint --root=${DOCKER_FINANCE_CLIENT_REPO} --filter=-whitespace/braces,-whitespace/newline,-whitespace/line_length,-build/c++11 --headers=hh --extensions=hh,cc,cpp,C"
|
||||||
local -r _cppcheck="cppcheck --enable=warning,style,performance,portability --inline-suppr --std=c++17"
|
local -r _cppcheck="cppcheck --enable=warning,style,performance,portability --inline-suppr --std=c++17"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user