在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):SonarSource/sonar-kotlin开源软件地址(OpenSource Url):https://github.com/SonarSource/sonar-kotlin开源编程语言(OpenSource Language):Kotlin 78.5%开源软件介绍(OpenSource Introduction):Code Quality and Security for KotlinThis SonarSource project is a code analyzer for Kotlin projects. Features
Useful linksBuildBuild and run Unit Tests:
Integration TestsBy default, Integration Tests (ITs) are skipped during the build. If you want to run them, you need first to retrieve the related projects which are used as input:
Then you need to switch to Java8 and run the command to generate binaries for Ktor project:
Then build and run the Integration Tests using the
You can also build and run only Ruling Tests using the
You can also build and run only Plugin Tests using the
To run e.g. the ruling tests in the IDE, create a new Run/Debug Configuration where you run the following:
You can also run single ruling tests, e.g.:
Debugging ruling testsYou can debug the scanner when running ruling tests. As a new JVM is spawned to run the analysis you can't simply click 'debug' on a ruling test, however. You need to tell the Sonar Scanner (which is being used to run the analysis in the background) to launch a debuggable JVM. Then you can attach to this JVM instance and debug as normal via your IDE. The ruling test already provides a convenient API where all you need to do is supply the port you want to debug on (e.g. 5005)
to
You can obviously do the same in the IDE and/or only run a particular test:
Utilities and DevelopingGenerating/downloading rule metadataThe Gradle task For example, execute the following in the project root to fetch the metadata for rule
If you want to update all rules' metadata, you can use:
Implementing a new ruleThe Gradle task To use this task, you need to know the rule key and a fitting name for the check class. For instance, if you want to implement the new
rule
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论