From 3d26c20452e1fd534d91df6ced587b20120ed864 Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Sat, 3 Dec 2022 12:38:04 +0900 Subject: [PATCH 1/3] Add clang-check completion --- src/_clang-check | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 src/_clang-check diff --git a/src/_clang-check b/src/_clang-check new file mode 100644 index 0000000..f2f9617 --- /dev/null +++ b/src/_clang-check @@ -0,0 +1,62 @@ +#compdef clang-check +# ------------------------------------------------------------------------------ +# Copyright (c) 2022 Github zsh-users - https://github.com/zsh-users +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for clang-check v15.0.2 (https://clang.llvm.org/docs/ClangCheck.html) +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Shohei Yoshida (https://github.com/syohex) +# +# ------------------------------------------------------------------------------ + +_arguments \ + '(- *)--help[Display available options]' \ + '(- *)--help-hidden[Display available more options]' \ + '(- *)--version[Display the version of this program]' \ + '--analyze[Run static analysis engine]' \ + '--analyzer-output-path=[Write output to file]: :_files' \ + '--ast-dump[Build ASTs and then debug dump them]' \ + '--ast-dump-filter=[Use with -ast-dump or -ast-print to dump/print only AST declaration nodes having a certain substring]:string' \ + '--ast-list[Build ASTs and print the list of declaration node qualified names]' \ + '--ast-print[Build ASTs and then pretty-print them]' \ + '*--extra-arg=[Additional argument to append to the compiler command line]:arg' \ + '*--extra-arg-before=[Additional argument to prepend to the compiler command line]:arg' \ + '--fix-what-you-can[Apply fix-it advice even in the presence of unfixable errors]' \ + '--fixit[Apply fix-it advice to the input source]' \ + '-p[Build directory where compile_commands.json is]: :_files -/' \ + '--syntax-tree-dump[dump the syntax tree]' \ + '--tokens-dump[dump the preprocessed tokens]' \ + '*: :_files' + +# Local Variables: +# mode: Shell-Script +# sh-indentation: 2 +# indent-tabs-mode: nil +# sh-basic-offset: 2 +# End: +# vim: ft=zsh sw=2 ts=2 et From 3b0477499ea3367bf75fcaf833691ac3dba09196 Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Sat, 3 Dec 2022 12:55:45 +0900 Subject: [PATCH 2/3] Add clang-format completion --- src/_clang-format | 70 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 src/_clang-format diff --git a/src/_clang-format b/src/_clang-format new file mode 100644 index 0000000..18b613f --- /dev/null +++ b/src/_clang-format @@ -0,0 +1,70 @@ +#compdef clang-format +# ------------------------------------------------------------------------------ +# Copyright (c) 2022 Github zsh-users - https://github.com/zsh-users +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for clang-format v15.0.2 (https://clang.llvm.org/docs/ClangFormat.html) +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Shohei Yoshida (https://github.com/syohex) +# +# ------------------------------------------------------------------------------ + +local -a styles=(LLVM GNU Google Chromium Microsoft) + +_arguments \ + '(- *)--help[Display available options]' \ + '(- *)--help-hidden[Display available more options]' \ + '(- *)--help-list[Display list of available options]' \ + '(- *)--help-list-hidden[Display list of more available options]' \ + '--Werror=[If set, changes formatting warnings to errors]' \ + '*--Wno-error=[If set, do not error out on the specified warning type]:warn' \ + '--assume-filename=[Set filename used to determine the language and to find .clang-format file]: :_files' \ + '--cursor=[The position of the cursor when invoking clang-format from an editor integration]:pos' \ + '(-n --dry-run)'{-n,--dry-run}'[If set, do not actually make the formatting changes]' \ + '--dump-config[Dump configuration options to stdout and exit]' \ + '--fallback-style=[The name of the predefined style used as a fallback]: :'"($styles)" \ + '--ferror-limit=[Set the maximum number of clang-format errors to emit before stopping]:limit' \ + '*--files=[Provide a list of files to run clang-format]: :_files' \ + '-i[Inplace edit files, if specified]' \ + '--length=[Format a range of this length(in bytes)]:bytes' \ + '--lines=[format a range of lines]:format' \ + '--offset=[Format a range starting at this byte offset]' \ + '--output-replacements-xml[Output replacements as XML]' \ + '--qualifier-alignment=[If set, overrides the qualifier alignment style determined by the QualifierAlignment style flag]' \ + '--sort-includes[If set, overrides the include sorting behavior determined by the SortIncludes style flag]' \ + '--style=[Set coding style]: :'"($styles)" \ + '--verbose[If set, show the list of processed files]' \ + '*: :_files' + +# Local Variables: +# mode: Shell-Script +# sh-indentation: 2 +# indent-tabs-mode: nil +# sh-basic-offset: 2 +# End: +# vim: ft=zsh sw=2 ts=2 et From d6e881799130a977dfe9c0b26431b368bff47701 Mon Sep 17 00:00:00 2001 From: Shohei YOSHIDA Date: Sat, 3 Dec 2022 13:16:02 +0900 Subject: [PATCH 3/3] Add clang-tidy completion --- src/_clang-tidy | 76 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 src/_clang-tidy diff --git a/src/_clang-tidy b/src/_clang-tidy new file mode 100644 index 0000000..eead4be --- /dev/null +++ b/src/_clang-tidy @@ -0,0 +1,76 @@ +#compdef clang-tidy +# ------------------------------------------------------------------------------ +# Copyright (c) 2022 Github zsh-users - https://github.com/zsh-users +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# ------------------------------------------------------------------------------ +# Description +# ----------- +# +# Completion script for clang-tidy v15.0.2 (https://clang.llvm.org/extra/clang-tidy/) +# +# ------------------------------------------------------------------------------ +# Authors +# ------- +# +# * Shohei Yoshida (https://github.com/syohex) +# +# ------------------------------------------------------------------------------ + +local -a styles=(LLVM GNU Google Chromium Microsoft) + +_arguments \ + '(- *)--help[Display available options]' \ + '(- *)--help-hidden[Display available more options]' \ + '(- *)--help-list[Display list of available options]' \ + '(- *)--help-list-hidden[Display list of more available options]' \ + '--checks=[Comma-separated list of globs with optional "-" prefix]:checks' \ + '--config=[Specifies a configuration in YAML/JSON format]:conf' \ + '--config-file=[Specify the path of .clang-tidy or custom config-file]: :_files' \ + '--dump-config[Dumps configuration in the YAML format to stdout]' \ + '--enable-check-profile[Enable per-check timing profiles, and print a report to stderr]' \ + '--explain-config[For each enabled check explains, where it is enabled]' \ + '--export-fixes=[YAML file to store suggested fixes in]: :_files' \ + '*--extra-arg[Additional argument to append to the compiler command line]:arg' \ + '*--extra-arg-before[Additional argument to prepend to the compiler command line]:arg' \ + '--fix[Apply suggested fixes]' \ + '--fix-errors[Apply suggested fixes even if compilation errors were found]' \ + '--fix-notes[If a warning has no fix, but a single fix can be found through an associated diagnostic node, apply the fix]' \ + '--format-style=[Style for formatting code around applied fixes]: :(llvm google webkit mozilla)' \ + '--header-filter=[Regular expression matching the names of the headers to output diagnostics from]:regexp' \ + '(- *)--list-checks[List all enabled checks and exit]' \ + '--load=[Load the specified plugin]: :_files' \ + '-p[Build directory where compile_commands.json is]: :_files -/' \ + '--quiet[Run clang-tidy in quiet mode]' \ + '--store-check-profile=[These per-TU profiles are instead stored as JSON]:prefix' \ + '--system-headers[Display the errors from system headers]' \ + '--use-color[Use colors in diagnostics]' \ + '--verify-config[Check the config files to ensure each check and option is recognized]' \ + '--vfsoverlay=[Overlay the virtual filesystem described by file over the real file system]: :_files' \ + '--warnings-as-errors=[Upgrades warning to errors]:check' \ + '*: :_files' + +# Local Variables: +# mode: Shell-Script +# sh-indentation: 2 +# indent-tabs-mode: nil +# sh-basic-offset: 2 +# End: +# vim: ft=zsh sw=2 ts=2 et