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         = ["."]

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.