Closed LuisBlanche closed 1 year ago
Can you add the example config given in the issue to inform users that they can reduce verbosity ?
I think there is a problem with the Flake8 pre-commit hook. It raises a lot of :
codecarbon/core/emissions.py:202:76: E231 missing whitespace after ':'
. errors on files that were not changed.
And you can see from the following example that we cannot add a space after the ':' in that case.
logger.debug(
f"We apply an energy mix of {emissions_per_kWh.kgs_per_kWh*1000:.0f}"
+ f" g.CO2eq/kWh for {geo.country_name}"
)
Maybe something has changed with the Flake8 hook configuration ?
I had to ignore the following Flake8 error codes in .flake8
:
E201 : Whitespace after "("
E231 : Missing whitespace after ',', ';', or ':'
E226 : Missing whitespace around arithmetic operator
NB: these were only raising in the CI , not in local when running pre-commit run
. E231 is raised at times it shouldn't be. The other ones are mostly raised because of line breaks introduced by black (which is acceptable imho)
@benoit-cty what do you think about the error codes i had to ignore ? seems ok to merge ?
The problem was actions/setup-python@v3
that switch to Python 3.12, so I force it to 3.11.
I open a new issue for that : https://github.com/mlco2/codecarbon/issues/465
You could merge this PR :+1: