mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-08-28 03:00:55 +00:00
4b7fcc6f4f
Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 39 to 40. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v39...v40) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.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@v4
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Get changed python files
|
|
id: changed-files
|
|
uses: tj-actions/changed-files@v40
|
|
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 ${{ 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
|