From c3e502d844bd8316b055fb2e4eb8282cfb44c5ec Mon Sep 17 00:00:00 2001 From: Guo XIn <371864209@qq.com> Date: Sun, 14 Jan 2024 19:07:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=AD=E8=A2=AB=E6=B5=8B=E4=BB=B6=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ pom.xml | 1 - soanr-keyware-example/src/main/cxx/.scannerwork/.sonar_lock | 0 .../src/main/cxx/.scannerwork/class-mapping.csv | 0 .../src/main/cxx/.scannerwork/report-task.txt | 6 ------ uut-example/cxx/README.md | 4 ++++ .../main/cxx => uut-example/cxx/src}/ABCVarNameChecker.cc | 4 ++++ {soanr-keyware-example => uut-example/java}/.gitignore | 0 uut-example/java/README.md | 4 ++++ {soanr-keyware-example => uut-example/java}/pom.xml | 2 +- .../java}/src/main/java/com/keyware/sonar/Main.java | 0 .../java}/src/main/resources/license-header.txt | 0 12 files changed, 16 insertions(+), 8 deletions(-) delete mode 100644 soanr-keyware-example/src/main/cxx/.scannerwork/.sonar_lock delete mode 100644 soanr-keyware-example/src/main/cxx/.scannerwork/class-mapping.csv delete mode 100644 soanr-keyware-example/src/main/cxx/.scannerwork/report-task.txt create mode 100644 uut-example/cxx/README.md rename {soanr-keyware-example/src/main/cxx => uut-example/cxx/src}/ABCVarNameChecker.cc (67%) rename {soanr-keyware-example => uut-example/java}/.gitignore (100%) create mode 100644 uut-example/java/README.md rename {soanr-keyware-example => uut-example/java}/pom.xml (96%) rename {soanr-keyware-example => uut-example/java}/src/main/java/com/keyware/sonar/Main.java (100%) rename {soanr-keyware-example => uut-example/java}/src/main/resources/license-header.txt (100%) diff --git a/.gitignore b/.gitignore index eb2b9fe..117b324 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,6 @@ build/ ### Mac OS ### .DS_Store /*/dependency-reduced-pom.xml + +### Sonarqube ### +.scannerwork/ diff --git a/pom.xml b/pom.xml index d445169..748a6dc 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,6 @@ sonar-keyware-plugins-cxx sonar-keyware-plugins-java - soanr-keyware-example diff --git a/soanr-keyware-example/src/main/cxx/.scannerwork/.sonar_lock b/soanr-keyware-example/src/main/cxx/.scannerwork/.sonar_lock deleted file mode 100644 index e69de29..0000000 diff --git a/soanr-keyware-example/src/main/cxx/.scannerwork/class-mapping.csv b/soanr-keyware-example/src/main/cxx/.scannerwork/class-mapping.csv deleted file mode 100644 index e69de29..0000000 diff --git a/soanr-keyware-example/src/main/cxx/.scannerwork/report-task.txt b/soanr-keyware-example/src/main/cxx/.scannerwork/report-task.txt deleted file mode 100644 index c9190ad..0000000 --- a/soanr-keyware-example/src/main/cxx/.scannerwork/report-task.txt +++ /dev/null @@ -1,6 +0,0 @@ -projectKey=cxx-test -serverUrl=http://localhost:9000 -serverVersion=10.2.1.78527 -dashboardUrl=http://localhost:9000/dashboard?id=cxx-test -ceTaskId=AYz7dGiT3PoYkLIOzDsz -ceTaskUrl=http://localhost:9000/api/ce/task?id=AYz7dGiT3PoYkLIOzDsz diff --git a/uut-example/cxx/README.md b/uut-example/cxx/README.md new file mode 100644 index 0000000..783926c --- /dev/null +++ b/uut-example/cxx/README.md @@ -0,0 +1,4 @@ +```shell +# 执行扫描 +sonar-scanner -Dsonar.projectKey=cxx-test -Dsonar.sources=. -Dsonar.host.url=http://localhost:9000 -Dsonar.token=sqp_3d4a4b9b4d7381682f18250a463f1a789bc9c9bd +``` \ No newline at end of file diff --git a/soanr-keyware-example/src/main/cxx/ABCVarNameChecker.cc b/uut-example/cxx/src/ABCVarNameChecker.cc similarity index 67% rename from soanr-keyware-example/src/main/cxx/ABCVarNameChecker.cc rename to uut-example/cxx/src/ABCVarNameChecker.cc index 3724629..bac6bb5 100644 --- a/soanr-keyware-example/src/main/cxx/ABCVarNameChecker.cc +++ b/uut-example/cxx/src/ABCVarNameChecker.cc @@ -3,4 +3,8 @@ int main(void){ int ABC = 1; // error int abc = 2; return 0; +} + +void func1(){ + // TODO: add more tests } \ No newline at end of file diff --git a/soanr-keyware-example/.gitignore b/uut-example/java/.gitignore similarity index 100% rename from soanr-keyware-example/.gitignore rename to uut-example/java/.gitignore diff --git a/uut-example/java/README.md b/uut-example/java/README.md new file mode 100644 index 0000000..78ad575 --- /dev/null +++ b/uut-example/java/README.md @@ -0,0 +1,4 @@ +```shell +# 执行扫描 + +``` \ No newline at end of file diff --git a/soanr-keyware-example/pom.xml b/uut-example/java/pom.xml similarity index 96% rename from soanr-keyware-example/pom.xml rename to uut-example/java/pom.xml index 517e5da..d791071 100644 --- a/soanr-keyware-example/pom.xml +++ b/uut-example/java/pom.xml @@ -10,7 +10,7 @@ - soanr-keyware-example + uut-example 1.0 diff --git a/soanr-keyware-example/src/main/java/com/keyware/sonar/Main.java b/uut-example/java/src/main/java/com/keyware/sonar/Main.java similarity index 100% rename from soanr-keyware-example/src/main/java/com/keyware/sonar/Main.java rename to uut-example/java/src/main/java/com/keyware/sonar/Main.java diff --git a/soanr-keyware-example/src/main/resources/license-header.txt b/uut-example/java/src/main/resources/license-header.txt similarity index 100% rename from soanr-keyware-example/src/main/resources/license-header.txt rename to uut-example/java/src/main/resources/license-header.txt