Remove code formatters.
- Maybe these should be returned if the output is a diff with the current file. - bcpp, uncrustify, gofmt, clang_format.
This commit is contained in:
parent
a7bec363af
commit
5fcdd0ea50
9 changed files with 10 additions and 83 deletions
11
README.md
11
README.md
|
|
@ -23,20 +23,19 @@ then to run:
|
||||||
|
|
||||||
### Tools
|
### Tools
|
||||||
|
|
||||||
Extensions(94) | Tools(60)
|
Extensions(93) | Tools(56)
|
||||||
----------:| -----
|
----------:| -----
|
||||||
.* | [contents](http://pygments.org/) • metadata • [git_blame](https://git-scm.com/docs/git-blame) • [git_log](https://git-scm.com/docs/git-log)
|
.* | [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://mypy-lang.org/) • [python_coverage](https://coverage.readthedocs.io/) • [pycodestyle](http://pycodestyle.pycqa.org/en/latest/) • [pydocstyle](http://www.pydocstyle.org/en/2.1.1/usage.html) • [pyflakes](https://pypi.org/project/pyflakes/) • [pylint](https://www.pylint.org/) • [python_gut](https://github.com/ahamilton/eris/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://pypi.org/project/mccabe/) • [bandit](https://pypi.org/project/bandit/)
|
.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://mypy-lang.org/) • [python_coverage](https://coverage.readthedocs.io/) • [pycodestyle](http://pycodestyle.pycqa.org/en/latest/) • [pydocstyle](http://www.pydocstyle.org/en/2.1.1/usage.html) • [pyflakes](https://pypi.org/project/pyflakes/) • [pylint](https://www.pylint.org/) • [python_gut](https://github.com/ahamilton/eris/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://pypi.org/project/mccabe/) • [bandit](https://pypi.org/project/bandit/)
|
||||||
.pl .pm .t | [perl_syntax](https://en.wikipedia.org/wiki/Perl) • [perldoc](http://perldoc.perl.org/) • [perltidy](http://perltidy.sourceforge.net/)
|
.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/)
|
.pod .pod6 | [perldoc](http://perldoc.perl.org/)
|
||||||
.java | [uncrustify](https://github.com/uncrustify/uncrustify)
|
.c .h | [c_syntax_gcc](https://gcc.gnu.org/) • [cppcheck](http://sourceforge.net/p/cppcheck/wiki/Home/)
|
||||||
.c .h | [c_syntax_gcc](https://gcc.gnu.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/) • [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/) • [clang_format](https://clang.llvm.org/docs/ClangFormat.html)
|
|
||||||
.rb | [ruby_syntax](http://www.ruby-lang.org/)
|
.rb | [ruby_syntax](http://www.ruby-lang.org/)
|
||||||
.lua | [lua_syntax](http://www.lua.org) • [lua_check](https://github.com/mpeterv/luacheck)
|
.lua | [lua_syntax](http://www.lua.org) • [lua_check](https://github.com/mpeterv/luacheck)
|
||||||
.js | [js_syntax](http://nodejs.org/) • [clang_format](https://clang.llvm.org/docs/ClangFormat.html)
|
.js | [js_syntax](http://nodejs.org/)
|
||||||
.php | [php7_syntax](https://en.wikipedia.org/wiki/PHP)
|
.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)
|
.go | [go_vet](https://golang.org) • [golint](https://github.com/golang/lint) • [godoc](http://golang.org/x/tools)
|
||||||
.bash .sh .dash .ksh | [shellcheck](https://www.shellcheck.net/)
|
.bash .sh .dash .ksh | [shellcheck](https://www.shellcheck.net/)
|
||||||
.pdf | [pdf2txt](https://github.com/pdfminer/pdfminer.six)
|
.pdf | [pdf2txt](https://github.com/pdfminer/pdfminer.six)
|
||||||
.html .htm | [html_syntax](http://www.html-tidy.org/) • [tidy](http://www.html-tidy.org/) • [html2text](http://www.mbayer.de/html2text/) • [pandoc](https://pandoc.org/)
|
.html .htm | [html_syntax](http://www.html-tidy.org/) • [tidy](http://www.html-tidy.org/) • [html2text](http://www.mbayer.de/html2text/) • [pandoc](https://pandoc.org/)
|
||||||
|
|
|
||||||
|
|
@ -434,26 +434,6 @@ def tidy(path):
|
||||||
return Status.normal, fill3.Text(stdout)
|
return Status.normal, fill3.Text(stdout)
|
||||||
|
|
||||||
|
|
||||||
@deps(deps={"bcpp"}, executables={"bcpp"})
|
|
||||||
def bcpp(path):
|
|
||||||
stdout, stderr, returncode = _do_command(["bcpp", "-fi", path])
|
|
||||||
status = Status.normal if returncode == 0 else Status.problem
|
|
||||||
return status, _syntax_highlight_using_path(stdout, path)
|
|
||||||
|
|
||||||
|
|
||||||
@deps(deps={"uncrustify"}, url="uncrustify", executables={"uncrustify"})
|
|
||||||
def uncrustify(path):
|
|
||||||
with tempfile.TemporaryDirectory() as temp_dir:
|
|
||||||
config_path = os.path.join(temp_dir, "uncrustify.cfg")
|
|
||||||
stdout, stderr, returncode = _do_command(
|
|
||||||
["uncrustify", "--detect", "-f", path, "-o", config_path])
|
|
||||||
if returncode == 0:
|
|
||||||
stdout, stderr, returncode = _do_command(
|
|
||||||
["uncrustify", "-c", config_path, "-f", path])
|
|
||||||
status = Status.normal if returncode == 0 else Status.problem
|
|
||||||
return status, _syntax_highlight_using_path(stdout, path)
|
|
||||||
|
|
||||||
|
|
||||||
MAX_IMAGE_SIZE = 200
|
MAX_IMAGE_SIZE = 200
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,15 +10,14 @@ tools_for_extensions = [
|
||||||
# [["pyc"], ["pydisasm"]],
|
# [["pyc"], ["pydisasm"]],
|
||||||
[["pl", "pm", "t"], ["perl_syntax", "perldoc", "perltidy"]],
|
[["pl", "pm", "t"], ["perl_syntax", "perldoc", "perltidy"]],
|
||||||
# [["p6", "pm6"], ["perl6_syntax", "perldoc"]],
|
# [["p6", "pm6"], ["perl6_syntax", "perldoc"]],
|
||||||
[["pod", "pod6"], ["perldoc"]], [["java"], ["uncrustify"]],
|
[["pod", "pod6"], ["perldoc"]],
|
||||||
[["c", "h"], ["c_syntax_gcc", "uncrustify", "cppcheck", "clang_format"]],
|
[["c", "h"], ["c_syntax_gcc", "cppcheck"]],
|
||||||
[["cc", "cpp", "hpp"], ["cpp_syntax_gcc", "bcpp", "uncrustify",
|
[["cc", "cpp", "hpp"], ["cpp_syntax_gcc", "cppcheck"]],
|
||||||
"cppcheck", "clang_format"]],
|
|
||||||
[["rb"], ["ruby_syntax"]],
|
[["rb"], ["ruby_syntax"]],
|
||||||
[["lua"], ["lua_syntax", "lua_check"]],
|
[["lua"], ["lua_syntax", "lua_check"]],
|
||||||
[["js"], ["js_syntax", "clang_format"]],
|
[["js"], ["js_syntax"]],
|
||||||
[["php"], ["php7_syntax"]],
|
[["php"], ["php7_syntax"]],
|
||||||
[["go"], ["gofmt", "go_vet", "golint", "godoc"]],
|
[["go"], ["go_vet", "golint", "godoc"]],
|
||||||
[["bash", "sh", "dash", "ksh"], ["shellcheck"]],
|
[["bash", "sh", "dash", "ksh"], ["shellcheck"]],
|
||||||
[["pdf"], ["pdf2txt"]],
|
[["pdf"], ["pdf2txt"]],
|
||||||
[["html", "htm"], ["html_syntax", "tidy", "html2text", "pandoc"]],
|
[["html", "htm"], ["html_syntax", "tidy", "html2text", "pandoc"]],
|
||||||
|
|
@ -213,12 +212,6 @@ tools_for_extensions = [
|
||||||
dependencies = ["cppcheck"]
|
dependencies = ["cppcheck"]
|
||||||
command = "cppcheck"
|
command = "cppcheck"
|
||||||
|
|
||||||
[clang_format]
|
|
||||||
dependencies = ["clang-format"]
|
|
||||||
url = "https://clang.llvm.org/docs/ClangFormat.html"
|
|
||||||
command = "clang-format"
|
|
||||||
success_status = "normal"
|
|
||||||
|
|
||||||
[ruby_syntax]
|
[ruby_syntax]
|
||||||
dependencies = ["ruby"]
|
dependencies = ["ruby"]
|
||||||
command = "ruby -c"
|
command = "ruby -c"
|
||||||
|
|
@ -235,11 +228,6 @@ tools_for_extensions = [
|
||||||
dependencies = ["lua-check"]
|
dependencies = ["lua-check"]
|
||||||
command = "luacheck"
|
command = "luacheck"
|
||||||
|
|
||||||
[gofmt]
|
|
||||||
dependencies = ["golang-go"]
|
|
||||||
command = "gofmt"
|
|
||||||
success_status = "normal"
|
|
||||||
|
|
||||||
[go_vet]
|
[go_vet]
|
||||||
dependencies = ["golang-go"]
|
dependencies = ["golang-go"]
|
||||||
command = "go vet"
|
command = "go vet"
|
||||||
|
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
(B[m[38;2;205;40;40m[48;2;32;32;32m[1m#include(B[m[38;2;208;208;208m[48;2;32;32;32m (B[m[38;2;153;153;153m[48;2;32;32;32m[3m<iostream>(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;106;184;37m[48;2;32;32;32m[1musing(B[m[38;2;208;208;208m[48;2;32;32;32m (B[m[38;2;106;184;37m[48;2;32;32;32m[1mnamespace(B[m[38;2;208;208;208m[48;2;32;32;32m std;(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;106;184;37m[48;2;32;32;32m[1mint(B[m[38;2;208;208;208m[48;2;32;32;32m (B[m[38;2;68;127;207m[48;2;32;32;32mmain(B[m[38;2;208;208;208m[48;2;32;32;32m()(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;208;208;208m[48;2;32;32;32m{(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;208;208;208m[48;2;32;32;32m cout << (B[m[38;2;237;157;19m[48;2;32;32;32m"Hello World"(B[m[38;2;208;208;208m[48;2;32;32;32m << endl;(B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;208;208;208m[48;2;32;32;32m}(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
(B[m
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
(B[m[38;2;205;40;40m[48;2;32;32;32m[1m#include(B[m[38;2;208;208;208m[48;2;32;32;32m (B[m[38;2;153;153;153m[48;2;32;32;32m[3m<stdio.h>(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;106;184;37m[48;2;32;32;32m[1mint(B[m[38;2;208;208;208m[48;2;32;32;32m (B[m[38;2;68;127;207m[48;2;32;32;32mmain(B[m[38;2;208;208;208m[48;2;32;32;32m()(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;208;208;208m[48;2;32;32;32m{(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;208;208;208m[48;2;32;32;32m printf((B[m[38;2;237;157;19m[48;2;32;32;32m"Hello World\n"(B[m[38;2;208;208;208m[48;2;32;32;32m);(B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;208;208;208m[48;2;32;32;32m (B[m[38;2;106;184;37m[48;2;32;32;32m[1mreturn(B[m[38;2;208;208;208m[48;2;32;32;32m (B[m[38;2;54;119;169m[48;2;32;32;32m0(B[m[38;2;208;208;208m[48;2;32;32;32m;(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;208;208;208m[48;2;32;32;32m}(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
(B[m[38;2;205;40;40m[48;2;32;32;32m[1m#include(B[m[38;2;208;208;208m[48;2;32;32;32m (B[m[38;2;153;153;153m[48;2;32;32;32m[3m<iostream>(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;106;184;37m[48;2;32;32;32m[1musing(B[m[38;2;208;208;208m[48;2;32;32;32m (B[m[38;2;106;184;37m[48;2;32;32;32m[1mnamespace(B[m[38;2;208;208;208m[48;2;32;32;32m std;(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;106;184;37m[48;2;32;32;32m[1mint(B[m[38;2;208;208;208m[48;2;32;32;32m (B[m[38;2;68;127;207m[48;2;32;32;32mmain(B[m[38;2;208;208;208m[48;2;32;32;32m()(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;208;208;208m[48;2;32;32;32m{(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;208;208;208m[48;2;32;32;32m cout << (B[m[38;2;237;157;19m[48;2;32;32;32m"Hello World"(B[m[38;2;208;208;208m[48;2;32;32;32m << endl;(B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;208;208;208m[48;2;32;32;32m}(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
(B[m[38;2;205;40;40m[48;2;32;32;32m[1m#ifndef HELLO_H(B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;205;40;40m[48;2;32;32;32m[1m#define HELLO_H(B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;106;184;37m[48;2;32;32;32m[1mvoid(B[m[38;2;208;208;208m[48;2;32;32;32m (B[m[38;2;68;127;207m[48;2;32;32;32mhello(B[m[38;2;208;208;208m[48;2;32;32;32m();(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m[38;2;255;255;255m[48;2;0;0;0m
|
|
||||||
(B[m[38;2;205;40;40m[48;2;32;32;32m[1m#endif(B[m[38;2;255;255;255m[48;2;32;32;32m (B[m
|
|
||||||
|
|
@ -154,13 +154,6 @@ class ToolsTestCase(unittest.TestCase):
|
||||||
# self._test_tool(tools.perl6_syntax,
|
# self._test_tool(tools.perl6_syntax,
|
||||||
# [("perl6.p6", tools.Status.problem)])
|
# [("perl6.p6", tools.Status.problem)])
|
||||||
|
|
||||||
def test_uncrustify(self):
|
|
||||||
self._test_tool(tools.uncrustify,
|
|
||||||
[("closure-util.java", tools.Status.problem),
|
|
||||||
("hello.c", tools.Status.normal),
|
|
||||||
("hello.h", tools.Status.normal),
|
|
||||||
("hello.cpp", tools.Status.normal)])
|
|
||||||
|
|
||||||
def test_c_syntax_gcc(self):
|
def test_c_syntax_gcc(self):
|
||||||
self._test_tool(tools.c_syntax_gcc, [("hello.c", tools.Status.ok)])
|
self._test_tool(tools.c_syntax_gcc, [("hello.c", tools.Status.ok)])
|
||||||
|
|
||||||
|
|
@ -204,9 +197,6 @@ class ToolsTestCase(unittest.TestCase):
|
||||||
def test_cpp_syntax_gcc(self):
|
def test_cpp_syntax_gcc(self):
|
||||||
self._test_tool(tools.cpp_syntax_gcc, [("hello.cpp", tools.Status.ok)])
|
self._test_tool(tools.cpp_syntax_gcc, [("hello.cpp", tools.Status.ok)])
|
||||||
|
|
||||||
def test_bcpp(self):
|
|
||||||
self._test_tool(tools.bcpp, [("hello.cpp", tools.Status.normal)])
|
|
||||||
|
|
||||||
def test_php7_syntax(self):
|
def test_php7_syntax(self):
|
||||||
self._test_tool(tools.php7_syntax, [("root.php", tools.Status.ok)])
|
self._test_tool(tools.php7_syntax, [("root.php", tools.Status.ok)])
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue