Skip to content

Commit 8d1a5e3

Browse files
author
Manuel Stöger
committed
#383: Added formatter/linter
1 parent 627d95e commit 8d1a5e3

File tree

4 files changed

+55
-2
lines changed

4 files changed

+55
-2
lines changed

.github/workflows/backend-fast.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,38 @@ env:
1717
WD: binocular-backend-new
1818

1919
jobs:
20+
lint:
21+
strategy:
22+
fail-fast: true
23+
matrix:
24+
os: [ ubuntu-latest ]
25+
java_version: [ '23' ]
26+
distribution: [ 'temurin' ]
27+
runs-on: ${{ matrix.os }}
28+
defaults:
29+
run:
30+
working-directory: ${{ env.WD }}
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v4
35+
36+
- name: Setup (cache/java/go-offline)
37+
uses: ./.github/actions/java-maven-setup
38+
with:
39+
java-version: ${{ matrix.java_version }}
40+
distribution: ${{ matrix.distribution }}
41+
working-directory: ${{ env.WD }}
42+
checkout-depth: 1
43+
44+
- name: Validate
45+
run: mvn $MAVEN_CLI_OPTS ktlint:check
46+
2047
# Merged: validate + compile-sources + compile-tests
2148
preflight:
2249
name: Preflight (validate + compile + test-compile)
50+
needs:
51+
- lint
2352
strategy:
2453
fail-fast: true
2554
matrix:

binocular-backend-new/.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ ij_kotlin_name_count_to_use_star_import = 2147483647
1212
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
1313
ij_kotlin_packages_to_use_import_on_demand = unset
1414

15-
[ffi/src/main/kotlin/com/inso_world/binocular/internal/binocular_ffi.kt]
16-
ktlint = disabled
15+
[ffi/src/main/kotlin/com/inso_world/binocular/ffi/internal/gix_binocular.kt]
16+
ktlint = disabled

binocular-backend-new/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Binocular Backend
22

33
## Requirements
4+
- Install `ktlint`: https://pinterest.github.io/ktlint/latest/quick-start/.
5+
- Maven plugin reference: https://gantsign.com/ktlint-maven-plugin/plugin-info.html
6+
- Use `mvn ktlint:check` to check for errors
7+
- Use `mvn ktlint:format` to automatically fixes violations of the code style (when possible)
48
- Docker running in the background, otherwise tests will fail (tests in `infrastructure-sql/arangodb/tests` use TestContainers internally)
59

610
© INSO/BUSY 09/2025

binocular-backend-new/pom.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
<module>jgit</module>
7272
<module>integration-test/vcs-indexer</module>
7373
</modules>
74+
7475
<dependencyManagement>
7576
<!--
7677
Dependency management is a mechanism for centralizing the dependency information
@@ -221,8 +222,22 @@
221222
</avoidCallsTo>
222223
</configuration>
223224
</plugin>
225+
<plugin>
226+
<groupId>com.github.gantsign.maven</groupId>
227+
<artifactId>ktlint-maven-plugin</artifactId>
228+
<version>3.5.0</version>
229+
</plugin>
224230
</plugins>
225231
</pluginManagement>
232+
233+
<!-- To use the plugin goals in your POM or parent POM -->
234+
<plugins>
235+
<plugin>
236+
<groupId>com.github.gantsign.maven</groupId>
237+
<artifactId>ktlint-maven-plugin</artifactId>
238+
<version>3.5.0</version>
239+
</plugin>
240+
</plugins>
226241
</build>
227242

228243
<reporting>
@@ -235,6 +250,11 @@
235250
<aggregate>true</aggregate>
236251
</configuration>
237252
</plugin>
253+
<plugin>
254+
<groupId>com.github.gantsign.maven</groupId>
255+
<artifactId>ktlint-maven-plugin</artifactId>
256+
<version>3.5.0</version>
257+
</plugin>
238258
</plugins>
239259
</reporting>
240260

0 commit comments

Comments
 (0)