Skip to content

Use an automated code formatter #872

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

Closed
svartkanin opened this issue Jan 16, 2022 · 4 comments
Closed

Use an automated code formatter #872

svartkanin opened this issue Jan 16, 2022 · 4 comments

Comments

@svartkanin
Copy link
Collaborator

The code currently contains different formats which is understandable in an OSS project :)
I personally use YAPF (https://github.com/google/yapf) in my projects which allows one to customize the code formatting.
I think it would be very beneficial to use this to auto format the code when commiting, possibly with a commit hook

@Torxed
Copy link
Member

Torxed commented Jan 16, 2022

I'm not against it, but I'm against intrusive tools.
mypy is even bordering untolerable forced changes, despite how well you configure it.

But I'll have a look at YAPF. For clarity, black is a no-go for me. It's way to strict :)

@svartkanin
Copy link
Collaborator Author

I totally share the view on black with you, i tried it once and never again :)
Yapf allows you to configure pretty much any formatting rule which gives you the mighty power of creating your own python ;)

@svartkanin
Copy link
Collaborator Author

Also since you mentioned mypy being a PITA, having a automatic custom but valid python formatter would probably eliminate some of the mypy issues as well then

@Torxed
Copy link
Member

Torxed commented Jan 16, 2022

I totally share the view on black with you, i tried it once and never again :) Yapf allows you to configure pretty much any formatting rule which gives you the mighty power of creating your own python ;)

This sounds like something I could agree on :) I like mypy for the fact that it catches a few data types. And I kind of like that it forces me to do less magical functions that "does everything".. I should think more about separation of duties and stuff, which is why I kinda like mypy.

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

2 participants