JSP的Checkstyle等效? [英] Checkstyle equivalent for JSPs?

查看:218
本文介绍了JSP的Checkstyle等效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么工具可以为JSP文件做什么checkstyle为Java文件?
理想的情况是在checkstyle上包含JSP检查,但是据我所见,这是不可能的。

Is there any tool to do for JSP files what checkstyle does for Java files? The ideal would be to include JSP checking on checkstyle, but as far as I can see, this isn't possible.

我想例如检查JSP文件:

I would like for example to check JSP files for :


  • 缩进样式

  • 某些结构的正确展示位置

  • 标签/空格检查

  • 检查是否使用了小片

  • Indentation style
  • Right placements of certain constructs
  • Tab / space check
  • Check for use of scriplets


Emerson

Thanks Emerson

推荐答案

是的,有类似的东西(但不是那些检查):你可以使用IntelliJ IDEA 检查功能检查JSPs的各种问题,这些检查可以从命令行运行(使用inspect.bat在IntelliJ的/ bin目录)。

Yes, there is something similar (but not for exactly those checks): You can use IntelliJ IDEA's "Inspection" functionality to inspect JSPs for various problems, and those inspections can be run from the command line too (use inspect.bat in IntelliJ's /bin directory).

这将需要创建一个配置文件只包括所需的JSP检查,从IDE(分析/检查代码)测试,如果他们是OK,从命令行运行它们(例如,你的构建工具)。

For this you will need to create a "profile" to include only the desired JSP inspections, test it from the IDE (Analyze/Inspect Code), and if they're OK, run them from the command line too (and e.g. call them from your build tool).

根据这些现有的JSP检查,你可以编写其他检查(但这需要一点技能,因为没有良好的文档,只是IntelliJ插件的源代码和支持论坛)

Based on those existing JSP inspections, than you could write other inspections too (but this require a little more skill since there's no good documentation for this - just the source code of IntelliJ plug-ins and the support forums)

这篇关于JSP的Checkstyle等效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆