added rule with parentheses to UnitAtom #96
Workflow file for this run
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
# https://qiita.com/__snow_rabbit__/items/9df812e8977bc0f1786f | |
name: Reformat Java source code | |
on: | |
pull_request: | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
# Pull Requestされたブランチをチェックアウト | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.head_ref }} | |
# Java のセットアップ | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
# Gitの設定 | |
- name: Git settings | |
run: | | |
# Git リポジトリの設定 | |
git config --local user.name "lang" | |
git config --local user.email "[email protected]" | |
# コードフォーマットの実行(※1) | |
- name: Code format | |
run: | | |
shopt -s globstar | |
wget -q -O google-java-format.jar \ | |
https://github.com/google/google-java-format/releases/download/v1.15.0/google-java-format-1.15.0-all-deps.jar | |
java -jar google-java-format.jar --replace --skip-javadoc-formatting src/**/*.java | |
# 上の例ではすべての変更に対してフォーマッタを加えております。 | |
# プルリクエスト時の変更を取る場合はgit log | |
# で変更差分のみ取得してフォーマッタをかけましょう。(※2) | |
# 変更確認 | |
- name: Check for modified files | |
id: git-check | |
run: echo ::set-output name=modified::$(if git diff --quiet HEAD --; then echo "false"; else echo "true"; fi) | |
# 変更されていた場合、コミット・プッシュを行う(※3) | |
- name: Push | |
if: steps.git-check.outputs.modified == 'true' | |
run: | | |
git commit -am "Automated: Reformat Java source code." | |
git push |