Projects usually become cluttered with obsolete files after some time.
To clean the project, type
pytask clean.
--8<-- "docs/source/_static/md/clean-dry-run.md"
pytask performs a dry-run by default and lists all removable files.
If you want to remove the files, use
pytask clean --mode with one of
the following modes.
forceremoves all files suggested in thedry-runwithout any confirmation.interactiveallows you to decide for every file whether to keep it or not.
If you want to delete complete folders instead of single files, use
pytask clean --directories.
--8<-- "docs/source/_static/md/clean-dry-run-directories.md"
pytask excludes files that are under version control with git.
Use the
pytask clean --exclude option
or the exclude key in the configuration file to exclude files and directories.
Values can be Unix filename patterns that, for example, support the wildcard character
* for any characters. You find the documentation in fnmatch.
Here is an example for excluding a folder.
$ pytask clean --exclude obsolete_folderor
[tool.pytask.ini_options]
exclude = ["obsolete_folder"]