Releases: 15r10nk/matchify
Releases · 15r10nk/matchify
Release list
0.2.0
Added
- Convert membership tests against eligible literal sets into OR patterns when
thehashable-subjectsassumption is enabled.
Fixed
- Apply
--no-typespatterns to qualifiedisinstancetargets such as
typing.Mapping, including targets contained in type tuples.
0.1.0
Added
- Added
--checkmode. It reports files that would be converted without
modifying them and exits with status 1 when changes are needed or processing
errors occur. - Added
matchifyandmatchify-checkpre-commit hooks for automatic rewriting
and check-only CI workflows. - Added conversion of eligible inline dictionary lookups and single-use local
lookup-table variables intomatchstatements. Literal and nested tuple keys,
arbitrary value expressions, comments, single evaluation of the lookup key,
and the originalKeyErrorbehavior are preserved where supported. This
conversion requires the newlookup-equalityassumption. - Added the
identity-equalityassumption, allowing qualified identity checks
such asvalue is Enum.MEMBERto become value patterns when identity and
equality are known to be equivalent. - Added separate
list-sequence-patternandtuple-sequence-pattern
assumptions for converting explicit sequence type checks into Python sequence
patterns. Checks against both types require both assumptions. - Exported
Assumptionsfrom the top-levelmatchifypackage. - Added an MIT license.
Changed
- Composite match subjects selected under
pure-subjectsnow use paths shared
by a majority of branches. This enables more eligible mixed-subject chains to
be converted while keeping less common checks in guards. - Sequence transformations are more conservative: an
isinstancecheck for
listortupleis no longer treated as implied by a sequence pattern unless
the corresponding assumption is enabled. Qualified class names remain
guarded and are not covered by these assumptions. - CLI summaries distinguish check results with
would convert, and normal as
well as check mode now return a failure status for processing errors. - Release automation now uses dedicated release pull requests, tags the tested
merge commit, publishes it to PyPI, and creates GitHub release notes from
Scriv fragments.
Fixed
- Preserved comments attached to dictionary lookup statements during
conversion. - Restricted dictionary lookup conversion to safe, unambiguous candidates.
Chained subscriptions, reused local tables, multiple or unsupported uses,
duplicate or unhashable keys, dictionary unpacking, and other unsafe forms
remain unchanged. - Avoided capture-name collisions in generated missing-key cases.
Development
- Expanded behavior and public-API tests, including generated runtime
round-trips, and enforced 100% branch coverage. - Added locked dependencies, lowest-direct-dependency CI coverage, PyPy 3.11
testing, and updated repository template and maintenance automation.