Documentation
¶
Overview ¶
Package classifytest holds the classifier fixtures shared by unit and conformance tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllowedFromPrefixSibling = [][]string{{"../auth"}, {"../auth/"}, {"../auth/login.ts"}}
From src/lib/auth-utils: a sibling directory whose path is a string prefix of the cwd's path (src/lib/auth) is not an ancestor, so it is allowed; the real ancestors stay refused.
var AllowedFromRoot = joinRows(allowedFromRootRows, allowedMoreRows, infoFlagRows())
AllowedFromRoot: every row must pass with cwd = work-tree root.
var AllowedFromSubdir = [][]string{
{"components"}, {"./components/"}, {"api", "components"}, {"../../e2e/targets"}, {"../../src/app/api"}, {"self/components"},
}
var EslintInfoFlags = []string{"--stdin", "--version", "-v", "--help", "-h", "--print-config", "--init", "--inspect-config",
"--env-info", "--debug-info", "--mcp"}
EslintInfoFlags lint nothing (information and setup flags); eslint and tsc with them are allowed.
var EslintValueOptions = []string{"-c", "--config", "--max-warnings", "--fix-type", "--ignore-path", "--suppress-rule",
"--format", "-f", "--stdin-filename", "--rule", "--parser", "--plugin", "--ext", "--cache-location", "--rulesdir", "-o",
"--output-file", "--resolve-plugins-relative-to", "--parser-options", "--ignore-pattern", "--env", "--global",
"--cache-strategy", "--report-unused-disable-directives-severity", "--suppressions-location", "--concurrency", "--flag"}
EslintValueOptions are the eslint options that take a value and are listed in skip_option_values: `npx eslint <opt> x` names no file, so it is a repo-wide lint, while a file after the value is scoped.
var PackageManagerSpellings = [][]string{
{"npm", "test"}, {"npm", "t"}, {"npm", "tst"}, {"npm", "run", "test"},
{"npm", "run", "-w", "pkg", "test"}, {"npm", "run", "--workspace", "pkg", "test"},
{"npm", "run", "--prefix", "sub", "test"}, {"npm", "--loglevel", "silent", "run", "test"},
{"npm", "--cache", "/tmp/c", "run", "test"}, {"npm", "--registry", "http://r", "test"},
{"npm", "--userconfig", "u", "run", "test"}, {"npm", "--globalconfig", "g", "run", "test"},
{"npm", "-w", "pkg", "test"}, {"pnpm", "run", "--filter", "pkg", "test"},
{"pnpm", "run", "-F", "pkg", "test"}, {"pnpm", "--filter", "pkg", "test"}, {"yarn", "run", "--cwd", "pkg", "test"},
}
var RefusedFromPrefixSibling = [][]string{{".."}, {"../.."}, {"."}}
var RefusedFromRoot = joinRows(refusedFromRootRows, refusedMoreRows, eslintValueRows(), wrapperValueRows(), nodeValueRows())
RefusedFromRoot: every row must be refused with cwd = work-tree root.
var RefusedFromSubdir = [][]string{
{"."}, {"./"}, {".."}, {"../.."}, {"../../src"}, {"../../e2e"}, {"../../scripts"}, {"self"}, {"/"},
{"../app/."}, {"components", "."}, {"$PWD"},
}
From src/app of a work tree (with src/app/self -> .): eslint path arguments.
var ToolSpellings = [][]string{
{"npm", "exec", "-w", "pkg", "eslint", "."}, {"npm", "exec", "--workspace", "pkg", "eslint", "."},
{"npm", "exec", "--prefix", "sub", "eslint", "."}, {"npm", "--loglevel", "silent", "exec", "eslint", "."},
{"pnpm", "--filter", "pkg", "exec", "tsc"}, {"npx", "-w", "pkg", "eslint", "."},
}
ToolSpellings are refused by NodeMonorepoRules from the work-tree root.
Functions ¶
func FixtureTree ¶
FixtureTree builds the work tree the tables assume and returns its canonical root.
func NodeMonorepoRules ¶
func NodeMonorepoRules() []config.RefuseRule
NodeMonorepoRules mirrors examples/node-monorepo/.bitc.toml [pools.lint] refuse.
func TestScriptRules ¶
func TestScriptRules() []config.RefuseRule
TestScriptRules refuses the npm script "test"; PackageManagerSpellings are every spelling of running it that must be refused (audit D).
Types ¶
This section is empty.