From 5816e901f0cdf7cb2c908c0460bc8cc905a0d79d Mon Sep 17 00:00:00 2001 From: Iblis Lin Date: Sun, 13 Jun 2021 10:51:19 +0800 Subject: [PATCH 1/3] GH Action: install Julia formatter action --- .github/workflows/FormatPR.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/FormatPR.yml diff --git a/.github/workflows/FormatPR.yml b/.github/workflows/FormatPR.yml new file mode 100644 index 0000000..5223e7d --- /dev/null +++ b/.github/workflows/FormatPR.yml @@ -0,0 +1,33 @@ +# https://raw.githubusercontent.com/julia-actions/julia-format/master/workflows/format_pr.yml +name: FormatPR + +on: + schedule: + - cron: '0 0 * * *' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install JuliaFormatter and format + run: | + julia -e 'import Pkg; Pkg.add("JuliaFormatter")' + julia -e 'using JuliaFormatter; format(".")' + + # https://github.com/marketplace/actions/create-pull-request + # https://github.com/peter-evans/create-pull-request#reference-example + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Format .jl files + title: 'Automatic JuliaFormatter.jl run' + branch: auto-juliaformatter-pr + delete-branch: true + labels: formatting, automated pr, no changelog + - name: Check outputs + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" From 140bb19f2e8472c4fa07550c1b8e064b64cf4064 Mon Sep 17 00:00:00 2001 From: Iblis Lin Date: Sun, 13 Jun 2021 11:18:31 +0800 Subject: [PATCH 2/3] add .JuliaFormatter.toml --- .JuliaFormatter.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .JuliaFormatter.toml diff --git a/.JuliaFormatter.toml b/.JuliaFormatter.toml new file mode 100644 index 0000000..b14ce4f --- /dev/null +++ b/.JuliaFormatter.toml @@ -0,0 +1,3 @@ +margin = 100 +whitespace_in_kwargs = false +always_for_in = true From 39ecd192430f026afc85274ab519dc5eb5abf132 Mon Sep 17 00:00:00 2001 From: Iblis Lin Date: Sun, 13 Jun 2021 11:25:02 +0800 Subject: [PATCH 3/3] alignment --- .JuliaFormatter.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.JuliaFormatter.toml b/.JuliaFormatter.toml index b14ce4f..89c5fb9 100644 --- a/.JuliaFormatter.toml +++ b/.JuliaFormatter.toml @@ -1,3 +1,7 @@ margin = 100 whitespace_in_kwargs = false always_for_in = true +align_assignment = true +align_conditional = true +align_pair_arrow = true +align_struct_field = true