Skip to content

Settings

All settings live under [tool.pyspark-antipattern] in your pyproject.toml.

Setting Type Default Description
select list[str] [] Show only these rules (whitelist)
warn list[str] [] Rules downgraded to warnings
ignore list[str] [] Rules completely silenced
severity str null Minimum performance-impact level to report ("low", "medium", "high")
pyspark_version str null Cluster PySpark version — silences rules requiring a newer version (e.g. "3.4")
show_information bool false Show inline explanation per violation
show_best_practice bool false Show best-practice guidance per violation
distinct_threshold int 5 Max .distinct() calls before S004 fires
explode_threshold int 3 Max explode() calls before S008 fires
loop_threshold int 10 Max loop iterations before L001/L002/L003 fire
exclude_dirs list[str] built-in list Directories skipped during recursive scan
max_shuffle_operations int 9 Max shuffle ops between checkpoints before PERF003 fires

Inline suppression

Violations can also be suppressed directly in source files using # noqa comments — no pyproject.toml change needed.

Form Scope
# noqa: pap: D001 Suppress rule D001 on this line
# noqa: pap: D001, S004 Suppress multiple rules on this line
# noqa: pap Suppress all pap rules on this line
# noqa: pap: FILE Suppress all violations in the entire file

See noqa for full details and examples.