Skip to content

Commit 686d0bd

Browse files
committed
style: Configure Spotless formatter (#45)
1 parent 25e3b5a commit 686d0bd

30 files changed

+5409
-5488
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img height="120" src="https://github.com/qdrant/qdrant/raw/master/docs/logo.svg" alt="Qdrant">
2+
<img height="120" src="https://github.com/qdrant/qdrant/raw/master/docs/logo.svg" alt="Qdrant">
33
&nbsp;
44
<img height="150" width="100" src="./resources/java-logo-small.svg" alt="Java">
55

@@ -34,22 +34,25 @@ To install the library, add the following lines to your build config file.
3434
<dependency>
3535
<groupId>io.qdrant</groupId>
3636
<artifactId>client</artifactId>
37-
<version>1.9.0</version>
37+
<version>1.10.0</version>
3838
</dependency>
3939
```
4040

4141
#### SBT
4242

4343
```sbt
44-
libraryDependencies += "io.qdrant" % "client" % "1.9.0"
44+
libraryDependencies += "io.qdrant" % "client" % "1.10.0"
4545
```
4646

4747
#### Gradle
4848

4949
```gradle
50-
implementation 'io.qdrant:client:1.9.0'
50+
implementation 'io.qdrant:client:1.10.0'
5151
```
5252

53+
> [!NOTE]
54+
> Please make sure to include all necessary dependencies listed [here](https://central.sonatype.com/artifact/io.qdrant/client/dependencies) in your project.
55+
5356
## 📖 Documentation
5457

5558
- [JavaDoc Reference](https://qdrant.github.io/java-client/)
@@ -65,7 +68,8 @@ A client can be instantiated with
6568
QdrantClient client =
6669
new QdrantClient(QdrantGrpcClient.newBuilder("localhost").build());
6770
```
68-
which creates a client that will connect to Qdrant on https://localhost:6334.
71+
72+
which creates a client that will connect to Qdrant on <https://localhost:6334>.
6973

7074
Internally, the high level client uses a low level gRPC client to interact with
7175
Qdrant. Additional constructor overloads provide more control over how the gRPC

build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ plugins {
2121
id 'com.google.protobuf' version '0.9.4'
2222
id 'net.ltgt.errorprone' version '3.1.0'
2323
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
24+
id 'com.diffplug.spotless' version '6.22.0'
2425
}
2526

2627
group = 'io.qdrant'
@@ -250,3 +251,16 @@ signing {
250251
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
251252
sign publishing.publications.mavenJava
252253
}
254+
255+
spotless {
256+
java {
257+
target 'src/*/java/**/*.java'
258+
importOrder()
259+
removeUnusedImports()
260+
cleanthat()
261+
googleJavaFormat()
262+
formatAnnotations()
263+
}
264+
}
265+
266+
compileJava.dependsOn 'spotlessApply'

gradle.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ qdrantProtosVersion=v1.10.0
55
qdrantVersion=v1.10.0
66

77
# The version of the client to generate
8-
packageVersion=1.10.0
8+
packageVersion=1.10.0
9+
10+
## Extension of the default memory config for the spotless formatter plugin
11+
org.gradle.jvmargs= -Xmx2000m "-XX:MaxMetaspaceSize=1000m"
Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
package io.qdrant.client;
22

3-
import java.util.concurrent.Executor;
4-
53
import io.grpc.CallCredentials;
64
import io.grpc.Metadata;
75
import io.grpc.Status;
6+
import java.util.concurrent.Executor;
87

9-
/**
10-
* API key authentication credentials
11-
*/
8+
/** API key authentication credentials */
129
public class ApiKeyCredentials extends CallCredentials {
13-
private final String apiKey;
10+
private final String apiKey;
1411

15-
/**
16-
* Instantiates a new instance of {@link ApiKeyCredentials}
17-
* @param apiKey The API key to use for authentication
18-
*/
19-
public ApiKeyCredentials(String apiKey) {
20-
this.apiKey = apiKey;
21-
}
12+
/**
13+
* Instantiates a new instance of {@link ApiKeyCredentials}
14+
*
15+
* @param apiKey The API key to use for authentication
16+
*/
17+
public ApiKeyCredentials(String apiKey) {
18+
this.apiKey = apiKey;
19+
}
2220

23-
@Override
24-
public void applyRequestMetadata(RequestInfo requestInfo, Executor appExecutor, MetadataApplier applier) {
25-
appExecutor.execute(() -> {
26-
try {
27-
Metadata headers = new Metadata();
28-
headers.put(Metadata.Key.of("api-key", Metadata.ASCII_STRING_MARSHALLER), apiKey);
29-
applier.apply(headers);
30-
} catch (Throwable e) {
31-
applier.fail(Status.UNAUTHENTICATED.withCause(e));
32-
}
21+
@Override
22+
public void applyRequestMetadata(
23+
RequestInfo requestInfo, Executor appExecutor, MetadataApplier applier) {
24+
appExecutor.execute(
25+
() -> {
26+
try {
27+
Metadata headers = new Metadata();
28+
headers.put(Metadata.Key.of("api-key", Metadata.ASCII_STRING_MARSHALLER), apiKey);
29+
applier.apply(headers);
30+
} catch (Throwable e) {
31+
applier.fail(Status.UNAUTHENTICATED.withCause(e));
32+
}
3333
});
34-
}
34+
}
3535
}

0 commit comments

Comments
 (0)