- Updated dependencies.
- Now we use LibCST 0.4.1, which means that you should be able to run
pybetter
on all the Python 3 versions up to 3.11! - Please be kind to each other and hug your loved ones.
- (B010) Added new fixer for
not A is B => A is not B
situation. (kudos to @rs2)
- (B003) Prevent removal of parentheses around empty tuple (kudos to @rs2)
- (B008) Invalid translation with async context manager block (kudos to @lummax)
- (B004) Fix
typing.overload
annotations causing appearance of duplicate identifiers in__all__
attribute (thanks, Bernát Gábor!).
- Added support for
pre-commit
hooks (thanks, Pavel Kedrinskiy!). - Updated version of LibCST used from 0.3.16 to 0.3.19.
- Fix another edge case with transforming "raw" f-strings (thanks, Zac Hatfield-Dodds!)
- Fix triple quotes being mangled by 'trivial f-string' transform (thanks, Zac Hatfield-Dodds!)
- Updated dependencies.
- Add
--exit-code
option to facilitate use as a static analysis tool.
- (B001) Fix issue with trying to convert multiple consecutive comparisons.
- (B002) Properly process nested functions.
- (B002) Ensure that order of arguments is preserved during iteration.
- (B003) Fix unnecessary elimination of parens inside returned expression.
--diff
option behaviour has changed:- Output is now being printed on
sys.stderr
instead ifsys.stdout
. - Source lines are no longer highlighted if
sys.stderr
is redirected away from TTY.
- Output is now being printed on
- Fix issue with
noqa
directive with one argument being treated asnoqa
without any arguments. - (B001) Fix arrangement of parentheses on transformed comparisons.
- Use
pygments
for highlighting of diffs. - Output time taken to apply selected transformations.
- Output total time taken to process all files in provided paths.
- Now we use Travis CI to run tests on each commit.
- New "improvements" added:
- B008: Replace nested 'with' statements with a compound one.
- B009: Replace unhashable list literals in set constructors
- (B002) Fix issue when new inits were added before docstrings.
- (B002) Remove unneeded indent after generated initializations.
- Nothing is displayed if no changes were made to the file.
-
(B003) No longer remove parentheses from multi-line return statements.
-
(B004)
a == False
is now correctly reduced tonot a
.
- Now we will recurse over every path provided and process all
*.py
files found. - Added support for
--select
/--ignore
options for fine-tuning set of checks being run. - Added support for per-line disabling of specific checks using
noqa
comments.
-
Variable names and constants are now properly added to
__all__
attribute. -
Small fixes in README.
- New "improvements" added:
- B007: Convert f-strings without expressions into regular strings.
- Fix some typing violations.
- Now metadata resolution is done properly for all transformers.
- Matcher decorators were used in a wrong way and caused a lot of false positives.
- Now contents of the generated
__all__
attribute are lexicographically sorted. - Some transformers made changes on the
original_node
attribute, which could have led to subtle bugs.
-
New "improvements" added:
- B005: Replace "A == None" with "A is None"
- B006: Remove comparisons with either 'False' or 'True'.
-
Now you can output diff between original and modified code using
--diff
option.
- Initial release.