Format the python matching internal linter
This commit is contained in:
25
.github/actions/black/action.yml
vendored
Normal file
25
.github/actions/black/action.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: Black Formatter
|
||||
inputs:
|
||||
directory:
|
||||
description: Directory to Lint
|
||||
required: true
|
||||
version:
|
||||
description: pypi version of "black" to use
|
||||
required: false
|
||||
default: 22.3.0
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Ensure supported Python selected
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '>=3.6.2'
|
||||
|
||||
- name: pip install
|
||||
shell: bash
|
||||
run: pip install black==${{ inputs.version }}
|
||||
|
||||
- name: black
|
||||
shell: bash
|
||||
run: black --check ${{ inputs.directory }}
|
21
.github/workflows/validate-python.yml
vendored
Normal file
21
.github/workflows/validate-python.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: Python
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
format:
|
||||
name: Format
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: black --check
|
||||
uses: ./.github/actions/black
|
||||
with:
|
||||
directory: ${{ github.workspace }}
|
Reference in New Issue
Block a user