perrygeo / python-rasterstats

Summary statistics of geospatial raster datasets based on vector geometries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Developer feedback requested: Black formatting

perrygeo opened this issue · comments

It's 2023 and high time we format the python-rasterstats code base to work with modern python tooling. The most obvious one is consistent formatting.

I propose running black on all the source files.

This will unfortunately cause merge conflicts with the existing PRs so I'd like to open it up to feedback. Specifically, if you've got an open PR and would like to merge it prior to the formatting, I'd like to give you the opportunity to do so.

@groutr @maxfenv @yyu1 @diversoft @doclements @sgoodm -

Do you have any objections to me formatting now, knowing that you might have some additional work to do to rebase? Sorry to put this task on you but having consistent formatting has become a baseline requirement.

@perrygeo, fine by me!

Note that in addition to causing conflicts in open PRs, I think it also makes it harder to track a change backwards in time.

I was just passing by but here are my 2 cents:

for the first iteration, you can use a .git-blame-ignore-revs to ignore the linting revision when looking backward. This is what we do in pydata-sphinx-theme: https://github.com/pydata/pydata-sphinx-theme/blob/main/.git-blame-ignore-revs

Also I would highly suggest to use pre-commits hooks in both local and CI to make sure that every dev is consistent.

In addition to black, you could have a look to ruff, that's a very nice tool as well.

I was just passing by but here are my 2 cents:

for the first iteration, you can use a .git-blame-ignore-revs to ignore the linting revision when looking backward. This is what we do in pydata-sphinx-theme: https://github.com/pydata/pydata-sphinx-theme/blob/main/.git-blame-ignore-revs

Also I would highly suggest to use pre-commits hooks in both local and CI to make sure that every dev is consistent.

In addition to black, you could have a look to ruff, that's a very nice tool as well.

Good to know!