Skip to content

Commit

Permalink
pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimergp committed Nov 27, 2024
1 parent a728f34 commit 806e1c2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,15 @@
# Custom hooks
os.environ["SPHINX_RUNNING"] = "1"


def docstring(app, what, name, obj, options, lines):
"""Transform MD to RST for autodoc"""
md = '\n'.join(lines)
md = '\n'.join(lines)
ast = commonmark.Parser().parse(md)
rst = commonmark.ReStructuredTextRenderer().render(ast)
lines.clear()
lines += rst.splitlines()


def setup(app):
app.connect('autodoc-process-docstring', docstring)
13 changes: 9 additions & 4 deletions menuinst/_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@

try:
from pydantic.v1 import BaseModel as _BaseModel
from pydantic.v1 import Field as _Field, conlist, constr
from pydantic.v1 import Field as _Field
from pydantic.v1 import conlist, constr
except ImportError:
# pydantic v1
from pydantic import BaseModel as _BaseModel
from pydantic import Field as _Field, conlist, constr
from pydantic import Field as _Field
from pydantic import conlist, constr


log = getLogger(__name__)
Expand Down Expand Up @@ -505,7 +507,9 @@ class UTTypeDeclarationModel(BaseModel):
)
LSApplicationCategoryType: Optional[constr(regex=r"^public\.app-category\.\S+$")] = Field(
None,
description=("The App Store uses this string to determine the appropriate categorization."),
description=(
"The App Store uses this string to determine the appropriate categorization."
),
)
LSBackgroundOnly: Optional[bool] = Field(
None,
Expand Down Expand Up @@ -546,7 +550,8 @@ class UTTypeDeclarationModel(BaseModel):
description=("If true, allows an OpenGL app to utilize the integrated GPU."),
)
UTExportedTypeDeclarations: Optional[List[UTTypeDeclarationModel]] = Field(
None, description=("The uniform type identifiers owned and exported by the app."),
None,
description=("The uniform type identifiers owned and exported by the app."),
)
UTImportedTypeDeclarations: Optional[List[UTTypeDeclarationModel]] = Field(
None,
Expand Down

0 comments on commit 806e1c2

Please sign in to comment.