Compare commits

..

1 Commits

Author SHA1 Message Date
F.B. e33e550e97
Merge 5359bbf0e7 into dd83145816 2026-06-07 18:56:28 +03:00
1 changed files with 70 additions and 94 deletions

View File

@ -1,4 +1,4 @@
#compdef cppcheck cppcheck-htmlreport #compdef cppcheck
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Copyright (c) 2019 Github zsh-users - https://github.com/zsh-users # Copyright (c) 2019 Github zsh-users - https://github.com/zsh-users
# All rights reserved. # All rights reserved.
@ -40,7 +40,7 @@
# Notes # Notes
# ----- # -----
# #
# Created for Cppcheck version 2.19.0 (https://github.com/danmar/cppcheck) # Created for Cppcheck version 2.17.1 (https://github.com/danmar/cppcheck)
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
@ -48,36 +48,11 @@ _cppcheck_files() {
_path_files -/ -g "*.(c|cpp|cxx|h|hpp|C)" _path_files -/ -g "*.(c|cpp|cxx|h|hpp|C)"
} }
_cppcheck_author_information() { _cppcheck() {
local -a info=(name email date) local check_ids='(all warning style performance portability information unusedFunction missingInclude)'
_values -s ',' 'info' $info local platforms='(unix32 unix64 win32A win32W win64 avr8 elbrus-e1cp pic8 pic8-enhanced pic16 mips32 native unspecified)'
} local coding_standards='(normal autosar cert-c-2016 cert-cpp-2016 misra-c-2012 misra-c-2023 misra-cpp-2008 misra-cpp-2023)'
local -a check_ids=(
all warning style performance portability information unusedFunction missingInclude
)
local -a platforms=(
unix32 unix64 win32A win32W win64 avr8 elbrus-e1cp pic8 pic8-enhanced pic16 mips32 native unspecified
)
local -a coding_standards=(
normal autosar cert-c-2016 cert-cpp-2016 misra-c-2012 misra-c-2023 misra-c-2025
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 \ _arguments \
"--addon=[Execute addon]" \ "--addon=[Execute addon]" \
"--addon-python=[Specify the python interpreter]: :_files" \ "--addon-python=[Specify the python interpreter]: :_files" \
@ -90,11 +65,11 @@ case $service in
"--config-exclude=[Path to be excluded from configuration checking]:directory:_files -/" \ "--config-exclude=[Path to be excluded from configuration checking]:directory:_files -/" \
"--config-exclude-files=[A file that contains a list of config-excludes]:file:_files" \ "--config-exclude-files=[A file that contains a list of config-excludes]:file:_files" \
"--doc[Print a list of all available checks]" \ "--doc[Print a list of all available checks]" \
'*--disable=[Disable individual checks]:id:($check_ids)' \ "*--disable=[Disable individual checks]:id:$check_ids" \
"--dump[Dump xml data for each translation unit]" \ "--dump[Dump xml data for each translation unit]" \
"*-D[Define preprocessor symbol]:symbol" \ "-D[Define preprocessor symbol]" \
"-E[Print preprocessor output on stdout and don't do any further processing]" \ "-E[Print preprocessor output on stdout and don't do any further processing]" \
'--enable=[Enable additional checks]:id:($check_ids)' \ "--enable=[Enable additional checks]:id:$check_ids" \
"--error-exitcode=[Integer to return if errors are found]" \ "--error-exitcode=[Integer to return if errors are found]" \
"--errorlist[Print a list of all the error messages in XML format]" \ "--errorlist[Print a list of all the error messages in XML format]" \
"--exitcode-suppressions=[Used when certain messages should be displayed but should not cause a non-zero exitcode]:_files" \ "--exitcode-suppressions=[Used when certain messages should be displayed but should not cause a non-zero exitcode]:_files" \
@ -104,7 +79,7 @@ case $service in
"(--fsigned-char --funsigned-char)--fsigned-char[Treat char type as signed]" \ "(--fsigned-char --funsigned-char)--fsigned-char[Treat char type as signed]" \
"(--fsigned-char --funsigned-char)--funsigned-char[Treat char type as unsigned]" \ "(--fsigned-char --funsigned-char)--funsigned-char[Treat char type as unsigned]" \
"(- 1 *)"{-h,--help}"[Print help]" \ "(- 1 *)"{-h,--help}"[Print help]" \
"*-I[A file that contains a list of config-excludes]:directory:_files -/" \ "-I[A file that contains a list of config-excludes]:directory:_files -/" \
"--include-file=[Specify directory paths to search for included header files in a text file]:file:_files" \ "--include-file=[Specify directory paths to search for included header files in a text file]:file:_files" \
"--include=[Force inclusion of a file before the checked file]:file:_files" \ "--include=[Force inclusion of a file before the checked file]:file:_files" \
"-i[Give a source file or source file directory to exclude from the check]:directory or file:_files" \ "-i[Give a source file or source file directory to exclude from the check]:directory or file:_files" \
@ -117,31 +92,32 @@ case $service in
"--max-configs=[Maximum number of configurations to check in a file]" \ "--max-configs=[Maximum number of configurations to check in a file]" \
"--max-ctu-depth=[Maximum depth in whole program analysis]:num" \ "--max-ctu-depth=[Maximum depth in whole program analysis]:num" \
"--output-file=[File to save results]:file:_files" \ "--output-file=[File to save results]:file:_files" \
"--output-format=[Specify the output format]:format:(text sarif xml xmlv2 xmlv3)" \ "--output-format=[Specify the output format]:format:(text sarif xml)" \
'--platform=[Specified platform specific types and sizes]:platform:($platforms)' \ "--platform=[Specified platform specific types and sizes]:platform:$platforms" \
"--plist-output=[Generate Clang-plist output files in folder]:file:_files" \ "--plist-output=[Generate Clang-plist output files in folder]:file:_files" \
"--project=[Run Cppcheck on project]:file:_files" \ "--project=[Run Cppcheck on project]:file:_files" \
"--project-configuration=[Limit the configuration cppcheck should check]:configuration" \ "--project-configuration=[Limit the configuration cppcheck should check]:configuration" \
"(-q --quiet)"{-q,--quiet}"[Do not show progress reports]" \ "(-q --quiet)"{-q,--quiet}"[Do not show progress reports]" \
{-rp,--relative-paths}"=[Use relative paths in output (separated with ;)]:file:_files" \ {-rp,--relative-paths}"=[Use relative paths in output (separated with ;)]:file:_files" \
"--report-progress[Report progress messages while checking a file]" \ "--report-progress[Report progress messages while checking a file]" \
'--report-type=[Add guideline and classification fields for specified coding standard]:standard:($coding_standards)' \ "--report-type=[Add guideline and classification fields for specified coding standard]:standard:$coding_standards" \
"--rule=[Match regular expression]:rule" \ "--rule=[Match regular expression]:rule" \
"--rule-file=[Use given rule file]:file:_files" \ "--rule-file=[Use given rule file]:file:_files" \
"--showtime=[show timing information]:type:(none file file-total summary top5_file top5_summary)" \ "--showtime=[show timing information]:type:(none file file-total summary top5_file top5_summary top5)" \
"--std=[Set standard]:std:(c89 c99 c11 c++03 c++11 c++14 c++17 c++20)" \ "--std=[Set standard]:std:(c89 c99 c11 c++03 c++11 c++14 c++17 c++20)" \
"--suppress=[Suppress warnings (format: \[error id\]:\[filename\]:\[line\])]" \ "--suppress=[Suppress warnings (format: \[error id\]:\[filename\]:\[line\])]" \
"--suppressions-list=[Suppress warnings listed in the file]:file:_files" \ "--suppressions-list=[Suppress warnings listed in the file]:file:_files" \
"--suppress-xml=[Suppress warnings listed in a xml file]:file:_files" \ "--suppress-xml=[Suppress warnings listed in a xml file]:file:_files" \
"--template=[Format the error messages]:text" \ "--template=[Format the error messages]" \
"--template-location=[Format the error message location]:text" \ "--template-location=[Format the error message location]" \
"*-U[Undefine preprocessor symbol]:symbol" \ "*-U[Undefine preprocessor symbol]:symbol" \
"(-v --verbose)"{-v,--verbose}"[Output more detailed error information]" \ "(-v --verbose)"{-v,--verbose}"[Output more detailed error information]" \
"--version[Print out version number]" \ "--version[Print out version number]" \
"--xml[Write results in xml format to stderr]" \ "--xml[Write results in xml format to stderr]" \
"*: :_cppcheck_files" "*: :_cppcheck_files"
;; }
esac
_cppcheck "$@"
# Local Variables: # Local Variables:
# mode: Shell-Script # mode: Shell-Script