canonical / ops-scenario

State-transition testing SDK for Operator Framework Juju charms.
Apache License 2.0
11 stars 8 forks source link

Inconsistent `return Results` in `consistency_checker.py` #120

Closed IronCore864 closed 4 weeks ago

IronCore864 commented 6 months ago

There are inconsistent code in consistency_checker (the irony is in the file name 🤣):

Some places do:

errors = []
warnings = []

# do something

return Results(errors, warnings)

Other places do:

errors = []

# do something

return Results(errors, [])

I think the latter is less readable since one needs to click into the definition of Results to know what the second parameter is and why it's an empty list. To improve consistency of the code, we want to keep the same style.

tonyandrewmeyer commented 4 weeks ago

As mentioned in the PR, please open a fresh PR in the operator repo if you'd still like this change.