AutoGPT
AutoGPT copied to clipboard
Basic Code Quality
Can we please improve code quality a little:
-
black
formatting -
flake8
&isort
pull request checks. - An
__init__.py
in the scripts folder. Absolute imports. - Rename
main.py
to__main__.py
or addif __name__ == "__main__":
after the function definitions. - Maybe a little folder organization in the scripts folder.
- Maybe run github copilot labs code commenting on the repo
I can help restructure the code.
@subramanya1997 Be my guest but I just put in 3 basic PR's so lets try not to code duplicate.
One note I don't think we can safely run black or autopep8 on this repo since there are so many contributions. Best we can do is fix manually with flake8.
https://github.com/Torantulino/Auto-GPT/pull/33
i had some work to add black, flake8, isort and pre-commit hooks as well 💀 maybe we should coordinate work on an issue-tracker? cc @Torantulino
@ryanpeach
Issue tracker is very essential.
@ryanpeach but if everyone is using the same formatting tool and it's required for every commit, where is the problem ? I agree the only issue is that the current PRs will have issues.
I would say it's better to do it now than never, as the code base grows it will be even harder to add pep8 or black
I already finished something, I'm waiting for feedback.
Please recommend an issue tracker for us to use. :)
#141 Makes this Issue sound very concerning.
Re: #141
I think if you want to do black or autopep8 you need to do it all at once in one PR as the codeowner and make an announcement. If anyone opens a pr for it and then you merge anything else it's just gonna be a mess. I agree it's probably best to do it, but you need to do it yourself and yes, earlier is better.
I'd choose black and not autopep8.
In your workflow, don't do a commit, just do black --check. Make the user format their own files.
Re issue tracker, probably Trello or just GitHub Issues.
Do we need a separate issue tracker or do we just need to deduplicate issues, tag issues by importance, and make issues before making PR's.
It will get more difficult each day. But it is unavoidable soon or later. Btw, why no one suggests YAPF instead of black? It is more opinionated afaik; so it is better to make sure every contributor use same formatting.
https://github.com/Torantulino/Auto-GPT/pull/153
Oh we should also add debug logging, and a pre-commit file to this issue.
@Torantulino can you give this issue a tag for long term tracking and discussion?
Maybe in the next wave of PRs we could pull this in last? It would make life a lot better
https://github.com/Torantulino/Auto-GPT/pull/444
@Torantulino we should organise it asap. It's gonna take too much to resolve all issues/PRs. Let us know how we can help.
https://github.com/Torantulino/Auto-GPT/pull/350#issuecomment-1500765044
Changing CONTRIBUTING.md to have contributors use pre-commit hooks (adding pre-commit-hooks.yaml, running update, install, etc.) would do a lot of future-proofing for this project.
For docs, interrogate.py is also available as a pre-commit hook.
Pre-commit is easy to use and thanks to this site it's also easy to learn how to use.
With the growing amount of attention on this project it needs the added protection! Since the number of warnings pre-commit hooks would require fixes for will only grow until the past ones are dealt with, I would propose that such a feature and the corresponding added docs and other fixes get prioritized. It will only get worse with time.
I think all of the items from the OP have been fixed, no?
@Pwuts yes I think so.
Closing as completed. If not, feel free to reopen and clarify.