Skip to content

Release v1.24.0

Compare
Choose a tag to compare
@dosisod dosisod released this 17 Nov 02:55
· 90 commits to master since this release

This release adds 2 new checks, some documentation updates, and allows for using Refurb with the new 1.7.0 release of Mypy. Thank you @bzoracler for fixing this!

Unpin Mypy v1.7.0

Mypy v1.7.0 made an internal change that broke Refurb (see #305). A workaround has since been found meaning we no longer need to pin to Mypy <1.7.0. If you are still experiencing any issues with using older/newer versions of Mypy with Refurb, please open an issue!

Add use-hexdigest-hashlib check (FURB181)

Use .hexdigest() to get a hex digest from a hash.

Bad:

from hashlib import sha512

hashed = sha512(b"some data").digest().hex()

Good:

from hashlib import sha512

hashed = sha512(b"some data").hexdigest()

Add simplify-hashlib-ctor (FURB182)

You can pass data into hashlib constructors, so instead of creating a hash object and immediately updating it, pass the data directly.

Bad:

from hashlib import sha512

h = sha512()
h.update(b"data)

Good:

from hashlib import sha512

h = sha512(b"data")

What's Changed

New Contributors

Full Changelog: v1.23.0...v1.24.0