From 8289e229194dab602266267ea484ffa81b8dc8fe Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Sat, 9 Jun 2018 11:45:11 +1000 Subject: [PATCH] tools: Added clang-format for C, C++ and Javascript files. --- README.md | 8 ++++---- vigil/tools.toml | 12 +++++++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c50df85..25b2a2d 100644 --- a/README.md +++ b/README.md @@ -23,18 +23,18 @@ then to run: ### Tools -Extensions(93) | Tools(61) +Extensions(93) | Tools(62) ----------:| ----- .* | [contents](http://pygments.org/) • metadata • [git_blame](https://git-scm.com/docs/git-blame) • [git_log](https://git-scm.com/docs/git-log) .py | [python_syntax](https://en.wikipedia.org/wiki/Python_syntax_and_semantics) • [python_unittests](https://docs.python.org/3/library/unittest.html) • [pydoc](https://docs.python.org/3/library/pydoc.html) • [mypy](http://www.mypy-lang.org/) • [python_coverage](http://nedbatchelder.com/code/coverage/) • [pycodestyle](https://pypi.python.org/pypi/pycodestyle) • [pydocstyle](http://pydocstyle.readthedocs.org/) • [pyflakes](https://launchpad.net/pyflakes) • [pylint](http://www.pylint.org/) • [python_gut](https://github.com/ahamilton/vigil/blob/master/gut.py) • [python_modulefinder](https://docs.python.org/3/library/modulefinder.html) • [dis](https://docs.python.org/3/library/dis.html) • [python_mccabe](https://github.com/flintwork/mccabe) • [bandit](https://wiki.openstack.org/wiki/Security/Projects/Bandit) .pl .pm .t | [perl_syntax](https://en.wikipedia.org/wiki/Perl) • [perldoc](http://perldoc.perl.org/) • [perltidy](http://perltidy.sourceforge.net/) .pod .pod6 | [perldoc](http://perldoc.perl.org/) .java | [uncrustify](https://github.com/uncrustify/uncrustify) -.c .h | [c_syntax_gcc](https://gcc.gnu.org/) • [splint](http://www.splint.org/) • [uncrustify](https://github.com/uncrustify/uncrustify) • [cppcheck](http://sourceforge.net/p/cppcheck/wiki/Home/) -.cc .cpp .hpp | [cpp_syntax_gcc](https://gcc.gnu.org/) • bcpp • [uncrustify](https://github.com/uncrustify/uncrustify) • [cppcheck](http://sourceforge.net/p/cppcheck/wiki/Home/) +.c .h | [c_syntax_gcc](https://gcc.gnu.org/) • [splint](http://www.splint.org/) • [uncrustify](https://github.com/uncrustify/uncrustify) • [cppcheck](http://sourceforge.net/p/cppcheck/wiki/Home/) • [clang_format](https://clang.llvm.org/docs/ClangFormat.html) +.cc .cpp .hpp | [cpp_syntax_gcc](https://gcc.gnu.org/) • bcpp • [uncrustify](https://github.com/uncrustify/uncrustify) • [cppcheck](http://sourceforge.net/p/cppcheck/wiki/Home/) • [clang_format](https://clang.llvm.org/docs/ClangFormat.html) .rb | [ruby_syntax](http://www.ruby-lang.org/) .lua | [lua_syntax](http://www.lua.org) • [lua_check](https://github.com/mpeterv/luacheck) -.js | [js_syntax](http://nodejs.org/) +.js | [js_syntax](http://nodejs.org/) • [clang_format](https://clang.llvm.org/docs/ClangFormat.html) .php | [php7_syntax](https://en.wikipedia.org/wiki/PHP) .go | [gofmt](https://golang.org) • [go_vet](https://golang.org) • [golint](https://github.com/golang/lint) • [godoc](http://golang.org/x/tools) .bash .sh .dash .ksh | [shellcheck](http://hackage.haskell.org/package/ShellCheck) diff --git a/vigil/tools.toml b/vigil/tools.toml index c380688..975d816 100644 --- a/vigil/tools.toml +++ b/vigil/tools.toml @@ -11,12 +11,12 @@ tools_for_extensions = [ [["pl", "pm", "t"], ["perl_syntax", "perldoc", "perltidy"]], # [["p6", "pm6"], ["perl6_syntax", "perldoc"]], [["pod", "pod6"], ["perldoc"]], [["java"], ["uncrustify"]], - [["c", "h"], ["c_syntax_gcc", "splint", "uncrustify", "cppcheck"]], + [["c", "h"], ["c_syntax_gcc", "splint", "uncrustify", "cppcheck", "clang_format"]], [["cc", "cpp", "hpp"], ["cpp_syntax_gcc", "bcpp", "uncrustify", - "cppcheck"]], + "cppcheck", "clang_format"]], [["rb"], ["ruby_syntax"]], [["lua"], ["lua_syntax", "lua_check"]], - [["js"], ["js_syntax"]], + [["js"], ["js_syntax", "clang_format"]], [["php"], ["php7_syntax"]], [["go"], ["gofmt", "go_vet", "golint", "godoc"]], [["bash", "sh", "dash", "ksh"], ["shellcheck"]], @@ -191,6 +191,12 @@ tools_for_extensions = [ url = "cppcheck" command = "cppcheck" +[clang_format] + dependencies = ["clang-format"] + url = "https://clang.llvm.org/docs/ClangFormat.html" + command = "clang-format-6.0" + success_status = "normal" + [ruby_syntax] dependencies = ["ruby"] url = "ruby"