Changelog


← Back to all posts

November 29, 2022

Sourcery VS Code Hub

You can now configure Sourcery directly from VS Code. Just click the Sourcery button in the VS Code status bar at the bottom.

Then you can login, read the Getting Started instructions or select Sourcery rules to enable and disable

Sourcery hub

Python 3.10 support

Sourcery now parses and understands Python 3.10 code including the all important match syntax.

Google Python Style Guide

You can now easily run the Google Python Style Guide.

Enable it directly from config with:

rule_settings:
  enable:
    - default  # Continue to run the default rules
    - google-python-style-guide  # Add in the additional

Or run it directly from CLI with sourcery review --enable google-python-style-guide PATH

Full changelog

Added

  • Enable Google Python Style Guide directly from config with:
    rule_settings:
      enable:
        - default  # Continue to run the default rules
        - google-python-style-guide  # Add in the additional
  • Enable Google Python Style Guide directly from CLI with sourcery review --enable google-python-style-guide PATH
  • Sourcery will now display quick fixes on VS Code even if other tools show diagnostics for the same piece of code.
  • Support Python 3.10
    • Support parsing and analysing match statements.
    • Support parsing of with statements containing multiple bracketed context managers.

Changed

  • Rename .sourcery.yaml keys:
    • refactor -> rule_settings
    • rule_settings.include -> rule_settings.enable
    • rule_settings.skip -> rule_settings.disable
  • Redesign of the hub pages.
  • Rule ids and tags must now be less than 88 characters and match this regex: ^\[A-Za-z\]\[A-Za-z0-9-\_/:\]\*$

Fixed

  • Automatically renames refactor -> rule_settings and other config keys when adding disable rule ids from IDEs
  • Handles config error on IDE startup and shows better user errors
  • Issue with capturing and replacing aliases in custom rules.