简体   繁体   English

在Coffeescript编译的JS上使用SonnarQube的相关性

[英]Relevance of using SonnarQube on coffeescript compiled JS

I m actually developping an application using coffeescript to transpile into javascript. 我实际上是在开发使用coffeescript转换为javascript的应用程序。

I was wondering if it's relevant to use SonnarQube to check generated javascript and to check unit test coverage % ? 我想知道使用SonnarQube检查生成的javascript和检查单元测试覆盖率%是否相关?

Because when running sonar-runner on my ./app folder (the folder with the generated javascript), I have some errors and I can't do anything on these files. 因为在./app文件夹(带有生成的javascript的文件夹)上运行sonar-runner时,出现了一些错误,并且我无法对这些文件执行任何操作。

Here's are some errors (due to coffeescript transpiling) : 这是一些错误(由于翻译了coffeescript):

在此处输入图片说明

Thanks for advance 谢谢前进

You could get away with some or all of the issues in your transpiled files by setting up some exclusion rules . 通过设置一些排除规则 ,您可以解决转码文件中的部分或全部问题。

For instance, you can use a file pattern of app/**/*.js with a rule pattern of * , which will get rid of all issues on your transpiled files in the app/ folder. 例如,您可以使用app/**/*.js 。js的文件模式以及*的规则模式,这将消除app/文件夹中已转码文件的所有问题。

Now, if you only want coverage on your CoffeeScript code, you can have a look at the generic coverage plugin , in conjunction with the sonar.import_unknown_files property - although this could generate some noise, depending on the types of files you have in your source tree. 现在,如果您只想覆盖CoffeeScript代码,则可以结合使用sonar.import_unknown_files属性来查看通用的coverage插件 -尽管这可能会产生一些干扰,具体取决于源中文件的类型树。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM