Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code Formatter #158

Open
mole99 opened this issue Feb 19, 2024 · 7 comments
Open

Code Formatter #158

mole99 opened this issue Feb 19, 2024 · 7 comments

Comments

@mole99
Copy link
Contributor

mole99 commented Feb 19, 2024

Use a code formatter to format the codebase.

Before any discussions come up about which coding style to use, I would suggest just to use Black:

Black is the uncompromising Python code formatter. By using it, you agree to cede control over minutiae of hand-formatting. In return, Black gives you speed, determinism, and freedom from pycodestyle nagging about formatting. You will save time and mental energy for more important matters.

@KelvinChung2000
Copy link
Contributor

Formatting and style guides are things that need work on. I am using a heavily modified autopep8.

Is there an easy way to set up the style? i.e. after cloning, can the code automatically apply to the style guide with an editor like vscode?

@mole99
Copy link
Contributor Author

mole99 commented Feb 20, 2024

Well, you can just install black via pip: pip install black and then format files like so: black my_file.py.

I don't use vscode, but there seems to exist an extension for it: Black Formatter. Support for other editors does exist too.

I can take a look at integrating black with the FABulous codebase. Basically the CI runs black and fails if the code has not been formatted. If desired, reviewdog can create comments on the PR with the necessary changes. Or the developer can just fix it themselves by running black.

@IAmMarcelJung
Copy link
Contributor

Hi, this could be closed since we use black in the GitHub actions, right? :)

@IAmMarcelJung
Copy link
Contributor

My bad, forgot that this is still only in the dev branch. Sorry for the disturbance.

@mole99
Copy link
Contributor Author

mole99 commented Jul 30, 2024

No worries! Any news on when dev will be merged?

@IAmMarcelJung
Copy link
Contributor

Unfortunately I don't know anything about when the merge is targeted :/

@KelvinChung2000
Copy link
Contributor

I am trying to push a stable release with what we have now. I really would like this done asap, ideally weeks after the summer school. Otherwise, another workshop might come up, and we once again need to delay this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants