Skip to content

fix: code quality issue#226

Open
Kanchan-Microsoft wants to merge 1 commit into
devfrom
code-quality
Open

fix: code quality issue#226
Kanchan-Microsoft wants to merge 1 commit into
devfrom
code-quality

Conversation

@Kanchan-Microsoft

Copy link
Copy Markdown

Purpose

This pull request makes a minor update to the src/api/app/routers/voice_live.py file. The change assigns the result of an awaited coroutine to a throwaway variable (_) instead of directly awaiting it without assignment. This is a stylistic improvement and does not affect functionality.

  • Assigned the result of await close_result to _ in both the stop and text_to_speech functions to clarify intent and follow best practices. [1] [2]

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

@github-actions

Copy link
Copy Markdown

Coverage

Coverage Report •
FileStmtsMissCoverMissing
routers
   voice_live.py3663989%30–33, 154–155, 161–162, 173, 176, 212–215, 236–238, 306–309, 326, 328, 374–376, 379, 382, 384–386, 403–404, 413–414, 643–644, 719, 728
TOTAL230224189% 

Tests Skipped Failures Errors Time
393 0 💤 0 ❌ 0 🔥 9.421s ⏱️

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates voice_live.py to assign the result of an awaited close() coroutine to a throwaway variable (_) in two places during credential cleanup.

Changes:

  • Updated VoiceLiveHandler.stop() to assign await close_result to _.
  • Updated text_to_speech() cleanup to assign await close_result to _.
Comments suppressed due to low confidence (1)

src/api/app/routers/voice_live.py:614

  • Assigning the awaited result to _ will trigger flake8/pyflakes F841 local variable '_' is assigned to but never used (the repo's .flake8 does not ignore F841). Prefer a plain await close_result (or add an explicit noqa if you truly need the assignment).
            close_result = close_fn()
            if asyncio.iscoroutine(close_result):
                _ = await close_result

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/api/app/routers/voice_live.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants