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

Formatting python code #12

Open
LarsSchaaf opened this issue Jul 12, 2021 · 0 comments · May be fixed by #13
Open

Formatting python code #12

LarsSchaaf opened this issue Jul 12, 2021 · 0 comments · May be fixed by #13
Assignees
Labels
enhancement New feature or request

Comments

@LarsSchaaf
Copy link

I was wondering if we could decide on a formatter to format the code according to one convention. I had talked to @stenczelt about this before and he also uses black, which might be a good suggestion as its a widely used formatter.

Why add a formatter

  1. Easier to merge pull requests: as all conventions are the same, it is easier to merge pull requests as the only differences are in code content rather than which quotation marks were used ect.
  2. Ease of reading code
  3. Simple to use
  4. Now might be a good time to improve formatting, as there are significant changes with the file structure already.

How to use?

pip install black
# or 
conda install -c conda-forge black

To use black simpy do: black file_to_format.py or use black * to format whole direcotries, or whole repository. The easiest way to use black is by integrating it into your favourite editor and formatting upon save: for VS Code, for Jupyter Noteooks.

@LarsSchaaf LarsSchaaf added the enhancement New feature or request label Jul 12, 2021
@LarsSchaaf LarsSchaaf self-assigned this Jul 12, 2021
@LarsSchaaf LarsSchaaf linked a pull request Jul 12, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant