Configuration (jaxlint.toml / pyproject.toml)#
jaxlint discovers optional settings by walking upward from a starting directory ([root] + root.parents):
the
--configdirectory (CLI), when--configpoints at a directory;the current working directory, when
--configis omitted;or only the
--configfile, when--configpoints atjaxlint.tomlorpyproject.toml(no upward walk).
At each directory during the walk:
If
jaxlint.tomlexists in that directory, parse configuration from it and stop (pyproject.tomlin the same directory is not read).Else if
pyproject.tomlexists there, parse[tool.jaxlint]from it and stop.Else continue to the parent directory.
If both jaxlint.toml and pyproject.toml exist in the same directory, loading fails with ValueError (pick one file).
Section layout by file#
File |
Sections |
|---|---|
|
Native |
|
|
Equivalent settings under [jaxlint] vs [tool.jaxlint] in jaxlint.toml produce the same parsed LintConfig (including disk cache fingerprints).
Parsed keys live in LintConfig (jaxlint.core.config). TOML keys use kebab-case; Python attributes use snake_case.
Keys#
TOML key |
Type |
Default |
Meaning |
|---|---|---|---|
|
list of strings |
(empty) |
If non-empty, only rules whose id matches any pattern (see below) run. |
|
list of strings |
(empty) |
Rules matching any pattern are skipped after per-file rules. |
|
string |
|
Passed to the docstring style validator (Griffe-backed). |
|
list of strings |
|
Section titles required in public APIs (see JD002). |
|
list of strings |
|
Canonical order for JD003 warnings. |
|
bool |
|
If |
|
float |
|
Default threshold for |
|
string (path) |
(unset) |
Optional directory for caching |
|
table |
|
Map rule-id patterns → |
|
string (URL) |
(unset) |
When set, |
|
table |
|
Map of glob patterns → rule patterns to disable for matching paths. |
select, ignore, and per-file-ignores patterns#
Matching is implemented by pattern_matches in jaxlint.core.config:
Exact:
JL001matches onlyJL001.Prefix: a pattern ending with
*matches rule ids that start with the prefix before*. Example:JLmatches every id starting withJL;JL*does the same.
per-file-ignores keys are matched with fnmatch against the string form of the file path passed to rule_enabled (typically relative paths like tests/fixtures/foo.py). Values can be a single string or a list of strings; each entry uses the same pattern rules as ignore.
Examples#
Standalone config file (jaxlint.toml) — native table:
[jaxlint]
select = ["JD", "JM"]
Project manifest (pyproject.toml) — PEP 621 tool table:
[tool.jaxlint]
select = ["JD", "JM"]
Strict shape checks (JL005 as errors), native jaxlint.toml:
[jaxlint]
strict-shapes = true
Downgrade JL005 to a warning even when strict-shapes is true (override wins):
[jaxlint]
strict-shapes = true
[jaxlint.severity-overrides]
JL005 = "warning"
The same layout under [tool.jaxlint] / [tool.jaxlint.severity-overrides] remains valid in jaxlint.toml for backward compatibility.
Ignore JL005 everywhere except tune per directory:
[jaxlint]
ignore = ["JL005"]
[jaxlint.per-file-ignores]
"experimental/**" = ["JL012"]
"kernels/**/*.py" = ["JL005", "JL010"]
Custom section order for JD003:
[jaxlint]
section-order = ["Parameters", "Returns", "Examples", "Raises"]