-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into release/2.x
- Loading branch information
Showing
16 changed files
with
345 additions
and
93 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,47 @@ | ||
name: Check formatting with treefmt | ||
|
||
on: | ||
[push, pull_request] | ||
|
||
jobs: | ||
treefmt: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: cachix/install-nix-action@v22 | ||
- uses: actions/checkout@v4 | ||
- id: changed-files | ||
uses: tj-actions/changed-files@v44 | ||
- name: Run treefmt | ||
run: nix fmt | ||
- name: Check diff | ||
env: | ||
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: | | ||
unformatted_touched=() | ||
unformatted_untouched=() | ||
while IFS= read -r unformatted_file; do | ||
matched= | ||
for changed_file in ${ALL_CHANGED_FILES}; do | ||
if [[ "$changed_file" == "$unformatted_file" ]]; then | ||
unformatted_touched+=("$unformatted_file") | ||
matched=1 | ||
break | ||
fi | ||
done | ||
if [[ -z "$matched" ]]; then | ||
unformatted_untouched+=("$unformatted_file") | ||
fi | ||
done <<< "$(git diff --name-only)" | ||
if (( ${#unformatted_untouched[@]} )); then | ||
echo "These files are not formatted, but out of scope of this PR:" | ||
printf '%s\n' "${unformatted_untouched[@]}" | ||
fi | ||
echo # blank line | ||
if (( ${#unformatted_touched[@]} )); then | ||
echo "These files are created/edited but not formatted:" | ||
printf '%s\n' "${unformatted_touched[@]}" | ||
exit 1 | ||
fi |
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 |
---|---|---|
|
@@ -3,3 +3,6 @@ | |
/html/ | ||
|
||
__pycache__ | ||
|
||
result | ||
result-* |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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
Oops, something went wrong.