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

Adopt a code formatter and linter #590

Closed
Tracked by #615
0ut0fcontrol opened this issue Jun 6, 2024 · 3 comments
Closed
Tracked by #615

Adopt a code formatter and linter #590

0ut0fcontrol opened this issue Jun 6, 2024 · 3 comments
Assignees
Labels
major release Potentially backwards incompatible changes that should go in to the next major release

Comments

@0ut0fcontrol
Copy link
Contributor

black? or yapf?

If not specified, I recommend black.

@padix-key
Copy link
Member

I lean towards ruff due to its speed and high number of supported rules than can be configured (even the black format). Furthermore, it can be used both as formatter and linter.

For legacy reasons the project currently does not enforce a formatter at all. However, in my opinion it would make sense to introduce a formatter rather sooner than later. We would need to agree on the following points:

  1. Which formatter/linter do we want to use?
  2. Which line limit do we want? Currently we use 79 as recommended in PEP 8 however, black/ruff use 88 by default.
  3. How do we want implement it? Either we merge a gigantic PR reformatting the entire codebase or we expect the contributors to only reformat files changed in their commits. The CI needs to be configured accordingly: Either the linter is applied to the entire code or only on changed files.

@Croydon-Brixton
Copy link
Contributor

I had good experiences with ruff. And I'd personally go with one full reformat of the code-base once, and requiring any new commits to be formatted correctly. A starting point could be to first only use ruff format (which will likely lead to the most changes) and add the ruff linting later

ruff format .  # only changes the formatting, no linting
ruff check --fix .  # this lints & fixes, we could start adding that in later, depending on how many lint issues we find (fix tries to autofix many)

@padix-key padix-key changed the title what is the python code formatter of biotite? Adopt a code formatter and linter Jun 21, 2024
@padix-key padix-key mentioned this issue Jun 28, 2024
8 tasks
@padix-key padix-key added the major release Potentially backwards incompatible changes that should go in to the next major release label Jun 28, 2024
@padix-key padix-key self-assigned this Jun 30, 2024
@padix-key
Copy link
Member

Resolved via #620.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major release Potentially backwards incompatible changes that should go in to the next major release
Projects
None yet
Development

No branches or pull requests

3 participants