Checkstyle equivalent for JSPs?

前端 未结 2 1499
隐瞒了意图╮
隐瞒了意图╮ 2021-01-18 18:35

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 pos

相关标签:
2条回答
  • 2021-01-18 18:59

    PMD supports checking of JSP files as well. There are very few rules though. I haven't used it extensively. Feel free to try it out.

    0 讨论(0)
  • 2021-01-18 19:14

    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).

    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).

    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)

    0 讨论(0)
提交回复
热议问题