Skip to content

Исправления GUI, кэша и парсинга ввода#2

Merged
bivlked merged 1 commit into
mainfrom
fix/code-quality-improvements
Dec 8, 2025
Merged

Исправления GUI, кэша и парсинга ввода#2
bivlked merged 1 commit into
mainfrom
fix/code-quality-improvements

Conversation

@bivlked

@bivlked bivlked commented Dec 8, 2025

Copy link
Copy Markdown
Owner

Что сделано

  • не блокируем GUI при запросах к ЦБ: конвертация уходит в фоновую нить, кнопка временно блокируется
  • нормализуем суммы с пробелами/разделителями тысяч и регистронезависимые коды валют
  • кэш очищает устаревшие записи при каждом доступе/записи, чтобы TTL реально работал
  • добавлена conftest-заглушка для опций --cov, чтобы pytest не падал без pytest-cov
  • расширены тесты для новых кейсов

Проверка

  • poetry run pytest -q

@codecov

codecov Bot commented Dec 8, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.85714% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/currate/gui.py 19.04% 17 Missing ⚠️
src/currate/currency_converter.py 96.96% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +212 to +215
cleaned = cleaned.replace(',', '.')
if cleaned.count('.') > 1:
parts = cleaned.split('.')
cleaned = ''.join(parts[:-1]) + '.' + parts[-1]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Parse multi-group amounts without adding phantom decimals

The new parse_amount normalization treats any string with more than one separator as if the last separator were a decimal point (cleaned = ''.join(parts[:-1]) + '.' + parts[-1]), so an amount like "1.234.567"/"1,234,567" is parsed as 1234.567 instead of 1234567. This silently shrinks large integer inputs by three orders of magnitude rather than rejecting them, so conversions for million-scale values entered with standard thousand grouping will be wrong.

Useful? React with 👍 / 👎.

@bivlked bivlked merged commit 9e9b4ab into main Dec 8, 2025
3 of 5 checks passed
@bivlked bivlked deleted the fix/code-quality-improvements branch December 8, 2025 18:27
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