From e52e1c3e18893bdff5543cb27602bdc521fbdd53 Mon Sep 17 00:00:00 2001 From: ben reed Date: Tue, 14 May 2024 01:09:14 -0700 Subject: [PATCH] add intellij reformatter on pull requests --- .github/workflows/reformat.yml | 33 +++++++++++++++++++ .idea/codeStyles/Project.xml | 10 ++++-- .../server/controller/TimelineController.java | 11 ++++--- 3 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/reformat.yml diff --git a/.github/workflows/reformat.yml b/.github/workflows/reformat.yml new file mode 100644 index 00000000..416c484a --- /dev/null +++ b/.github/workflows/reformat.yml @@ -0,0 +1,33 @@ +name: Re-format Code + +on: + pull_request: + branches: + - main + +jobs: + format: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + + - name: Install IntelliJ IDEA + run: | + wget -q -O idea.tar.gz https://download.jetbrains.com/idea/ideaIC-2024.1.1.tar.gz + tar -xzf idea.tar.gz + + - name: Format code + run: | + ./*/bin/format.sh -m *.java -r . + + - name: Commit changes + run: | + git config user.name 'github-actions[bot]' + git config user.email "github-actions[bot]@users.noreply.github.com + git commit -a -m "Auto-format code" + git push + diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index 92162015..dccf94fa 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -11,16 +11,22 @@