-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #620 from LCSB-BioCore/develop
Develop→master for 1.3.1
- Loading branch information
Showing
16 changed files
with
443 additions
and
112 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,53 @@ | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
name: PR auto-formatting command | ||
|
||
jobs: | ||
format: | ||
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER' || github.event.issue.user.id == github.event.comment.user.id) && startsWith(github.event.comment.body, '/format') }} | ||
name: auto-format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone the repository | ||
uses: actions/checkout@v2 | ||
- name: Checkout the pull request code | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh pr checkout ${{ github.event.issue.number }} | ||
- name: Install JuliaFormatter and format | ||
run: | | ||
julia -e 'import Pkg; Pkg.add("JuliaFormatter")' | ||
julia -e 'using JuliaFormatter; format(".")' | ||
- name: Remove trailing whitespace | ||
run: | | ||
find -name '*.jl' -or -name '*.md' -or -name '*.toml' -or -name '*.yml' | while read filename ; do | ||
# remove any trailing spaces | ||
sed --in-place -e 's/\s*$//' "$filename" | ||
# add a final newline if missing | ||
if [[ -s "$filename" && $(tail -c 1 "$filename" |wc -l) -eq 0 ]] ; then | ||
echo >> "$filename" | ||
fi | ||
# squash superfluous final newlines | ||
sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' "$filename" | ||
done | ||
- name: Commit and push the changes | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
if [ `git status -s | wc -l` -ne 0 ] ; then | ||
git config --local user.name "$GITHUB_ACTOR" | ||
git config --local user.email "[email protected]" | ||
git commit -a -m "automatic formatting" -m "triggered by @$GITHUB_ACTOR on PR #${{ github.event.issue.number }}" | ||
if git push | ||
then gh pr comment ${{ github.event.issue.number }} --body \ | ||
":heavy_check_mark: auto-formatting triggered by [this comment](${{ github.event.comment.html_url }}) succeeded, commited as `git rev-parse HEAD`" | ||
else gh pr comment ${{ github.event.issue.number }} --body \ | ||
":x: auto-formatting triggered by [this comment](${{ github.event.comment.html_url }}) failed, perhaps someone pushed to the PR in the meantime?" | ||
fi | ||
else | ||
echo "No changes, all good!" | ||
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
on: | ||
pull_request: | ||
|
||
name: Formatting check | ||
|
||
jobs: | ||
formatcheck: | ||
name: check-code-format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the code | ||
uses: actions/checkout@v2 | ||
- name: Install JuliaFormatter and format | ||
run: | | ||
julia -e 'import Pkg; Pkg.add("JuliaFormatter")' | ||
julia -e 'using JuliaFormatter; format(".")' | ||
- name: Remove trailing whitespace | ||
run: | | ||
find -name '*.jl' -or -name '*.md' -or -name '*.toml' -or -name '*.yml' | while read filename ; do | ||
# remove any trailing spaces | ||
sed --in-place -e 's/\s*$//' "$filename" | ||
# add a final newline if missing | ||
if [[ -s "$filename" && $(tail -c 1 "$filename" |wc -l) -eq 0 ]] ; then | ||
echo >> "$filename" | ||
fi | ||
# squash superfluous final newlines | ||
sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' "$filename" | ||
done | ||
- name: Report any problems | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
if [ `git status -s | wc -l` -ne 0 ] | ||
then gh pr comment ${{ github.event.number }} --body \ | ||
":red_square: Commit ${{ github.event.pull_request.head.sha }} requires formatting!\ | ||
"$'\n\n'"Required formatting changes summary:\ | ||
"$'\n```\n'"`git diff --stat`"$'\n```' | ||
else gh pr comment ${{ github.event.number }} --body \ | ||
":green_circle: Commit ${{ github.event.pull_request.head.sha }} is formatted properly." | ||
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
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
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.
74bd583
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
74bd583
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/60338
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via: