Fix FBT002: make boolean default positional args keyword-only#205
Closed
Fix FBT002: make boolean default positional args keyword-only#205
Conversation
Open
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>
Copilot
AI
changed the title
[WIP] Fix linter error FBT002 and remove from suppression list
Fix FBT002: make boolean default positional args keyword-only
Apr 2, 2026
kevinbackhouse
approved these changes
Apr 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the global suppression for Ruff rule FBT002 by updating function signatures across the codebase so boolean parameters with defaults are keyword-only, preventing accidental positional boolean arguments.
Changes:
- Made boolean-defaulted parameters keyword-only (added
*) across multiple functions/classes (agent, CLI, MCP lifecycle, rendering, templating, and CodeQL utilities). - Updated the one in-repo call site that passed a newly keyword-only boolean positionally (
build_mcp_servers(..., headless=headless)). - Removed
FBT002from Ruff’s globalignorelist inpyproject.toml.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/seclab_taskflow_agent/template_utils.py | Makes required keyword-only in env_function to satisfy FBT002. |
| src/seclab_taskflow_agent/runner.py | Fixes build_mcp_servers call site and makes run_prompts.async_task keyword-only. |
| src/seclab_taskflow_agent/render_utils.py | Makes log/async_task keyword-only for render_model_output. |
| src/seclab_taskflow_agent/mcp_servers/codeql/jsonrpyc/init.py | Makes daemon/start keyword-only in Watchdog.__init__. |
| src/seclab_taskflow_agent/mcp_servers/codeql/client.py | Makes several boolean-default params keyword-only across CodeQL helpers and constructors. |
| src/seclab_taskflow_agent/mcp_lifecycle.py | Makes headless keyword-only in build_mcp_servers. |
| src/seclab_taskflow_agent/cli.py | Makes CLI boolean flags keyword-only in main (Typer options). |
| src/seclab_taskflow_agent/agent.py | Makes exclude_from_context keyword-only in TaskAgent.__init__. |
| pyproject.toml | Removes FBT002 from Ruff ignore list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kevinbackhouse
approved these changes
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ruff rule FBT002 ("Boolean default positional argument in function definition") was suppressed globally. This removes the suppression by fixing all 20 violations across the codebase.
Changes
Keyword-only boolean params — added
*separator before boolean-defaulted params in:agent.py→exclude_from_contextcli.py→list_models,debug(and trailing params)mcp_lifecycle.py→headlessrender_utils.py→log,async_tasktemplate_utils.py→requiredrunner.py(localrun_prompts) →async_taskmcp_servers/codeql/client.py→log_stderr(CodeQL.__init__),keep_alive/log_stderr(QueryServer.__init__,run_query),strip_leading_slash(_get_source_prefix),as_uri/strip_prefix(list_src_files,search_in_src_archive)mcp_servers/codeql/jsonrpyc/__init__.py→daemon,start(Watchdog.__init__)Call-site fix —
runner.pywas passingheadlesspositionally tobuild_mcp_servers; updated toheadless=headless.pyproject.toml— removedFBT002from theignorelist.Example fix pattern
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
unsupported.example.com/usr/bin/python python -m pytest tests/ -x -q(dns block)If you need me to access, download, or install something from one of these locations, you can either: