mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-24 20:39:09 +00:00
e8196936f9
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Zach Borboa <zachborboa@gmail.com>
46 lines
1.4 KiB
YAML
46 lines
1.4 KiB
YAML
name: Lint
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Get changed python files
|
|
id: changed-files
|
|
uses: tj-actions/changed-files@v47
|
|
with:
|
|
files: "**/*.py"
|
|
|
|
- name: Install requirements
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
|
run: pip install black flake8 isort
|
|
|
|
- name: black changed files
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
|
run: |
|
|
black --check --color --diff --quiet ${{ steps.changed-files.outputs.all_changed_files }}
|
|
|
|
- name: flake8 changed files
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
|
run: |
|
|
flake8 --config="tests/setup.cfg" ${{ steps.changed-files.outputs.all_changed_files }}
|
|
|
|
- name: isort changed files
|
|
if: steps.changed-files.outputs.any_changed == 'true'
|
|
run: |
|
|
set +e
|
|
isort --check-only --force-single-line-imports --profile black ${{ steps.changed-files.outputs.all_changed_files }}
|
|
exit_code="${?}"
|
|
if [[ "${exit_code}" -ne 0 ]]; then
|
|
isort --force-single-line-imports --profile black ${{ steps.changed-files.outputs.all_changed_files }}
|
|
git diff --color
|
|
exit "${exit_code}"
|
|
fi
|