remove unused imports automatically (#4449)

* remove unused imports automatically

* add linters to pr template

* remove useless try statement
This commit is contained in:
merwanehamadi
2023-05-28 05:50:50 -07:00
committed by GitHub
parent 78774526f4
commit ee9f10a8d8
33 changed files with 28 additions and 70 deletions

View File

@@ -36,7 +36,13 @@ By following these guidelines, your PRs are more likely to be merged quickly aft
- [ ] I have considered potential risks and mitigations for my changes.
- [ ] I have documented my changes clearly and comprehensively.
- [ ] I have not snuck in any "extra" small tweaks changes. <!-- Submit these as separate Pull Requests, they are the easiest to merge! -->
- [ ] I have run `black .` and `isort .` against my code to ensure it passes our linter.
- [ ] I have run the following commands against my code to ensure it passes our linters:
```shell
black .
isort .
mypy
autoflake --remove-all-unused-imports --recursive --ignore-init-module-imports autogpt tests --in-place
```
<!-- If you haven't added tests, please explain why. If you have, check the appropriate box. If you've ensured your PR is atomic and well-documented, check the corresponding boxes. -->

View File

@@ -51,6 +51,11 @@ jobs:
run: mypy
if: success() || failure()
- name: Check for unused imports and pass statements
run: |
cmd="autoflake --remove-all-unused-imports --recursive --ignore-init-module-imports autogpt tests"
$cmd --check || (echo "You have unused imports or pass statements, please run '${cmd} --in-place'" && exit 1)
test:
permissions:
# Gives the action the necessary permissions for publishing new