Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] committed Aug 13, 2024
1 parent bed56bd commit 1bc58b3
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 31 deletions.
4 changes: 3 additions & 1 deletion pdoc/doc_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,9 @@ def _parse_function(source: str) -> ast.FunctionDef | ast.AsyncFunctionDef:
# we have a lambda function,
# to simplify the API return the ast.FunctionDef stub.
pass
return ast.FunctionDef(name="pdoc_empty", args=ast.arguments(), body=[], decorator_list=[]) # type: ignore
return ast.FunctionDef(
name="pdoc_empty", args=ast.arguments(), body=[], decorator_list=[]
) # type: ignore


def _parse(
Expand Down
22 changes: 11 additions & 11 deletions test/testdata/enums.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<var BAR = <IntEnum.BAR: 2>>
<var name # inherited from enum.Enum.name, The name of the Enum…>
<var value # inherited from enum.Enum.value, The value of the Enu…>
<method def conjugate(unknown): ... # inherited from builtins.int.conjugate, Returns self, the co…>
<method def conjugate(self, /): ... # inherited from builtins.int.conjugate, Returns self, the co…>
<method def bit_length(self, /): ... # inherited from builtins.int.bit_length, Number of bits neces…>
<method def bit_count(self, /): ... # inherited from builtins.int.bit_count, Number of ones in th…>
<method def to_bytes(self, /, length=1, byteorder='big', *, signed=False): ... # inherited from builtins.int.to_bytes, Return an array of b…>
Expand All @@ -35,24 +35,24 @@
<var name # inherited from enum.Enum.name, The name of the Enum…>
<var value # inherited from enum.Enum.value, The value of the Enu…>
<method def encode(self, /, encoding='utf-8', errors='strict'): ... # inherited from builtins.str.encode, Encode the string us…>
<method def replace(self, old, new, count=-1, /): ... # inherited from builtins.str.replace, Return a copy with a…>
<method def replace(self, old, new, /, count=-1): ... # inherited from builtins.str.replace, Return a copy with a…>
<method def split(self, /, sep=None, maxsplit=-1): ... # inherited from builtins.str.split, Return a list of the…>
<method def rsplit(self, /, sep=None, maxsplit=-1): ... # inherited from builtins.str.rsplit, Return a list of the…>
<method def join(self, iterable, /): ... # inherited from builtins.str.join, Concatenate any numb…>
<method def capitalize(self, /): ... # inherited from builtins.str.capitalize, Return a capitalized…>
<method def casefold(self, /): ... # inherited from builtins.str.casefold, Return a version of …>
<method def title(self, /): ... # inherited from builtins.str.title, Return a version of …>
<method def center(self, width, fillchar=' ', /): ... # inherited from builtins.str.center, Return a centered st…>
<method def count(unknown): ... # inherited from builtins.str.count, S.count(sub[, start[…>
<method def count(unknown): ... # inherited from builtins.str.count, Return the number of…>
<method def expandtabs(self, /, tabsize=8): ... # inherited from builtins.str.expandtabs, Return a copy where …>
<method def find(unknown): ... # inherited from builtins.str.find, S.find(sub[, start[,…>
<method def find(unknown): ... # inherited from builtins.str.find, Return the lowest in…>
<method def partition(self, sep, /): ... # inherited from builtins.str.partition, Partition the string…>
<method def index(unknown): ... # inherited from builtins.str.index, S.index(sub[, start[…>
<method def index(unknown): ... # inherited from builtins.str.index, Return the lowest in…>
<method def ljust(self, width, fillchar=' ', /): ... # inherited from builtins.str.ljust, Return a left-justif…>
<method def lower(self, /): ... # inherited from builtins.str.lower, Return a copy of the…>
<method def lstrip(self, chars=None, /): ... # inherited from builtins.str.lstrip, Return a copy of the…>
<method def rfind(unknown): ... # inherited from builtins.str.rfind, S.rfind(sub[, start[…>
<method def rindex(unknown): ... # inherited from builtins.str.rindex, S.rindex(sub[, start…>
<method def rfind(unknown): ... # inherited from builtins.str.rfind, Return the highest i…>
<method def rindex(unknown): ... # inherited from builtins.str.rindex, Return the highest i…>
<method def rjust(self, width, fillchar=' ', /): ... # inherited from builtins.str.rjust, Return a right-justi…>
<method def rstrip(self, chars=None, /): ... # inherited from builtins.str.rstrip, Return a copy of the…>
<method def rpartition(self, sep, /): ... # inherited from builtins.str.rpartition, Partition the string…>
Expand All @@ -61,8 +61,8 @@
<method def swapcase(self, /): ... # inherited from builtins.str.swapcase, Convert uppercase ch…>
<method def translate(self, table, /): ... # inherited from builtins.str.translate, Replace each charact…>
<method def upper(self, /): ... # inherited from builtins.str.upper, Return a copy of the…>
<method def startswith(unknown): ... # inherited from builtins.str.startswith, S.startswith(prefix[…>
<method def endswith(unknown): ... # inherited from builtins.str.endswith, S.endswith(suffix[, …>
<method def startswith(unknown): ... # inherited from builtins.str.startswith, Return True if the s…>
<method def endswith(unknown): ... # inherited from builtins.str.endswith, Return True if the s…>
<method def removeprefix(self, prefix, /): ... # inherited from builtins.str.removeprefix, Return a str with th…>
<method def removesuffix(self, suffix, /): ... # inherited from builtins.str.removesuffix, Return a str with th…>
<method def isascii(self, /): ... # inherited from builtins.str.isascii, Return True if all c…>
Expand All @@ -78,8 +78,8 @@
<method def isidentifier(self, /): ... # inherited from builtins.str.isidentifier, Return True if the s…>
<method def isprintable(self, /): ... # inherited from builtins.str.isprintable, Return True if the s…>
<method def zfill(self, width, /): ... # inherited from builtins.str.zfill, Pad a numeric string…>
<method def format(unknown): ... # inherited from builtins.str.format, S.format(*args, **kw…>
<method def format_map(unknown): ... # inherited from builtins.str.format_map, S.format_map(mapping…>
<method def format(self, /, *args, **kwargs): ... # inherited from builtins.str.format, Return a formatted v…>
<method def format_map(self, mapping, /): ... # inherited from builtins.str.format_map, Return a formatted v…>
<static def maketrans(unknown): ... # inherited from builtins.str.maketrans, Return a translation…>
>
>
2 changes: 1 addition & 1 deletion test/testdata/flavors_google.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<var msg>
<var code>
<method def add_note(self, note: str): ... # This method is prese…>
<method def with_traceback(unknown): ... # inherited from builtins.BaseException.with_traceback, Exception.with_trace…>
<method def with_traceback(self, object, /): ... # inherited from builtins.BaseException.with_traceback, Exception.with_trace…>
<var args # inherited from builtins.BaseException.args>
>
<class flavors_google.ExampleClass # The summary line for…
Expand Down
2 changes: 1 addition & 1 deletion test/testdata/flavors_numpy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<var msg>
<var code>
<method def add_note(self, note: str): ... # This method is prese…>
<method def with_traceback(unknown): ... # inherited from builtins.BaseException.with_traceback, Exception.with_trace…>
<method def with_traceback(self, object, /): ... # inherited from builtins.BaseException.with_traceback, Exception.with_trace…>
<var args # inherited from builtins.BaseException.args>
>
<class flavors_numpy.ExampleClass # The summary line for…
Expand Down
10 changes: 5 additions & 5 deletions test/testdata/misc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@
<method def setdefault(self, key, default=None, /): ... # inherited from builtins.dict.setdefault, Insert key with a va…>
<method def pop(unknown): ... # inherited from builtins.dict.pop, D.pop(k[,d]) -> v, r…>
<method def popitem(self, /): ... # inherited from builtins.dict.popitem, Remove and return a …>
<method def keys(unknown): ... # inherited from builtins.dict.keys, D.keys() -> a set-li…>
<method def items(unknown): ... # inherited from builtins.dict.items, D.items() -> a set-l…>
<method def values(unknown): ... # inherited from builtins.dict.values, D.values() -> an obj…>
<method def keys(self, /): ... # inherited from builtins.dict.keys, Return a set-like ob…>
<method def items(self, /): ... # inherited from builtins.dict.items, Return a set-like ob…>
<method def values(self, /): ... # inherited from builtins.dict.values, Return an object pro…>
<method def update(unknown): ... # inherited from builtins.dict.update, D.update([E, ]**F) -…>
<method def fromkeys(type, iterable, value=None, /): ... # inherited from builtins.dict.fromkeys, Create a new diction…>
<method def clear(unknown): ... # inherited from builtins.dict.clear, D.clear() -> None. …>
<method def copy(unknown): ... # inherited from builtins.dict.copy, D.copy() -> a shallo…>
<method def clear(self, /): ... # inherited from builtins.dict.clear, Remove all items fro…>
<method def copy(self, /): ... # inherited from builtins.dict.copy, Return a shallow cop…>
>
<class misc.DocstringFromNew
<method def __init__(cls, *args, **kwargs): ... # This is a class with…>
Expand Down
4 changes: 2 additions & 2 deletions test/testdata/misc_py311.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<module misc_py311
<class misc_py311.CustomException # custom exception typ…
<method def __init__(self, /, *args, **kwargs): ... # inherited from builtins.RuntimeError.__init__>
<method def with_traceback(unknown): ... # inherited from builtins.BaseException.with_traceback, Exception.with_trace…>
<method def add_note(unknown): ... # inherited from builtins.BaseException.add_note, Exception.add_note(n…>
<method def with_traceback(self, object, /): ... # inherited from builtins.BaseException.with_traceback, Exception.with_trace…>
<method def add_note(self, object, /): ... # inherited from builtins.BaseException.add_note, Exception.add_note(n…>
<var args # inherited from builtins.BaseException.args>
>
>
20 changes: 10 additions & 10 deletions test/testdata/misc_py312.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
<method def setdefault(self, key, default=None, /): ... # inherited from builtins.dict.setdefault, Insert key with a va…>
<method def pop(unknown): ... # inherited from builtins.dict.pop, D.pop(k[,d]) -> v, r…>
<method def popitem(self, /): ... # inherited from builtins.dict.popitem, Remove and return a …>
<method def keys(unknown): ... # inherited from builtins.dict.keys, D.keys() -> a set-li…>
<method def items(unknown): ... # inherited from builtins.dict.items, D.items() -> a set-l…>
<method def values(unknown): ... # inherited from builtins.dict.values, D.values() -> an obj…>
<method def keys(self, /): ... # inherited from builtins.dict.keys, Return a set-like ob…>
<method def items(self, /): ... # inherited from builtins.dict.items, Return a set-like ob…>
<method def values(self, /): ... # inherited from builtins.dict.values, Return an object pro…>
<method def update(unknown): ... # inherited from builtins.dict.update, D.update([E, ]**F) -…>
<method def fromkeys(type, iterable, value=None, /): ... # inherited from builtins.dict.fromkeys, Create a new diction…>
<method def clear(unknown): ... # inherited from builtins.dict.clear, D.clear() -> None. …>
<method def copy(unknown): ... # inherited from builtins.dict.copy, D.copy() -> a shallo…>
<method def clear(self, /): ... # inherited from builtins.dict.clear, Remove all items fro…>
<method def copy(self, /): ... # inherited from builtins.dict.copy, Return a shallow cop…>
>
<class misc_py312.Bar # A TypedDict subclass…
<var a: Optional[int] # inherited from misc_py312.Foo.a, First attribute.>
Expand All @@ -32,12 +32,12 @@
<method def setdefault(self, key, default=None, /): ... # inherited from builtins.dict.setdefault, Insert key with a va…>
<method def pop(unknown): ... # inherited from builtins.dict.pop, D.pop(k[,d]) -> v, r…>
<method def popitem(self, /): ... # inherited from builtins.dict.popitem, Remove and return a …>
<method def keys(unknown): ... # inherited from builtins.dict.keys, D.keys() -> a set-li…>
<method def items(unknown): ... # inherited from builtins.dict.items, D.items() -> a set-l…>
<method def values(unknown): ... # inherited from builtins.dict.values, D.values() -> an obj…>
<method def keys(self, /): ... # inherited from builtins.dict.keys, Return a set-like ob…>
<method def items(self, /): ... # inherited from builtins.dict.items, Return a set-like ob…>
<method def values(self, /): ... # inherited from builtins.dict.values, Return an object pro…>
<method def update(unknown): ... # inherited from builtins.dict.update, D.update([E, ]**F) -…>
<method def fromkeys(type, iterable, value=None, /): ... # inherited from builtins.dict.fromkeys, Create a new diction…>
<method def clear(unknown): ... # inherited from builtins.dict.clear, D.clear() -> None. …>
<method def copy(unknown): ... # inherited from builtins.dict.copy, D.copy() -> a shallo…>
<method def clear(self, /): ... # inherited from builtins.dict.clear, Remove all items fro…>
<method def copy(self, /): ... # inherited from builtins.dict.copy, Return a shallow cop…>
>
>

0 comments on commit 1bc58b3

Please sign in to comment.