How to configure pysen#
Overview#
[tool.pysen]
version = "0.10"
builder = "lint.py"
[tool.pysen.lint]
enable_black = true
enable_flake8 = true
enable_isort = true
enable_mypy = true
mypy_preset = "strict"
line_length = 88
py_version = "py37"
[[tool.pysen.lint.mypy_targets]]
paths = ["."]
tool.pysen
corresponds topysen.pyproject_model.Config
For example,
builder
under[tool.pysen]
passes topysen.pyproject_model.Config
tool.pysen.lint
corresponds topysen.pyproject_model.LintConfig
If you specify
line_length
to88
, it is passed topysen.pyproject_model.LintConfig
tool.pysen.plugin
, corresponds topysen.pyproject_model.PluginConfig
You can know what you can change a configuration by checking Config
,
LintConfig
, and PluginConfig
.
If a entry is not an instance of Python built-in class, it cannot be directly specified.
For example, mypy_targets
corresponds to pysen.ext.mypy_wrapper.MypyTarget
, which is not a Python built-in (or equivarent to built-in) class.
To configure such option, you need to create a section [[tool.pysen.lint.mypy_targets]]
.
MypyPlugin
has parameters paths
and namespace_packages
.
Since paths
is equivarent to str
and namespace_packages
is bool
, you can set them in the section.
Note that namespace_packages
is omitted since it is False
by default.