Skip to content

Release 1.20.0

Choose a tag to compare

@AngusHsu AngusHsu released this 13 Oct 03:01
e36d6e4

Validity changes

  • BRA (#617): RG checksum validation treats X as value 10,
    rejecting it when the weighted sum has remainder 0 modulo 11 and accepting it when the remainder is 1. Numeric
    check-digit behavior is unchanged; remainder 0 still accepts 0.
  • UKR (#616): taxpayer ID numbers with encoded birth dates
    after the local current date now return False from validate() and None from parse(). Today's date remains
    accepted, and checksum computation and parsed fields for past dates are unchanged.

Changed

  • Coverage badge (#600): the README shows the line and branch
    coverage from a shields.io endpoint JSON that CI publishes to the badges branch on pushes to main, using
    GITHUB_TOKEN with no repository secrets or external service. Pull request CI and the 97% floor are unchanged.
  • Coverage badge hardening (#611): CI tests pin the workflow
    triggers to push and pull_request, the coverage checkout does not persist credentials, and badge publication
    skips stale main commits after checking the remote head. The endpoint JSON, coverage metric and floor are unchanged.
  • Formatting (#599): the Python sources are formatted with
    ruff format (ruff 0.16.10, 120 columns; Markdown is left alone) and CI checks them with ruff format --check.
    .git-blame-ignore-revs lists the reformat commit, so git blame skips it. Code and behaviour are unchanged. This
    also settles the quote style of the README example tests
    (#561).

Other fixes

  • Checksums (#619): every public checksum() returns
    False or None for non-string input instead of raising or computing a value. HKG and TUR computed checksums
    now return Optional[str]. All string-input behavior, including malformed strings, is unchanged.
  • Formatting (#618): normalize_id() and format_id()
    uppercase ASCII letters only, leaving non-ASCII letters (including lowercase Greek letters) unchanged instead of
    folding lookalikes or expanding ligatures into ASCII. Helper outputs change; country validation is unchanged.
  • LKA (#615): old NIC suffixes V/v/X/x historically
    indicated voter/nonvoter status, not citizenship. OldNationalID.parse() keeps the citizenship key but returns
    None instead of citizen/resident status, with type Optional[Citizenship]. Validation, checksum, conversion and
    other parsed fields are unchanged.

Documentation

  • Contributor checklists (#608): explicitly name both ruff
    lint and formatting checks. CI contract tests tolerate extra formatter exclusions and reordered jobs while
    retaining readable failures for missing checks. Clarify checksum-group coverage, line wrapping and the first
    trusted release wording; CI policy and library behaviour are unchanged.
  • Contributor guide (#598): the line-length rule in
    AGENTS.md now says that every line of a reflowed paragraph counts as changed, and that only URLs are exempt: other
    long string literals and citations are wrapped. Code and behaviour are unchanged.
  • Country template (#595): the checksum group item names the
    check character(s) and covers a checksum() that returns a derived value (the tax file number's remainder): the group
    stays over the check character, and the class needs the named exemption in TestComputedChecksumGroups. The BGR
    13-digit test comment now names digits 9 to 12. Code and behaviour are unchanged.
  • Input masks (#620): clarify that masks describe preferred
    shapes, not fixed letter prefixes, ID validity or every accepted separator variant. Tests check accepted mask
    representatives directly against each class's regexp as well as its validator. Metadata and helper outputs are
    unchanged.
  • Release procedure (#603): RELEASE.md dates the closure
    of #327 (2026-10-12) and says that releases since 1.16.0 have
    run the updated workflow runtimes, with 1.18.0 the first trusted publication. The procedure is unchanged.