GispoCoding / flake8-qgis

Flake8 plugin for QGIS python plugins
MIT License
6 stars 4 forks source link

Checking for handling of "success" return values #6

Open kannes opened 11 months ago

kannes commented 11 months ago

Is there a chance to mark methods that return success status booleans or objects if the user does not check them? E. g.:

QgsProject.addMapLayer returns either the added layer or None. The user should check that.

QgsProject.commitChanges returns Tuple[bool, List[str]]. The user should check that boolean.

Joonalai commented 11 months ago

Thank you for the issue and for the great idea. I think that the methods should be listed and divided into two categories: possible errors and probable errors. There should be at least two new codes based on those.