-
Notifications
You must be signed in to change notification settings - Fork 356
/
precious.toml
70 lines (65 loc) · 1.88 KB
/
precious.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
exclude = "vendor/**/*"
[commands.goimports]
type = "tidy"
include = "**/*.go"
cmd = [ "$PRECIOUS_ROOT/dev-bin/goimports", "-w" ]
ok-exit-codes = [0]
# We could run this via golangci-lint but we want to exclude more directories
# for gosec than we do for other linting. There doesn't seem to be a way to
# configure these excludes when running gosec as part of golangci-lint.
[commands.gosec]
type = "lint"
include = "**/*.go"
exclude = [
"buildscript/**/*.go",
"common/testutil/**/*.go",
"release/**/*.go",
"vendor/**/*.go",
]
invoke.per-dir-or-once = 7
working-dir = "root"
path-args = "dir"
# This wrapper lets us control the output with an env var so we can generate a
# SARIF report in Evergreen but use the default format for linting.
cmd = [
"$PRECIOUS_ROOT/etc/gosec-wrapper.sh",
# This rule complains about reading or writing to paths based on user input,
# but most of the tools exist for the purpose of reading and writing from/to
# user-provided paths.
"-exclude", "G304",
"-severity", "high",
"-terse",
]
ok_exit_codes = [0]
lint_failure_exit_codes = [1]
[commands.prettier-yaml]
type = "both"
invoke = "once"
working-dir = "root"
path-args = "file"
include = [ "**/*.yml", "**/*.yaml" ]
cmd = "$PRECIOUS_ROOT/node_modules/.bin/prettier"
lint-flags = "--check"
tidy-flags = "--write"
ok-exit-codes = [0]
lint-failure-exit-codes = [1]
ignore-stderr = ".*"
[commands.prettier-md]
type = "both"
invoke = "once"
working-dir = "root"
path-args = "file"
include = [ "*.md" ]
cmd = [
"$PRECIOUS_ROOT/node_modules/.bin/prettier",
"--print-width", "100",
"--prose-wrap", "always",
]
lint-flags = "--check"
tidy-flags = "--write"
ok-exit-codes = [0]
lint-failure-exit-codes = [1]
ignore-stderr = ".*"
# It'd be nice to use prettier to tidy the JS code too, but it seems to make
# changes that cause it to fail to parse with the versions of the Mongo shell
# we use.