handle linting a project in pwd

When calling "django-migration-linter ."
be able to handle it (especially with cache)
This commit is contained in:
David Wobrock committed 2019-01-20 12:17:11 +01:00
1 parent 75c969c6a9
commit 009153fbf4
5 files changed
+30 -3

No files matched your search

+1 -1
View File
@@ -22,7 +22,7 @@ from .utils import split_path
class Cache(dict):
def __init__(self, django_folder, cache_path):
self.django_folder = django_folder
project_name = split_path(django_folder)[-2]
project_name = split_path(django_folder)[-1]
self.filename = os.path.join(cache_path, "{0}.pickle".format(project_name))
if not os.path.exists(os.path.dirname(self.filename)):
+1 -1
View File
@@ -45,7 +45,7 @@ class MigrationLinter(object):
)
# Store parameters and options
self.django_path = project_path
self.django_path = os.path.abspath(project_path)
self.ignore_name_contains = kwargs.get("ignore_name_contains", None)
self.ignore_name = kwargs.get("ignore_name", None) or tuple()
self.include_apps = kwargs.get("include_apps", None)
+1 -1
View File
@@ -49,7 +49,7 @@ def find_project_settings_module(path):
def split_path(path):
a, b = os.path.split(path)
return (split_path(a) if (len(a) > 0 and a != "/") else []) + [b]
return (split_path(a) if (len(a) > 0 and a != "/") else []) + ([b] if b else [])
def split_migration_path(migration_path):