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:
Andrew Hamilton 2019-05-17 11:10:45 +10:00
parent a7bec363af
commit 5fcdd0ea50
9 changed files with 10 additions and 83 deletions

View file

@ -23,20 +23,19 @@ then to run:
### 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)
.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/)
.pod .pod6 | [perldoc](http://perldoc.perl.org/)
.java | [uncrustify](https://github.com/uncrustify/uncrustify)
.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/) • bcpp • [uncrustify](https://github.com/uncrustify/uncrustify) • [cppcheck](http://sourceforge.net/p/cppcheck/wiki/Home/) • [clang_format](https://clang.llvm.org/docs/ClangFormat.html)
.c .h | [c_syntax_gcc](https://gcc.gnu.org/) • [cppcheck](http://sourceforge.net/p/cppcheck/wiki/Home/)
.cc .cpp .hpp | [cpp_syntax_gcc](https://gcc.gnu.org/) • [cppcheck](http://sourceforge.net/p/cppcheck/wiki/Home/)
.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/) • [clang_format](https://clang.llvm.org/docs/ClangFormat.html)
.js | [js_syntax](http://nodejs.org/)
.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/)
.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/)

View file

@ -434,26 +434,6 @@ def tidy(path):
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

View file

@ -10,15 +10,14 @@ tools_for_extensions = [
# [["pyc"], ["pydisasm"]],
[["pl", "pm", "t"], ["perl_syntax", "perldoc", "perltidy"]],
# [["p6", "pm6"], ["perl6_syntax", "perldoc"]],
[["pod", "pod6"], ["perldoc"]], [["java"], ["uncrustify"]],
[["c", "h"], ["c_syntax_gcc", "uncrustify", "cppcheck", "clang_format"]],
[["cc", "cpp", "hpp"], ["cpp_syntax_gcc", "bcpp", "uncrustify",
"cppcheck", "clang_format"]],
[["pod", "pod6"], ["perldoc"]],
[["c", "h"], ["c_syntax_gcc", "cppcheck"]],
[["cc", "cpp", "hpp"], ["cpp_syntax_gcc", "cppcheck"]],
[["rb"], ["ruby_syntax"]],
[["lua"], ["lua_syntax", "lua_check"]],
[["js"], ["js_syntax", "clang_format"]],
[["js"], ["js_syntax"]],
[["php"], ["php7_syntax"]],
[["go"], ["gofmt", "go_vet", "golint", "godoc"]],
[["go"], ["go_vet", "golint", "godoc"]],
[["bash", "sh", "dash", "ksh"], ["shellcheck"]],
[["pdf"], ["pdf2txt"]],
[["html", "htm"], ["html_syntax", "tidy", "html2text", "pandoc"]],
@ -213,12 +212,6 @@ tools_for_extensions = [
dependencies = ["cppcheck"]
command = "cppcheck"
[clang_format]
dependencies = ["clang-format"]
url = "https://clang.llvm.org/docs/ClangFormat.html"
command = "clang-format"
success_status = "normal"
[ruby_syntax]
dependencies = ["ruby"]
command = "ruby -c"
@ -235,11 +228,6 @@ tools_for_extensions = [
dependencies = ["lua-check"]
command = "luacheck"
[gofmt]
dependencies = ["golang-go"]
command = "gofmt"
success_status = "normal"
[go_vet]
dependencies = ["golang-go"]
command = "go vet"

View file

@ -1,8 +0,0 @@
(B#include(B (B<iostream>(B (B
(B (B
(Busing(B (Bnamespace(B std;(B (B
(B (B
(Bint(B (Bmain(B()(B (B
(B{(B (B
(B cout << (B"Hello World"(B << endl;(B
(B}(B (B

View file

@ -1,7 +0,0 @@
(B#include(B (B<stdio.h>(B (B
(B (B
(Bint(B (Bmain(B()(B (B
(B{(B (B
(B printf((B"Hello World\n"(B);(B
(B (Breturn(B (B0(B;(B (B
(B}(B (B

View file

@ -1,8 +0,0 @@
(B#include(B (B<iostream>(B (B
(B (B
(Busing(B (Bnamespace(B std;(B (B
(B (B
(Bint(B (Bmain(B()(B (B
(B{(B (B
(B cout << (B"Hello World"(B << endl;(B
(B}(B (B

View file

@ -1,6 +0,0 @@
(B#ifndef HELLO_H(B
(B#define HELLO_H(B
(B (B
(Bvoid(B (Bhello(B();(B (B
(B (B
(B#endif(B (B

View file

@ -154,13 +154,6 @@ class ToolsTestCase(unittest.TestCase):
# self._test_tool(tools.perl6_syntax,
# [("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):
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):
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):
self._test_tool(tools.php7_syntax, [("root.php", tools.Status.ok)])