KwanLab/Autometa

Add "remove unused imports" hook to pre-commit hooks

Closed this issue ยท 0 comments

Add hook to pre-commit hooks config to remove unused imports in python files.

See https://pre-commit.com/hooks.html (cmd+F pycln) for list of pre-commit hooks.

This looks promising: https://github.com/hadialqattan/pycln

The relevant code for .pre-commit-config.yaml ๐Ÿ https://hadialqattan.github.io/pycln/#/?id=integrations

Append to .pre-commit-config.yaml:

- repo: https://github.com/hadialqattan/pycln
  rev: v2.1.5 # Possible releases: https://github.com/hadialqattan/pycln/releases
  hooks:
    - id: pycln