IN-CORE / pyincore

pyIncore is a component of IN-CORE. It is a python package consisting of two primary components: 1) a set of service classes to interact with the IN-CORE web services, and 2) IN-CORE analyses . The pyIncore allows users to apply various hazards to infrastructure in selected areas, propagating the effect of physical infrastructure damage and loss of functionality to social and economic impacts.
Mozilla Public License 2.0
24 stars 7 forks source link

I cannot removee e203, black keeps adding it back #599

Closed longshuicy closed 1 week ago

longshuicy commented 1 week ago

It turns out I cannot ignore E203 (space around colon) because black keeps adding it back. After some research, it seems that black is very opinionated and doesn't allow configuration for this specific case.

Another alternative is to write a custom shell script to strip those spaces and add it to the pre-commit hook. While this might feel a bit overkill at the moment, it is a viable solution based on the current limitations. Let me know if we would want to go that route. @navarroc

navarroc commented 1 week ago

What is the issue about the space around the colon? Is it breaking something?

longshuicy commented 1 week ago

What is the issue about the space around the colon? Is it breaking something?

The pep8 rule E203 https://docs.astral.sh/ruff/rules/whitespace-before-punctuation/ specify that no space is allowed around : However, black insist to add the space around : which conflicts the E203.

Without add it to ignore, black will automatically reformat to add the space back so it is never able to pass the pre-commit.

navarroc commented 1 week ago

What is the issue about the space around the colon? Is it breaking something?

The pep8 rule E203 https://docs.astral.sh/ruff/rules/whitespace-before-punctuation/ specify that no space is allowed around : However, black insist to add the space around : which conflicts the E203.

Without add it to ignore, black will automatically reformat to add the space back so it is never able to pass the pre-commit.

How does Clowder get around this issue? I see it is setup to ignore e203 too.