pytest-dev / pytest-cov

Coverage plugin for pytest.
MIT License
1.72k stars 211 forks source link

Simplify code with ruff --fix #583

Closed cclauss closed 1 year ago

cclauss commented 1 year ago

ruff --select=B009,RET503,ANN204,SIM108,SIM201 --fix .

RonnyPfannschmidt commented 1 year ago

Adding none return annotations to untyped code seems like noise

cclauss commented 1 year ago

I find return None to be a helpful reminder of the possibilities and it does not really slow me down when reading code. Explicit is better than implicit.

I can revert if that is the consensus.

Or perhaps at line 34, we should:

if not cov_datafile:
    return None

and then dedent the next ~25 lines of code.

RonnyPfannschmidt commented 1 year ago

The return that was added is great

The type annotations for only the return type none are noise, I'd strongly prefer to have those be added as part of full annotation at a later point