patrick-kidger / equinox

Elegant easy-to-use neural networks + scientific computing in JAX. https://docs.kidger.site/equinox/
Apache License 2.0
2.13k stars 143 forks source link

Add editorconfig #821

Closed NeilGirdhar closed 2 months ago

NeilGirdhar commented 2 months ago

editorconfig automatically configures editors like vim, emacs, etc. so that they know how to save files, how long the lines should be (for examples, vim's automatic line width formatter), where to show the line length helper.

The problem is that I have my editor configured differently than yours. With this file, my editor automatically adjusts to your configuration.

patrick-kidger commented 2 months ago

Indeed, I'm familiar with .editorconfig.

My point is that if we care about such things then IMO it'd be better to have a single source of truth on such matters -- an autoformatter -- and allow anything at all whilst editing.

Anyway, not a strong opinion. *.py files are the only ones we attempt to format so trim this down to just that and I'd be happy to merge this.

NeilGirdhar commented 2 months ago

My point is that if we care about such things then IMO it'd be better to have a single source of truth on such matters -- an autoformatter -- and allow anything at all whilst editing.

Yes, I see your point. I guess I forgot that you've got the auto-formatter enabled.

Anyway, updated as requested.

patrick-kidger commented 2 months ago

Alright, merged! :) Thank you for the contribution!

NeilGirdhar commented 2 months ago

Thanks for being flexible about this :). Maybe we should propose to Ruff that editorconfig be the defaults to satisfy your "one source of truth" desire?

patrick-kidger commented 2 months ago

Seems not planned: https://github.com/astral-sh/ruff/issues/1530

NeilGirdhar commented 2 months ago

Ah, nice find!