SonarQube Java
  1. SonarQube Java
  2. SONARJAVA-36

CheckstyleProfileImporter should support inheritance of properties

    Details

    • Number of attachments :
      0

      Description

      When creating a new Quality Profile using an existing Checkstyle Config the severity property is not inherited by sub modules, even though it should as specified in [1].

      I would like to import the following checkstyle config and have UnusedImports pop up as Warning:

      <module name="Checker">
        <property name="severity" value="warning"/>
        <module name="TreeWalker">
          <module name="UnusedImports"/>
        </module>
      </module>
      

      But as the severity is not inherited it will pop up as info.
      To work around this the config has to be adapted to look like this:

      <module name="Checker">
        <property name="severity" value="warning"/>
        <module name="TreeWalker">
          <property name="severity" value="warning"/>
          <module name="UnusedImports">
            <property name="severity" value="warning"/>
          </module>
        </module>
      </module>
      

      This is very unDRY. Please fix this.

      [1] Properties should be inherited in the Module hierarchy - http://checkstyle.sourceforge.net/config.html#Properties

        Activity

        Hide
        Evgeny Mandrikov added a comment -

        In fact this is not only about inheritance of severity, but about inheritance of all properties.

        Show
        Evgeny Mandrikov added a comment - In fact this is not only about inheritance of severity, but about inheritance of all properties.
        Hide
        Freddy Mallet added a comment -

        Manually tested!

        Show
        Freddy Mallet added a comment - Manually tested!

          People

          • Assignee:
            Evgeny Mandrikov
            Reporter:
            Jacques Stadler
          • Votes:
            7 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: