Helpers to build python projects.
The functions provided typically use external programs from the python ecosystem. If they are not installed, there will be errors like
[Errno 2] No such file or directory: 'foo' (ERROR)
for functions using external program foo.
| Function | do |
Runs mypy |
| Function | do |
Runs ruff check |
| Function | do |
Runs ruff format |
Runs mypy
The function is intended to be used as the cmd parameter of a Target. The first
dependency of the target must be a mypy configuration file. All other dependencies
must be directory or file paths to be checked.
The target itself should be a Path which is used to record that the
target was created. See pbutil.touch for why this is useful.
| Parameters | |
target:Path | stamp file recording the fact when this function was actually invoked |
mypyPath | ruff configuration file |
*filesPath | to be checked by ruff |
Runs ruff check
The function is intended to be used as the cmd parameter of a Target. The first
dependency of the target must be a ruff configuration file. All other dependencies
must be directory or file paths to be checked.
The target itself should be a Path which is used to record that the
target was created. See pbutil.touch for why this is useful.
| Parameters | |
target:Path | stamp file recording the fact when this function was actually invoked |
tomlPath | ruff configuration file |
*filesPath | to be checked by ruff |
Runs ruff format
The function is intended to be used as the cmd parameter of a Target. The
first dependency of the target must be a ruff configuration file. All other
dependencies must be directory or file paths to be formatted.
The target itself should be a Path which is used to record that the
target was created. See pbutil.touch for why this is useful.
NOTE: Use with care. If auto-formatting your code for the first time, be sure to commit any pending functional changes first to not mix them with mere formatting changes in one commit.
| Parameters | |
target:Path | stamp file recording the fact when this function was actually invoked |
tomlPath | ruff configuration file |
*filesPath | to be formatted by ruff |