-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: 🎡 enforce code-formatting at CI time instead of pre-commit (#54)
- Loading branch information
1 parent
44e610a
commit a19923a
Showing
5 changed files
with
44 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Code Quality Checks | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
code_format: | ||
name: Code Formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.12 | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/pip | ||
key: linux-pip-dev-${{ hashFiles('requirements-dev.txt') }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements-dev.txt | ||
- name: Run code formatter | ||
run: isort . && black . | ||
|
||
- name: Assert that the codebase has no dif | ||
shell: bash | ||
run: | | ||
if [[ -n "$(git status --short | grep '^ [^\s]\|??')" ]]; then | ||
echo "Unstaged/untracked files exist" | ||
git status | ||
git --no-pager diff | ||
echo "Auto formatting hasn't been applied by the codebase." | ||
exit 1 | ||
fi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
|
||
pre_commit==4.0.1 | ||
pyarrow-stubs==17.13 | ||
black==24.10.0 | ||
isort==5.13.2 |