mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-12 10:05:39 +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:
11
tasks.py
11
tasks.py
@ -1,3 +1,5 @@
|
||||
"""Tasks for automating certain actions and interacting with InvenTree from the CLI."""
|
||||
|
||||
import json
|
||||
import os
|
||||
import pathlib
|
||||
@ -8,7 +10,7 @@ from invoke import task
|
||||
|
||||
|
||||
def apps():
|
||||
"""Returns a list of installed apps"""
|
||||
"""Returns a list of installed apps."""
|
||||
return [
|
||||
'build',
|
||||
'common',
|
||||
@ -43,12 +45,13 @@ def managePyPath():
|
||||
return os.path.join(managePyDir(), 'manage.py')
|
||||
|
||||
|
||||
def manage(c, cmd, pty=False):
|
||||
def manage(c, cmd, pty: bool = False):
|
||||
"""Runs a given command against django's "manage.py" script.
|
||||
|
||||
Args:
|
||||
c - Command line context
|
||||
cmd - django command to run
|
||||
c: Command line context.
|
||||
cmd: Django command to run.
|
||||
pty (bool, optional): Run an interactive session. Defaults to False.
|
||||
"""
|
||||
c.run('cd "{path}" && python3 manage.py {cmd}'.format(
|
||||
path=managePyDir(),
|
||||
|
Reference in New Issue
Block a user