You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@magpie.apache.org by "justinmclean (via GitHub)" <gi...@apache.org> on 2026/07/27 06:56:23 UTC
[I] Use a single import form for agent_guard in test_opencode.py [magpie]
justinmclean opened a new issue, #955:
URL: https://github.com/apache/magpie/issues/955
## Summary
`tools/agent-guard/tests/test_opencode.py` imports `agent_guard` both as
`import agent_guard` and `from agent_guard import ...`. Use one form.
## Background
CodeQL flags importing a module with both forms: it is a small readability and
consistency problem, and it can mask a partially-initialised module during a
circular import. `tests/test_kiro.py` in the same directory already uses only
the `from` form, so there is a house style to follow.
## Where to look
- `tools/agent-guard/tests/test_opencode.py` lines 33-34 - the two import
statements.
- `tools/agent-guard/tests/test_kiro.py` line 34 - the single-form style to
match.
- Check the rest of `tools/agent-guard/tests/` for the same pattern while you
are there.
## Acceptance criteria
- [ ] `test_opencode.py` uses one import form for `agent_guard`.
- [ ] Any other test file in the directory with the same pattern is fixed too.
- [ ] `uv run --directory tools/agent-guard --group dev pytest` passes.
## Estimated effort
~30 minutes for someone new to the codebase.
## Getting started
New to Magpie? Start with
[Your first contribution](https://github.com/apache/magpie/blob/main/CONTRIBUTING.md#your-first-contribution).
Note: this issue was drafted by an AI-assisted mentoring tool and may contain
mistakes. A Magpie maintainer, a real person, will be the next to engage on it.
If something here looks wrong or unclear, please say so on the issue and a
maintainer will follow up. See
[CONTRIBUTING.md](https://github.com/apache/magpie/blob/main/CONTRIBUTING.md)
for how Magpie handles contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Use a single import form for agent_guard in test_opencode.py [magpie]
Posted by "justinmclean (via GitHub)" <gi...@apache.org>.
justinmclean closed issue #955: Use a single import form for agent_guard in test_opencode.py
URL: https://github.com/apache/magpie/issues/955
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org