diff --git a/.github/actions/black/action.yml b/.github/actions/black/action.yml new file mode 100644 index 00000000..63b6c423 --- /dev/null +++ b/.github/actions/black/action.yml @@ -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 }} diff --git a/.github/workflows/validate-python.yml b/.github/workflows/validate-python.yml new file mode 100644 index 00000000..6ff392d2 --- /dev/null +++ b/.github/workflows/validate-python.yml @@ -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 }} diff --git a/enums.py b/enums.py index 4cd2a64d..fb77e5b8 100644 --- a/enums.py +++ b/enums.py @@ -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