Intellij checkstyle - setting path relative to the module

前端 未结 2 1187
广开言路
广开言路 2021-01-20 16:20

My company is switching from Eclipse to IntelliJ. In Eclipse we had a following configuration for suppression filters in checkstyle.xml



        
相关标签:
2条回答
  • 2021-01-20 16:57

    The Checkstyle integration in Eclipse is more powerful in some respects than the one in IntelliJ. This is one such case, I believe.

    I would recommend changing the Checkstyle setup so that you have only one Checkstyle configuration and a central suppressions file for all modules. As you will see, modules are more tightly related in IntelliJ than projects are in Eclipse, so this is actually a good idea.

    In order to keep module-specific configuration and/or suppressions, you would have to do the following:

    1. Define all of the module-specific configurations in the central Checkstyle settings (so you have module1-rules, module2-rules etc. in your list).
    2. In each module, select the appropriate configuration from the drop-down box.

    This is quite a lot of work though, so I think you will find centralizing the configuration more convenient. (By the way, here are the supported variables, none of which will help you, I'm afraid.)

    0 讨论(0)
  • 2021-01-20 17:07

    Thanks to Thomas Jensen's answer, I solved my very same problem. I answered in detail in this question. Hope it helps.

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