projectsyn / commodore

Commodore provides opinionated tenant-aware management of Kapitan inventories and templates. Commodore uses Kapitan for the heavy lifting of rendering templates and resolving a hierachical configuration structure.
https://syn.tools/commodore/
BSD 3-Clause "New" or "Revised" License
46 stars 8 forks source link

Fix mypy error for spurious `return` in `Component.lib_files` #955

Closed simu closed 4 months ago

simu commented 4 months ago

Mypy has started raising an error for generator functions (i.e. functions which use the yield keyword) which also contain a return statement.

From what I found in the docs, using yield makes the function return a generator in all cases. If execution hits a flow which doesn't encounter a yield statement (e.g. because the top-level condition is false) that generator will immediately raise a StopIteration exception.

Checklist