From d26497ced250126e359e7742e3e5d892e2438c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ljubo=20Nikoli=C4=87?= Date: Wed, 9 Aug 2023 17:56:46 +0200 Subject: [PATCH 1/3] enable linter --- .github/workflows/ci.yml | 8 +++++++- .github/workflows/linter.yml | 27 +++++++++++++++++++++++++++ .scalafmt.conf | 6 ++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/linter.yml create mode 100644 .scalafmt.conf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2069e73f..7e9007b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,15 +23,21 @@ jobs: name: Event File path: ${{ github.event_path }} + lint: + name: "Run linter" + uses: "./.github/workflows/linter.yml" + build-jvm: name: "Build JVM" + needs: lint uses: "./.github/workflows/build-jvm.yml" build-snapshots: name: "Build Snapshots" + needs: lint uses: "./.github/workflows/build-snapshots.yml" build-python: name: "Build Python" - needs: build-jvm + needs: [build-jvm,lint] uses: "./.github/workflows/build-python.yml" test-jvm: diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 00000000..9f40c0e9 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,27 @@ +name: Lint + +on: + workflow_call: + +env: + SCALAFMT_VERSION: 3.7.14 + +jobs: + test: + name: Lint + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install scalafmt directly + run: | + wget -O scalafmt https://github.com/scalameta/scalafmt/releases/download/v$SCALAFMT_VERSION/scalafmt-linux-glibc + chmod +x scalafmt + sudo mv scalafmt /usr/local/bin + scalafmt -version + + - name: Lint - Scala + run: scalafmt --test + shell: bash diff --git a/.scalafmt.conf b/.scalafmt.conf new file mode 100644 index 00000000..e7574540 --- /dev/null +++ b/.scalafmt.conf @@ -0,0 +1,6 @@ +version = 3.7.14 + +runner.dialect = scala213 + +maxColumn = 120 + From 2c05058beca5139bf97a7ac5f2cca1db998e1ba3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ljubo=20Nikoli=C4=87?= Date: Sat, 21 Oct 2023 00:13:52 +0200 Subject: [PATCH 2/3] resolve comments --- .github/workflows/ci.yml | 11 ++++++++--- .github/workflows/linter.yml | 27 --------------------------- .scalafmt.conf | 1 + 3 files changed, 9 insertions(+), 30 deletions(-) delete mode 100644 .github/workflows/linter.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e9007b2..da943492 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,13 @@ jobs: path: ${{ github.event_path }} lint: - name: "Run linter" - uses: "./.github/workflows/linter.yml" + name: "Linting" + runs-on: ubuntu-latest + steps: + - uses: jrouly/scalafmt-native-action@v2 + with: + version: '3.7.14' + arguments: '--test' build-jvm: name: "Build JVM" @@ -37,7 +42,7 @@ jobs: uses: "./.github/workflows/build-snapshots.yml" build-python: name: "Build Python" - needs: [build-jvm,lint] + needs: [build-jvm, lint] uses: "./.github/workflows/build-python.yml" test-jvm: diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml deleted file mode 100644 index 9f40c0e9..00000000 --- a/.github/workflows/linter.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Lint - -on: - workflow_call: - -env: - SCALAFMT_VERSION: 3.7.14 - -jobs: - test: - name: Lint - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install scalafmt directly - run: | - wget -O scalafmt https://github.com/scalameta/scalafmt/releases/download/v$SCALAFMT_VERSION/scalafmt-linux-glibc - chmod +x scalafmt - sudo mv scalafmt /usr/local/bin - scalafmt -version - - - name: Lint - Scala - run: scalafmt --test - shell: bash diff --git a/.scalafmt.conf b/.scalafmt.conf index e7574540..79ec502a 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,6 +1,7 @@ version = 3.7.14 runner.dialect = scala213 + rewrite.trailingCommas.style = keep maxColumn = 120 From 431672670ed8d77c666b41015ce198a6a334debe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ljubo=20Nikoli=C4=87?= Date: Thu, 30 Nov 2023 15:54:01 +0100 Subject: [PATCH 3/3] adopt comments --- .github/workflows/ci.yml | 3 +++ .scalafmt.conf | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da943492..8a63e5b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,9 @@ jobs: name: "Linting" runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: jrouly/scalafmt-native-action@v2 with: version: '3.7.14' diff --git a/.scalafmt.conf b/.scalafmt.conf index 79ec502a..67ab917f 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,7 +1,7 @@ version = 3.7.14 runner.dialect = scala213 - rewrite.trailingCommas.style = keep +rewrite.trailingCommas.style = keep maxColumn = 120