Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 1.5 KB

File metadata and controls

50 lines (32 loc) · 1.5 KB

Cleaning projects

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.

  • force removes all files suggested in the dry-run without any confirmation.
  • interactive allows 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"

Excluding files

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_folder

or

[tool.pytask.ini_options]
exclude = ["obsolete_folder"]

Further reading