Merge pull request #1275 from zsh-users/support_cppcheck_reporter

Support cppcheck-htmlreport
This commit is contained in:
Shohei YOSHIDA 2026-06-15 09:07:51 +09:00 committed by GitHub
commit 4b23ecd62a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 93 additions and 76 deletions

View File

@ -1,4 +1,4 @@
#compdef cppcheck
#compdef cppcheck cppcheck-htmlreport
# ------------------------------------------------------------------------------
# Copyright (c) 2019 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
@ -48,7 +48,11 @@ _cppcheck_files() {
_path_files -/ -g "*.(c|cpp|cxx|h|hpp|C)"
}
_cppcheck() {
_cppcheck_author_information() {
local -a info=(name email date)
_values -s ',' 'info' $info
}
local -a check_ids=(
all warning style performance portability information unusedFunction missingInclude
)
@ -60,6 +64,20 @@ _cppcheck() {
misra-cpp-2008 misra-cpp-2023
)
case $service in
(cppcheck-htmlreport)
_arguments \
'(- *)'{-h,--help}'[show help message and exit]' \
'--title[Title of the project]:title' \
'*--file[cppcheck xml output file to read defects from(default stdin)]:file:_files' \
'--checkers-report-file[cppcheck checkers report file]:file:_files' \
'--report-dir[Directory where the HTML report content is written]:dir:_files -/' \
'--source-dir[Base directory where source code files can be found or a URL to a remote]:dir:_files -/' \
'--add-author-information[Blame information to include(default "name,email,date")]:info:_cppcheck_author_information' \
'--source-encoding[Encoding of source code]:encoding' \
'--blame-options[Blame options which you can use to get author and author mail]:options'
;;
(cppcheck)
_arguments \
"--addon=[Execute addon]" \
"--addon-python=[Specify the python interpreter]: :_files" \
@ -122,9 +140,8 @@ _cppcheck() {
"--version[Print out version number]" \
"--xml[Write results in xml format to stderr]" \
"*: :_cppcheck_files"
}
_cppcheck "$@"
;;
esac
# Local Variables:
# mode: Shell-Script