forked from NHERI-SimCenter/pelicun
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb7b88d
commit 14a0345
Showing
4 changed files
with
23 additions
and
72 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,24 +25,26 @@ jobs: | |
- name: Run Black | ||
run: black -S . | ||
|
||
- name: Check for changes after Black | ||
- name: Check for changes | ||
id: git_status | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | ||
git status | ||
if [[ `git status --porcelain` ]]; then | ||
git add . | ||
git commit -m "Format code with Black" | ||
git add . | ||
if git diff-index --quiet HEAD --; then | ||
echo "No changes to commit" > /tmp/git_status_output | ||
else | ||
echo "No changes to commit" | ||
git commit -m "Format code with Black" | ||
echo "Changes committed" > /tmp/git_status_output | ||
fi | ||
continue-on-error: true | ||
|
||
- name: Read git status output | ||
id: read_git_status | ||
run: cat /tmp/git_status_output | ||
|
||
- name: Push changes | ||
if: success() && steps.git_status.outputs.commit_message != '' | ||
if: steps.read_git_status.outputs.result != 'No changes to commit' | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Run Flake8 | ||
run: flake8 . |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
repos: | ||
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster | ||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 24.4.2 | ||
hooks: | ||
- id: black | ||
# It is recommended to specify the latest version of Python | ||
# supported by your project here, or alternatively use | ||
# pre-commit's default_language_version, see | ||
# https://pre-commit.com/#top_level-default_language_version | ||
language_version: python3.10 |