Refurb

Latest version: v2.0.0

Safety actively analyzes 710445 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 6 of 6

1.3.0

This release includes a lot of bug fixes, documentation improvements, the `--enable` flag, and a new check!

The `--enable` flag

This allows for enabling checks which are disabled by default. There are currently no built-in checks which are disabled, but checks in plugins (or future built-in checks) might be disabled by default, and will require you to opt in via `--enable`.

You can also use this via the `enable` field in the `pyproject.toml` file.

The "no del" check

This check warns about the use of a `del` statement which could be rewritten using `.pop()`/`.clear()` instead:

For example, this:

python
nums = [1, 2, 3]

del nums[0]
del nums[:]


Is suggested to be changed to:

python
nums = [1, 2, 3]

nums.pop(0)
nums.clear()

---

What's Changed
* Require len() comparison check to only operate within `if` statements by dosisod in https://github.com/dosisod/refurb/pull/32
* Simplify error code naming system by dosisod in https://github.com/dosisod/refurb/pull/33
* Fix incorrect error message for `dict`/`list` for FURB123 by dosisod in https://github.com/dosisod/refurb/pull/36
* Simplify `mypy` config by michaeloliverx in https://github.com/dosisod/refurb/pull/27
* Add ability to enable/disable checks by dosisod in https://github.com/dosisod/refurb/pull/41
* Use `utf8` locale when reading files by dosisod in https://github.com/dosisod/refurb/pull/43
* Fix "with suppress" check giving incorrect message for multiple exceptions by dosisod in https://github.com/dosisod/refurb/pull/48
* Cleanup the "in tuple" check by dosisod in https://github.com/dosisod/refurb/pull/49
* Add "no del" check by dosisod in https://github.com/dosisod/refurb/pull/50
* Update Documentation, Bump Version by dosisod in https://github.com/dosisod/refurb/pull/51

New Contributors
* michaeloliverx made their first contribution in https://github.com/dosisod/refurb/pull/27

**Full Changelog**: https://github.com/dosisod/refurb/compare/v1.2.0...v1.3.0

1.2.0

This new release contains some bug fixes, documentation improvements, [pre-commit](https://pre-commit.com/) support, and 2 new checks!

The "readlines()" check

This code

python
with open("file.txt") as f:
for line in f.readlines():
pass


Is suggested to be changed to:

python
with open("file.txt") as f:
for line in f:
pass


The "in keys" check

This code

python
d = {"key": "value"}

if "key" in d.keys():
pass


Is suggested to be changed to:

python
d = {"key": "value"}

if "key" in d:
pass


---

What's Changed
* Add pre commit config by EFord36 in https://github.com/dosisod/refurb/pull/19
* Fixed typos by trag1c in https://github.com/dosisod/refurb/pull/16
* Add `readlines()` check by dosisod in https://github.com/dosisod/refurb/pull/22
* Fix tuple unpacking false positive by dosisod in https://github.com/dosisod/refurb/pull/24
* Lots of small bug fixes by dosisod in https://github.com/dosisod/refurb/pull/25
* Add "in keys" check by dosisod in https://github.com/dosisod/refurb/pull/26

New Contributors
* EFord36 made their first contribution in https://github.com/dosisod/refurb/pull/19
* trag1c made their first contribution in https://github.com/dosisod/refurb/pull/16

**Full Changelog**: https://github.com/dosisod/refurb/compare/v1.1.0...v1.2.0

1.1.0

Thank you for all the love and support since Refurb's v1 release yesterday! This new release includes some bug fixes, as well as features which should've been in the v1 release. Thank you to everyone on [Hackernews](https://news.ycombinator.com/item?id=33003929) who gave me their feedback!

What's Changed
* Fix `Path.read_text()` false positive by dosisod in https://github.com/dosisod/refurb/pull/11
* Add help and version flags by dosisod in https://github.com/dosisod/refurb/pull/12 (Thank you kseistrup for reporting this!)
* Mention the `--explain` flag whenever an error occurs by dosisod in https://github.com/dosisod/refurb/pull/13

**Full Changelog**: https://github.com/dosisod/refurb/compare/v1.0.0...v1.1.0

Page 6 of 6

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.