imp

package
v0.18.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LanguageList = []linter.Language{
	{
		Name:  `python`,
		Match: regexp.MustCompile(`\.py$`),
		Fmt:   execCmd{`autopep8`, par{`--in-place`, `--aggressive`, `--aggressive`}, par{}},
		Chk:   execCmd{`pylint`, par{`--rcfile=` + confDir + `/python/.pylintrc`}, par{}},
	}, {
		Name:  `pythondeps`,
		Match: regexp.MustCompile(`requirements.txt$`),
		Fmt:   execCmd{`pur`, par{`-r`}, par{}},
	},

	{
		Name:  `bash`,
		Match: regexp.MustCompile(`\.bash$`),
		Fmt:   execCmd{`shfmt`, par{`-w`, `-ln`, `bash`}, par{}},
		Chk:   execCmd{`shellcheck`, par{`-x`, `--shell=bash`, `-Calways`}, par{}}},
	{
		Name:  `sh`,
		Match: regexp.MustCompile(`\.sh$|/script/[^.]*$`),
		Fmt:   execCmd{`shfmt`, par{`-w`, `-ln`, `posix`}, par{}},
		Chk:   execCmd{`shellcheck`, par{`-x`, `--shell=sh`, `-Calways`}, par{}}},

	{
		Name:  `docker`,
		Match: regexp.MustCompile(`Dockerfile$`),
		Chk:   execCmd{`hadolint`, par{`--ignore`, `DL3007`, `--ignore`, `DL3018`, `--ignore`, `DL3016`, `--ignore`, `DL4006`}, par{}}},

	{
		Name:  `yml`,
		Match: regexp.MustCompile(`\.yml$|\.yaml$`),
		Chk:   execCmd{`yamllint`, par{`-c=` + confDir + `/yaml/.yamllintrc`}, par{}}},

	{
		Name:  `terraform`,
		Match: regexp.MustCompile(`\.tf$`),
		Fmt:   execCmd{`terraform`, par{`fmt`}, par{}},
		Chk:   execCmd{`terraform`, par{`fmt`, `-check=true`}, par{}}},

	{
		Name:  `javascript`,
		Match: regexp.MustCompile(`\.js$|\.jsx$`),
		Fmt:   execCmd{`standard`, par{`--fix`}, par{}},
		Chk:   execCmd{`standard`, par{}, par{}}},

	{
		Name:  `golang`,
		Match: regexp.MustCompile(`\.go$`),
		Fmt:   execCmd{`gofmt`, par{`-l`, `-w`}, par{}},
		Chk:   execCmd{`golint`, par{`-set_exit_status`}, par{}},
	},

	{
		Name:  `markdown`,
		Match: regexp.MustCompile(`\.md$`),
		Fmt:   execCmd{`remark`, par{`--use`, `remark-preset-lint-recommended`}, par{`-o`}},
		Chk:   newValeLint(confDir + `/markdown/.vale.ini`)},

	{
		Name:  `asciidoctor`,
		Match: regexp.MustCompile(`\.adoc$`),
		Chk:   newValeLint(confDir + `/markdown/.vale.ini`)},

	{
		Name:  `json`,
		Match: regexp.MustCompile(`\.json$|\.JSON$`),
		Fmt:   execCmd{`jsonlint`, par{`-i`, `-s`, `-c`, `-q`}, par{}},
		Chk:   execCmd{`jsonlint`, par{`-q`}, par{}}},

	{
		Name:  `cpp`,
		Match: regexp.MustCompile(`\.cc$|\.cpp$`),
		Fmt:   execCmd{`clang-format`, par{`-style=file`, `-i`}, par{}},
		Chk:   execCmd{`cppcheck`, par{`--enable=all`, `--language=c++`, `--suppress=operatorEqRetRefThis`, `--suppress=operatorEq`, `--suppress=noExplicitConstructor`, `--suppress=unmatchedSuppression`, `--suppress=missingInclude`, `--suppress=unusedFunction`, `--suppress=noConstructor`, `--inline-suppr`, `--error-exitcode=1`}, par{}}},

	{
		Name:  `cppheaders`,
		Match: regexp.MustCompile(`\.h$|\.hpp$`),
		Fmt:   execCmd{`clang-format`, par{`-style=file`, `-i`}, par{}}},

	{
		Name:  `c`,
		Match: regexp.MustCompile(`\.c$`),
		Fmt:   execCmd{`clang-format`, par{`-style=file`, `-i`}, par{}},
		Chk:   execCmd{`cppcheck`, par{`--enable=all`, `--language=c`, `--suppress=operatorEqRetRefThis`, `--suppress=operatorEq`, `--suppress=noExplicitConstructor`, `--suppress=unmatchedSuppression`, `--suppress=missingInclude`, `--suppress=unusedFunction`, `--suppress=noConstructor`, `--inline-suppr`, `--error-exitcode=1`}, par{}}},

	{
		Name:  `cmake`,
		Match: regexp.MustCompile(`CMakeLists.txt$|\.cmake$`),
		Chk:   execCmd{`cmakelint`, par{`--config=` + confDir + `/cmake/.cmakelintrc`}, par{}}},

	{
		Name:  `ansible`,
		Match: regexp.MustCompile(`playbook.yml$`),
		Chk:   execCmd{`ansible-lint`, par{}, par{}}},

	{
		Name:  `dockercompose`,
		Match: regexp.MustCompile(`docker-compose.yml$|docker-compose.yaml$`),
		Chk:   execCmd{`docker-compose`, par{`-f`}, par{`config`, `-q`}}}}

LanguageList is a monolithic configuration of all cries standard linters

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL