fix pylints errors (#76240)
gitea/gadjo/pipeline/head This commit looks good Details

This commit is contained in:
Thomas NOËL 2023-04-06 11:34:55 +02:00 committed by Thomas NOËL
parent b38c656681
commit 2db1f3bba7
3 changed files with 6 additions and 5 deletions

View File

@ -67,7 +67,7 @@ class XStaticFinder(BaseFinder):
if path.startswith(self.storage_class.prefix + '/'):
path = path[len(self.storage_class.prefix) + 1 :]
matches = []
for app, storage in self.storages.items():
for storage in self.storages.values():
if storage.exists(path):
matched_path = storage.path(path)
if matched_path:
@ -76,8 +76,8 @@ class XStaticFinder(BaseFinder):
matches.append(matched_path)
return matches
def list(self, ignore_patterns=[]):
def list(self, ignore_patterns=None):
"""List all files in registered xstatic.* packages"""
for app, storage in self.storages.items():
for path in utils.get_files(storage, ignore_patterns):
for storage in self.storages.values():
for path in utils.get_files(storage, ignore_patterns or []):
yield path, storage

View File

@ -6,9 +6,9 @@ from django import template
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.forms import BoundField
from django.template import TemplateSyntaxError
from django.utils.html import escape
from django.utils.http import urlencode
from xstatic.main import XStatic
register = template.Library()

View File

@ -7,6 +7,7 @@ deps =
codestyle: pre-commit
pylint: pylint
pylint: pylint-django
pylint: django>=3.2,<3.3
commands =
codestyle: pre-commit run --all-files --show-diff-on-failure
pylint: ./pylint.sh gadjo/