Skip to content

Commit

Permalink
[reformat] Migrate some long signatures to "tall" format
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy C committed Sep 29, 2024
1 parent 5bfca40 commit a362b87
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 14 deletions.
10 changes: 8 additions & 2 deletions builtin/printf_osh.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,14 @@ def __init__(
# this object initialized in main()
self.shell_start_time = time_.time()

def _Percent(self, pr, part, varargs, locs):
# type: (_PrintfState, printf_part.Percent, List[str], List[CompoundWord]) -> Optional[str]
def _Percent(
self,
pr, # type: _PrintfState
part, # type: printf_part.Percent
varargs, # type: List[str]
locs, # type: List[CompoundWord]
):
# type: (...) -> Optional[str]

num_args = len(varargs)

Expand Down
13 changes: 10 additions & 3 deletions core/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,9 +808,16 @@ def Run(self):
class SubProgramThunk(Thunk):
"""A subprogram that can be executed in another process."""

def __init__(self, cmd_ev, node, trap_state, multi_trace, inherit_errexit,
inherit_errtrace):
# type: (CommandEvaluator, command_t, trap_osh.TrapState, dev.MultiTracer, bool, bool) -> None
def __init__(
self,
cmd_ev, # type: CommandEvaluator
node, # type: command_t
trap_state, # type: trap_osh.TrapState
multi_trace, # type: dev.MultiTracer
inherit_errexit, # type: bool
inherit_errtrace, # type: bool
):
# type: (...) -> None
self.cmd_ev = cmd_ev
self.node = node
self.trap_state = trap_state
Expand Down
10 changes: 8 additions & 2 deletions core/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -1186,8 +1186,14 @@ def __exit__(self, type, value, traceback):
class ctx_Eval(object):
"""Push temporary set of variables, $0, $1, $2, etc."""

def __init__(self, mem, dollar0, pos_args, vars):
# type: (Mem, Optional[str], Optional[List[str]], Optional[Dict[str, value_t]]) -> None
def __init__(
self,
mem, # type: Mem
dollar0, # type: Optional[str]
pos_args, # type: Optional[List[str]]
vars, # type: Optional[Dict[str, value_t]]
):
# type: (...) -> None
self.mem = mem
self.dollar0 = dollar0
self.pos_args = pos_args
Expand Down
17 changes: 10 additions & 7 deletions frontend/typed_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,16 @@ class Reader(object):
ReaderForProc()
"""

def __init__(self,
pos_args,
named_args,
block_arg,
arg_list,
is_bound=False):
# type: (List[value_t], Dict[str, value_t], Optional[value_t], ArgList, bool) -> None
def __init__(
self,
pos_args, # type: List[value_t]
named_args, # type: Dict[str, value_t]
block_arg, # type: Optional[value_t]
arg_list, # type: ArgList
is_bound=False, # type: bool
):
# type: (...) -> None

self.pos_args = pos_args
self.pos_consumed = 0
# TODO: Add LHS of attribute expression to value.BoundFunc and pass
Expand Down

0 comments on commit a362b87

Please sign in to comment.