mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-01 04:56:45 +00:00
general linting fixes
This commit is contained in:
parent
b9ba6b9225
commit
ecc86e0989
@ -28,6 +28,7 @@ print("=================================")
|
|||||||
print("Checking static javascript files:")
|
print("Checking static javascript files:")
|
||||||
print("=================================")
|
print("=================================")
|
||||||
|
|
||||||
|
|
||||||
def check_invalid_tag(data):
|
def check_invalid_tag(data):
|
||||||
|
|
||||||
pattern = r"{%(\w+)"
|
pattern = r"{%(\w+)"
|
||||||
@ -45,6 +46,7 @@ def check_invalid_tag(data):
|
|||||||
|
|
||||||
return err_count
|
return err_count
|
||||||
|
|
||||||
|
|
||||||
def check_prohibited_tags(data):
|
def check_prohibited_tags(data):
|
||||||
|
|
||||||
allowed_tags = [
|
allowed_tags = [
|
||||||
@ -78,7 +80,7 @@ def check_prohibited_tags(data):
|
|||||||
has_trans = True
|
has_trans = True
|
||||||
|
|
||||||
if not has_trans:
|
if not has_trans:
|
||||||
print(f" > file is missing 'trans' tags")
|
print(" > file is missing 'trans' tags")
|
||||||
err_count += 1
|
err_count += 1
|
||||||
|
|
||||||
return err_count
|
return err_count
|
||||||
|
@ -24,7 +24,7 @@ for line in str(out.decode()).split('\n'):
|
|||||||
if len(locales) > 0:
|
if len(locales) > 0:
|
||||||
print("There are {n} unstaged locale files:".format(n=len(locales)))
|
print("There are {n} unstaged locale files:".format(n=len(locales)))
|
||||||
|
|
||||||
for l in locales:
|
for lang in locales:
|
||||||
print(" - {l}".format(l=l))
|
print(" - {l}".format(l=lang))
|
||||||
|
|
||||||
sys.exit(len(locales))
|
sys.exit(len(locales))
|
||||||
|
@ -28,4 +28,4 @@ print("There are {n} unstaged migration files:".format(n=len(migrations)))
|
|||||||
for m in migrations:
|
for m in migrations:
|
||||||
print(" - {m}".format(m=m))
|
print(" - {m}".format(m=m))
|
||||||
|
|
||||||
sys.exit(len(migrations))
|
sys.exit(len(migrations))
|
||||||
|
@ -84,4 +84,4 @@ if __name__ == '__main__':
|
|||||||
print(f"Release tag '{args.tag}' does not match INVENTREE_SW_VERSION '{version}'")
|
print(f"Release tag '{args.tag}' does not match INVENTREE_SW_VERSION '{version}'")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
4
tasks.py
4
tasks.py
@ -1,6 +1,5 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from shutil import copyfile
|
|
||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
@ -143,6 +142,7 @@ def clean_settings(c):
|
|||||||
|
|
||||||
manage(c, "clean_settings")
|
manage(c, "clean_settings")
|
||||||
|
|
||||||
|
|
||||||
@task(post=[rebuild])
|
@task(post=[rebuild])
|
||||||
def migrate(c):
|
def migrate(c):
|
||||||
"""
|
"""
|
||||||
@ -298,7 +298,7 @@ def export_records(c, filename='data.json'):
|
|||||||
# Get an absolute path to the file
|
# Get an absolute path to the file
|
||||||
if not os.path.isabs(filename):
|
if not os.path.isabs(filename):
|
||||||
filename = os.path.join(localDir(), filename)
|
filename = os.path.join(localDir(), filename)
|
||||||
filename = os.path.abspath(filename)
|
filename = os.path.abspath(filename)
|
||||||
|
|
||||||
print(f"Exporting database records to file '{filename}'")
|
print(f"Exporting database records to file '{filename}'")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user