sbi icon indicating copy to clipboard operation
sbi copied to clipboard

Make code formatting easier and less painful

Open gmoss13 opened this issue 2 years ago • 5 comments

There seem to be different local versions of ruff for different contributors, and successive PRs from different contributors change the same files back and forth depending on local versions. Need to look into ruff and see if it can be standardized.

gmoss13 avatar Mar 19 '24 20:03 gmoss13

Is this solved by https://github.com/sbi-dev/sbi/pull/1010? It may acutally make sense to pin ruff to the current version ruff==0.3.3 instead of doing ruff>=0.3.3 https://github.com/sbi-dev/sbi/blob/c347d5c3415effef2b8ff296f23c1bb4128cd5e9/pyproject.toml#L62C6-L62C17 to have the same version for everyone. But I guess it's behavior is anyways mainly governed by its rules.

Baschdl avatar Mar 20 '24 09:03 Baschdl

I thought about pinning it, but within v0.3.X they should be backward compatible, and I think that >= logic does not increase the minor version if the version is less than 1. at least that's the case for poetry (which I am more used to nowadays)

famura avatar Mar 22 '24 16:03 famura

One thing I noted w.r.t. issue us that some ppl have non-ruff auto-formating in their IDE

famura avatar Mar 22 '24 16:03 famura

The root cause is probably not inconsistencies in ruff (will change issue name accordingly), but instead a hackathon issue of 30 people trying to learn to use ruff at the same time. I think this issue is more of a long-term issue to think about, how to make our formatting more accessible so that contributing is easier.

gmoss13 avatar Mar 24 '24 13:03 gmoss13

Update: we pinned pre-commit=3.5.0 and require ruff>=0.3.3. For the moment this results in consistent code formatting it seems.

janfb avatar Apr 12 '24 09:04 janfb

closing this for now.

janfb avatar Jun 18 '24 07:06 janfb