This version includes a bug fix which has been causing some issues, as well as a new flag and a new check.
The "use min/max" check (FURB136)
This check will detect uses of ternary statements (inline-if expressions) which can be written with the builtin min()
/max()
functions instead. For example:
score1 = 90
score2 = 99
highest_score = score1 if score1 > score2 else score2
Refurb will suggest you write this as:
score1 = 90
score2 = 99
highest_score = max(score1, score2)
Mypy Flags
You can now add Mypy flags directly from the Refurb command line like so:
$ refurb files -- --pdb --show-traceback
The --pdb
and --show-traceback
flags will get forwarded to Mypy. This is primarily for development purposes, but can be useful to normal users as well (especially those who already use Mypy). See the docs for more info.
What's Changed
- Add
format()
function to FURB119 by @dosisod in #110 - Add "use min/max" check by @dosisod in #111
- Fix name of member expressions not being checked by @dosisod in #115
- Add ability to pass flags directly into Mypy by @dosisod in #118
- Bump version, update issue template by @dosisod in #120
Full Changelog: v1.6.0...v1.7.0