diff --git a/.github/actions/format/action.yml b/.github/actions/format/action.yml new file mode 100644 index 00000000..0498de23 --- /dev/null +++ b/.github/actions/format/action.yml @@ -0,0 +1,28 @@ +name: 'Format Python Code' +description: 'Runs ruff format and ruff check --fix' +inputs: + path: + description: 'Path to the python repository' + required: true +runs: + using: 'composite' + steps: + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.8' + + - name: Install ruff + run: pip install -e ".[dev]" + shell: bash + working-directory: ${{ inputs.path }} + + - name: Run ruff format + run: ruff format Adyen + shell: bash + working-directory: ${{ inputs.path }} + + - name: Run ruff check --fix + run: ruff check --fix Adyen + shell: bash + working-directory: ${{ inputs.path }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index dc6ea514..18225ca3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -34,7 +34,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install ruff + pip install -e ".[dev]" - name: Run ruff linter run: |