2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-30 18:50:53 +00:00

Add more checks to pre-commit (#3132)

* Add bandit to pre-commit checks

* fix catchall exceptions

* remove unused definitons

* remove unuseed ariables

* Add docstring

* fix B006, B008 errors

* fix B007 error

* ignore B009

* Add checks for formatting and naming
This commit is contained in:
Matthias Mair
2022-06-06 00:56:52 +02:00
committed by GitHub
parent bbbfd003e0
commit f38386b13c
56 changed files with 154 additions and 109 deletions

View File

@ -382,7 +382,7 @@ class PluginsRegistry:
if settings.PLUGIN_TESTING or InvenTreeSetting.get_setting('ENABLE_PLUGINS_SCHEDULE'):
for slug, plugin in plugins:
for _, plugin in plugins:
if plugin.mixin_enabled('schedule'):
config = plugin.plugin_config()
@ -437,7 +437,7 @@ class PluginsRegistry:
apps_changed = False
# add them to the INSTALLED_APPS
for slug, plugin in plugins:
for _, plugin in plugins:
if plugin.mixin_enabled('app'):
plugin_path = self._get_plugin_path(plugin)
if plugin_path not in settings.INSTALLED_APPS:
@ -522,7 +522,7 @@ class PluginsRegistry:
# remove model from admin site
try:
admin.site.unregister(model)
except: # pragma: no cover
except Exception: # pragma: no cover
pass
models += [model._meta.model_name]
except LookupError: # pragma: no cover