Changelog


We've added a walkthrough to our VS Code extension to make it easier to get started with Sourcery. Go to the Help > Get Started menu to check it out.

We've added two new refactorings for pandas! These aim to improve performance by streamlining apply operations. If you have any feedback or more ideas for rules you'd like to see in pandas please let us know!

Custom rules are now even more powerful!

  • You can specify paths that rules should be included or excluded from running on.
  • You can now add tests for rules in-line in the config file

Added

  • sourcery init command to produce a default .sourcery.yaml configuration file
  • replace-apply-with-method-call refactoring for Pandas Series and DataFrame
  • replace-apply-with-numpy-operation refactoring for Pandas Series and DataFrame
  • Rules can specify paths that they include/exclude from running on
  • Support for tests in custom rule configuration
  • Walkthrough for VS Code
  • The .sourcery.yaml file is now validated when it is opened in PyCharm

Changed

  • Added version to config file and removed recommendation_level from output
  • Allow pattern/replacement for custom rules to contain any combination of statement or expression

Fixed

  • Issue where for-index-replacement could remove indices that were accessed later.
  • Tuples should now be given the correct parentheses everywhere (fixes issue )
  • Ensure consistency between similar fstring examples
  • sum-comprehension: Do not apply if the name sum has already been used.
  • remove-redundant-fstring won't remove the content of multi-line fstrings.