Skip to content

Approve Python Formatting Changes

Approve PRs that only contain formatting changes to Python files.

Approve Python Formatting Changes

Configuration Description

Conditions (all must be true):

  • All of the files end in .py.
  • All changes are non-functional

Automation Actions:

  • Approve the PR
  • Apply a code-formatting label.
  • Post a comment that explains the automation.

Approve Python Formatting Changes

# -*- mode: yaml -*-

manifest:
  version: 1.0

automations:
  approve_python_formatting:
    if:
      - {{ files | extensions | match(list=['py']) | every }}
      - {{ source.diff.files | isFormattingChange }}
    run:
      - action: approve@v1
      - action: add-label@v1
        args:
          label: code-formatting
      - action: add-comment@v1
        args:
          comment: |
            This PR only contains formatting changes and has been approved.

Additional Resources

gitStream is a workflow automation tool that enables you to use YAML configuration files to optimize your code review process. Add context to PRs, find code experts for reviews, and automate the merge process to maximize developer productivity.

Learn More about how gitStream Works.

Related Automations:

More Automations can be found on the Automation Library and Integrations pages.