edbeeching / godot_rl_agents

An Open Source package that allows video game creators, AI researchers and hobbyists the opportunity to learn complex behaviors for their Non Player Characters or agents
MIT License
902 stars 63 forks source link

Adds code quality #168

Closed edbeeching closed 7 months ago

edbeeching commented 7 months ago

It is about time we have some code quality standards on the project. At least for the python part. This PR adds a github action to test for quality and also formats all files to meet this standard.

The only downside is that it makes blaming harder as it touches almost all files.

Ivan-267 commented 7 months ago

This is a good idea. Just as a note, make doesn't work directly on Windows, but running the commands manually did work.

Either a script can be written for those commands on Windows, and/or some compatibility tool can be installed to allow using Make (e.g. I just locally added the style/quality lines to a .bat file I called StyleQuality.bat):

black --line-length 120 --target-version py310 tests godot_rl examples
isort -w 120 tests godot_rl examples
black --check --line-length 120 --target-version py310 tests godot_rl examples
isort -w 120 --check-only tests godot_rl examples
flake8 --max-line-length 120 tests godot_rl examples

Running that file from powershell within a conda env works.