Skip to content

Fix ruff linting errors#60

Open
willwade wants to merge 2 commits intomainfrom
fix-ruff-errors-5870985720270015513
Open

Fix ruff linting errors#60
willwade wants to merge 2 commits intomainfrom
fix-ruff-errors-5870985720270015513

Conversation

@willwade
Copy link
Copy Markdown
Collaborator

This PR fixes several linting errors reported by ruff in scripts/generate_sherpa_audio_all_models.py.

The changes include:

  1. Removing unused imports: tempfile and zipfile were imported but not used.
  2. Fixing f-strings: Several print(f"...") statements did not contain any expressions and were converted to standard strings.
  3. Removing duplicate dictionary keys: The iso639_3_to_1 dictionary contained duplicate entries for "tur", "ukr", and "amh". These duplicates had identical values to their earlier occurrences and were safely removed to resolve F601 errors.

The changes were verified by running uv run ruff check . which now passes cleanly. Existing tests were also run with uv run pytest and passed.


PR created automatically by Jules for task 5870985720270015513 started by @willwade

- Remove unused imports (`tempfile`, `zipfile`)
- Convert f-strings without placeholders to normal strings
- Remove duplicate dictionary keys (`tur`, `ukr`, `amh`) to fix F601 errors

Co-authored-by: willwade <229352+willwade@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

…sherpa_audio_all_models.py

- Remove unused imports (`tempfile`, `zipfile`)
- Fix F541 (f-string without placeholder)
- Replace hardcoded `iso639_3_to_1` dictionary with `get_iso_mapping()` which reads from `data/index.json`
- Remove hardcoded dictionary keys which were causing F601 (duplicate keys) errors
- Use `functools.lru_cache` for the mapping function

Co-authored-by: willwade <229352+willwade@users.noreply.github.com>
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.

1 participant