Skip to content

Commit 572d68d

Browse files
Fix FBT002: make boolean default positional arguments keyword-only
Agent-Logs-Url: https://github.com/GitHubSecurityLab/seclab-taskflow-agent/sessions/8d2d539e-f654-4b1d-b85b-4d3b0fea884c Co-authored-by: kevinbackhouse <4358136+kevinbackhouse@users.noreply.github.com>
1 parent 18aa919 commit 572d68d

9 files changed

Lines changed: 14 additions & 9 deletions

File tree

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ ignore = [
181181
"A002", # Argument shadows built-in
182182
"A004", # Import shadows built-in
183183
"FBT001", # Boolean positional arg
184-
"FBT002", # Boolean default value
185184
"N801", # Class name casing
186185
"N802", # Function name casing
187186
"N806", # Variable casing

src/seclab_taskflow_agent/agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ def __init__(
160160
name: str = "TaskAgent",
161161
instructions: str = "",
162162
handoffs: list[Any] | None = None,
163+
*,
163164
exclude_from_context: bool = False,
164165
mcp_servers: list[Any] | None = None,
165166
model: str = DEFAULT_MODEL,

src/seclab_taskflow_agent/cli.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def main(
8787
str | None,
8888
typer.Option("-t", "--taskflow", help="Taskflow module path (mutually exclusive with -p)."),
8989
] = None,
90+
*,
9091
list_models: Annotated[
9192
bool,
9293
typer.Option("-l", "--list-models", help="List available tool-call models and exit."),

src/seclab_taskflow_agent/mcp_lifecycle.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def build_mcp_servers(
4545
available_tools: AvailableTools,
4646
toolboxes: list[str],
4747
blocked_tools: list[str] | None = None,
48+
*,
4849
headless: bool = False,
4950
) -> list[MCPServerEntry]:
5051
"""Build MCP server instances for the given toolboxes.

src/seclab_taskflow_agent/mcp_servers/codeql/client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def __init__(
4444
self,
4545
codeql_cli=os.getenv("CODEQL_CLI", default="codeql"),
4646
server_options=["--threads=0", "--quiet"],
47+
*,
4748
log_stderr=False,
4849
):
4950
self.server_options = server_options.copy()
@@ -406,7 +407,7 @@ def _bqrs_to_sarif(self, bqrs_path, query_info, max_paths=10):
406407

407408

408409
class QueryServer(CodeQL):
409-
def __init__(self, database: Path, keep_alive=False, log_stderr=False):
410+
def __init__(self, database: Path, *, keep_alive=False, log_stderr=False):
410411
super().__init__(log_stderr=log_stderr)
411412
self.database = database
412413
self.keep_alive = keep_alive
@@ -476,7 +477,7 @@ def _file_uri_to_path(uri):
476477
return path, region
477478

478479

479-
def _get_source_prefix(database_path: Path, strip_leading_slash=True) -> str:
480+
def _get_source_prefix(database_path: Path, *, strip_leading_slash=True) -> str:
480481
# grab the source prefix from codeql-database.yml
481482
db_yml_path = Path(database_path) / Path("codeql-database.yml")
482483
with open(db_yml_path) as stream:
@@ -491,7 +492,7 @@ def _get_source_prefix(database_path: Path, strip_leading_slash=True) -> str:
491492
raise
492493

493494

494-
def list_src_files(database_path: str | Path, as_uri=False, strip_prefix=True):
495+
def list_src_files(database_path: str | Path, *, as_uri=False, strip_prefix=True):
495496
src_path = Path(database_path) / Path("src.zip")
496497
files = shell_command_to_string(["zipinfo", "-1", src_path]).split("\n")
497498
source_prefix = _get_source_prefix(Path(database_path))
@@ -503,7 +504,7 @@ def list_src_files(database_path: str | Path, as_uri=False, strip_prefix=True):
503504
return files
504505

505506

506-
def search_in_src_archive(database_path: str, search_term: str, as_uri=False, strip_prefix=True):
507+
def search_in_src_archive(database_path: str, search_term: str, *, as_uri=False, strip_prefix=True):
507508
database_path = Path(database_path)
508509
src_path = database_path / Path("src.zip")
509510
results = {}
@@ -595,6 +596,7 @@ def run_query(
595596
target="",
596597
progress_callback=None,
597598
template_values=None,
599+
*,
598600
# keep the query server alive if desired
599601
keep_alive=True,
600602
log_stderr=False,

src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,7 @@ def __init__(
664664
rpc: RPC,
665665
name: str = "watchdog",
666666
interval: float = 0.1,
667+
*,
667668
daemon: bool = False,
668669
start: bool = True,
669670
) -> None:

src/seclab_taskflow_agent/render_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async def flush_async_output(task_id: str) -> None:
3131
await render_model_output(data)
3232

3333

34-
async def render_model_output(data: str, log: bool = True, async_task: bool = False, task_id: str | None = None) -> None:
34+
async def render_model_output(data: str, *, log: bool = True, async_task: bool = False, task_id: str | None = None) -> None:
3535
"""Print model output to the console, optionally buffering for async tasks."""
3636
async with async_output_lock:
3737
if async_task and task_id:

src/seclab_taskflow_agent/runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ async def deploy_task_agents(
309309
model_settings = ModelSettings(**model_params)
310310

311311
# Build MCP servers and collect server prompts
312-
entries = build_mcp_servers(available_tools, toolboxes, blocked_tools, headless)
312+
entries = build_mcp_servers(available_tools, toolboxes, blocked_tools, headless=headless)
313313
mcp_params = mcp_client_params(available_tools, toolboxes)
314314
server_prompts = [sp for _, (_, _, sp, _) in mcp_params.items()]
315315

@@ -585,7 +585,7 @@ async def on_handoff_hook(context: RunContextWrapper[TContext], agent: Agent[TCo
585585
available_tools, global_variables, inputs,
586586
)
587587

588-
async def run_prompts(async_task: bool = False, max_concurrent_tasks: int = 5) -> bool:
588+
async def run_prompts(*, async_task: bool = False, max_concurrent_tasks: int = 5) -> bool:
589589
if run:
590590
await render_model_output("** 🤖🐚 Executing Shell Task\n")
591591
try:

src/seclab_taskflow_agent/template_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def get_source(
5656
raise jinja2.TemplateNotFound(template)
5757

5858

59-
def env_function(var_name: str, default: Optional[str] = None, required: bool = True) -> str:
59+
def env_function(var_name: str, default: Optional[str] = None, *, required: bool = True) -> str:
6060
"""Jinja2 function to access environment variables.
6161
6262
Args:

0 commit comments

Comments
 (0)