File tree Expand file tree Collapse file tree 6 files changed +56
-5
lines changed
api/src/main/java/com/javadiscord/jdi/core/api
example/lj-discord-bot/src/main/java/com/javadiscord/bot/utils/chatgpt Expand file tree Collapse file tree 6 files changed +56
-5
lines changed Original file line number Diff line number Diff line change
1
+ name : Qodana
2
+ on :
3
+ workflow_dispatch :
4
+ pull_request :
5
+ push :
6
+ branches :
7
+ - main
8
+ - slash-commands
9
+
10
+ jobs :
11
+ qodana :
12
+ runs-on : ubuntu-latest
13
+ steps :
14
+ - uses : actions/checkout@v3
15
+ with :
16
+ fetch-depth : 0
17
+ - name : ' Qodana Scan'
18
+ uses : JetBrains/qodana-action@v2024.1
19
+ env :
20
+ QODANA_TOKEN : ${{ secrets.QODANA_TOKEN }}
Original file line number Diff line number Diff line change 2
2
3
3
import java .util .List ;
4
4
5
+ import com .javadiscord .jdi .core .api .builders .CreateAutoModerationRuleBuilder ;
5
6
import com .javadiscord .jdi .core .api .builders .ModifyAutoModerationRuleBuilder ;
6
7
import com .javadiscord .jdi .core .models .auto_moderation .AutoModerationRule ;
7
- import com .javadiscord .jdi .core .request .builders .CreateAutoModerationRuleBuilder ;
8
8
import com .javadiscord .jdi .internal .api .auto_moderation .*;
9
9
10
10
public class AutoModerationRequest {
Original file line number Diff line number Diff line change 1
- package com .javadiscord .jdi .core .request .builders ;
1
+ package com .javadiscord .jdi .core .api .builders ;
2
2
3
3
import java .util .List ;
4
4
import java .util .Optional ;
Original file line number Diff line number Diff line change @@ -104,9 +104,9 @@ public Optional<String[]> ask(String question) {
104
104
openAiHttpException .statusCode
105
105
)
106
106
);
107
- } catch (RuntimeException runtimeException ) {
107
+ } catch (RuntimeException e ) {
108
108
logger .warn (
109
- "There was an error using the OpenAI API: " + runtimeException .getMessage ()
109
+ "There was an error using the OpenAI API: {}" , e .getMessage ()
110
110
);
111
111
}
112
112
return Optional .empty ();
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ private ChatGPTResponseParser() {}
15
15
public static String [] parse (String response ) {
16
16
String [] partedResponse = new String [] {response };
17
17
if (response .length () > RESPONSE_LENGTH_LIMIT ) {
18
- logger .debug ("Response to parse:\n " + response );
18
+ logger .debug ("Response to parse:\n {}" , response );
19
19
partedResponse = partitionAiResponse (response );
20
20
}
21
21
return partedResponse ;
Original file line number Diff line number Diff line change
1
+ # -------------------------------------------------------------------------------#
2
+ # Qodana analysis is configured by qodana.yaml file #
3
+ # https://www.jetbrains.com/help/qodana/qodana-yaml.html #
4
+ # -------------------------------------------------------------------------------#
5
+ version : " 1.0"
6
+
7
+ # Specify inspection profile for code analysis
8
+ profile :
9
+ name : qodana.starter
10
+
11
+ # Enable inspections
12
+ # include:
13
+ # - name: <SomeEnabledInspectionId>
14
+
15
+ # Disable inspections
16
+ # exclude:
17
+ # - name: <SomeDisabledInspectionId>
18
+ # paths:
19
+ # - <path/where/not/run/inspection>
20
+
21
+ projectJDK : 21 # (Applied in CI/CD pipeline)
22
+
23
+ # Execute shell command before Qodana execution (Applied in CI/CD pipeline)
24
+ # bootstrap: sh ./prepare-qodana.sh
25
+
26
+ # Install IDE plugins before Qodana execution (Applied in CI/CD pipeline)
27
+ # plugins:
28
+ # - id: <plugin.id> #(plugin id can be found at https://plugins.jetbrains.com)
29
+
30
+ # Specify Qodana linter for analysis (Applied in CI/CD pipeline)
31
+ linter : jetbrains/qodana-jvm:latest
You can’t perform that action at this time.
0 commit comments