Skip to content

chore: fix ruff unused imports and invalid regex escapes - #46

Merged
ljmerza merged 1 commit into
mainfrom
chore/lint-cleanup
Oct 21, 2026
Merged

ljmerza merged 1 commit into
mainfrom
chore/lint-cleanup

Conversation

@ljmerza

@ljmerza ljmerza commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Summary

Small cleanup, separate from #45.

  • parsers_list.py: remove 3 unused imports (EMAIL_ATTR_FROM, EMAIL_ATTR_SUBJECT, EMAIL_ATTR_BODY). This is ruff F401.
  • ali_express.py, pledgebox.py, swiss_post.py: make the regex patterns raw strings. Python 3.12+ emits SyntaxWarning: invalid escape sequence for '\.' and '\d'. The regexes don't change, because the invalid escapes were already passed through literally.

Testing

  • ruff check custom_components/tracking_numbers/parsers_list.py passes.
  • python3 -W error -m py_compile over the integration compiles with no warnings.
  • python3 scripts/run_parsers.py passes on all fixtures.
  • The change is line-level only, with no conflicts expected with feat: order numbers alongside tracking numbers, Stride Rite parser #45. CRLF line endings in parsers_list.py are preserved.

- parsers_list.py: drop unused EMAIL_ATTR_FROM/SUBJECT/BODY imports.
- ali_express.py, pledgebox.py, swiss_post.py: use raw strings for regexes
  with \. and \d (SyntaxWarning: invalid escape sequence on Python 3.12+).
  Behavior is unchanged: the escapes were already passed through literally.
@ljmerza
ljmerza merged commit 56b34d1 into main Oct 21, 2026
4 checks passed
@ljmerza
ljmerza deleted the chore/lint-cleanup branch October 21, 2026 02:03
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