Skip to content

Commit

Permalink
Fixing weird lint handling
Browse files Browse the repository at this point in the history
  • Loading branch information
djpugh committed May 22, 2021
1 parent c9b9071 commit 665e695
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/fastapi_aad_auth/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class BaseSettings(DeprecatableFieldsMixin, _BaseSettings):
"""Allow deprecations in the BaseSettings object."""

def __init__(self, *args, **kwargs):
def __init__(self, *args, **kwargs): # type: ignore[no-redef]
"""Initialise the config object."""
# For handling docstrings
super().__init__(*args, **kwargs)
Expand Down
7 changes: 4 additions & 3 deletions src/fastapi_aad_auth/utilities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ def expand_doc(klass: ModelMetaclass) -> ModelMetaclass:
default_str = ''
if field.default:
if SecretStr not in field.type_.__mro__:
default = field.default
if Path in field.type_.__mro__:
field.default = str(Path(field.default).relative_to(Path(field.default).parents[2]))
default = str(Path(default).relative_to(Path(default).parents[2]))
if field.name == 'user_klass':
default_str = f' [default: :class:`{field.default.replace("`", "").replace(":", ".")}`]'
default_str = f' [default: :class:`{default.replace("`", "").replace(":", ".")}`]'
else:
default_str = f' [default: ``{field.default}``]'
default_str = f' [default: ``{default}``]'
else:
default_str = ' [default: ``uuid.uuid4()``]'
module = field.outer_type_.__module__
Expand Down

0 comments on commit 665e695

Please sign in to comment.