Format the python matching internal linter

This commit is contained in:
Nick Gerleman
2022-12-23 05:20:51 -08:00
parent 51a2a3856e
commit 676fa1fbf3
3 changed files with 48 additions and 1 deletions

25
.github/actions/black/action.yml vendored Normal file
View 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
View 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 }}

View File

@@ -260,7 +260,8 @@ with open(root + "/javascript/sources/YGEnums.d.ts", "w") as f:
base = value[1] + 1
else:
f.write(
"export const %s_%s: %d;\n" % (to_java_upper(name), to_java_upper(value), base)
"export const %s_%s: %d;\n"
% (to_java_upper(name), to_java_upper(value), base)
)
base += 1