Skip to content

Commit

Permalink
Merge pull request #4 from arichadda/main
Browse files Browse the repository at this point in the history
Adding python linting and formatting starting points
  • Loading branch information
rashley-iqt authored May 23, 2024
2 parents 58adeff + 3f4cff8 commit 921a68e
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
22 changes: 22 additions & 0 deletions python-format/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: python-formatting-consistency
run-name: ${{ github.run_id }}, authored by @${{ github.actor }}
on:
pull_request:
branches: [main]
types: [opened, synchronize]

jobs:
run-formatter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v5
with:
python-version: 3.12.1
- run: python3 -m pip install --upgrade pip
- run: python3 -m pip install black==24.1.1
- id: python-files-found
run: echo "python-file-list="$(git ls-files "*.py" | xargs -I {} sh -c 'full_path=$(git rev-parse --show-toplevel)/{}; echo "$full_path"')"" >> $GITHUB_OUTPUT

- if: steps.python-files-found.outputs.python-file-list
run: for file in ${{steps.python-files-found.outputs.python-file-list}}; do black --check "$file" ; done;
18 changes: 18 additions & 0 deletions python-lint/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: python-linting-checker
run-name: ${{ github.run_id }}, update authored by @${{ github.actor }}
on:
pull_request:
branches: [main]
types: [opened, synchronize]

jobs:
run-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v5
with:
python-version: 3.12.1
- run: python3 -m pip install --upgrade pip
- run: python3 -m pip install ruff==0.1.15
- run: ruff --respect-gitignore $GITHUB_WORKSPACE # ruff automatically finds python files

0 comments on commit 921a68e

Please sign in to comment.