una-auxme / paf

MIT License
6 stars 0 forks source link

[Feature]: Add automatic code formatting #289

Open JulianTrommer opened 1 month ago

JulianTrommer commented 1 month ago

Description

No response

Definition of Done

No response

ll7 commented 2 weeks ago

ChatGPT

There are several popular code formatters for Python, each with its own strengths. The "best" one depends on your specific needs and preferences. Here are some of the most widely used auto-formatters for Python 3:

1. Black

https://github.com/psf/black 38k Stars

2. autopep8

https://github.com/hhatto/autopep8 5k Stars

3. YAPF (Yet Another Python Formatter)

https://github.com/google/yapf 14k stars

4. isort

5. Docformatter

Which one to choose?

Many developers use Black in combination with isort for import sorting and sometimes docformatter for docstring consistency.

ll7 commented 2 weeks ago

https://black.readthedocs.io/en/stable/guides/introducing_black_to_your_project.html

ll7 commented 2 weeks ago

https://peps.python.org/pep-0008/#indentation

JulianTrommer commented 1 day ago

We decided to use black as a code formatter. We also intend to add a GitHub action to check if the submitted code is different from the output of black. This action should be required to pass for merging.

Since the actions and their settings will be changed in this issue we also intend to separate the build and drive action for a better structure.

JulianTrommer commented 1 day ago

This also includes removing the log from the wget command inside the build action for better readability.