SonarQube Plugins
  1. SonarQube Plugins
  2. SONARPLUGINS-2482

Rule: When there is a parsing error, this error should be added like a violation on that Erlang file

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: ERLANG-0.1
    • Component/s: Erlang
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Name: Erlang parser failure

      Description:

      <p>
      When the Erlang parser fails, it is possible to record the failure as a violation on the file.
      This way, not only it is possible to track the number of files that do not parse but also to easily find out why they do not parse.
      </p>
      

      Should be disabled in default profile.

        Issue Links

          Activity

          Hide
          Tamas Kende added a comment -

          How can I do this?

          Show
          Tamas Kende added a comment - How can I do this?
          Show
          Evgeny Mandrikov added a comment - For example see https://github.com/SonarCommunity/sonar-javascript/blob/master/javascript-checks/src/main/java/org/sonar/javascript/checks/ParsingErrorCheck.java
          Hide
          Tamas Kende added a comment -

          I do not know what went wrong, but it does not work for me... Can you check it? I did exactly the same as what the JS plugin has, but the methods of the checker are not triggered. (ParsingErrorCheck.class)

          Show
          Tamas Kende added a comment - I do not know what went wrong, but it does not work for me... Can you check it? I did exactly the same as what the JS plugin has, but the methods of the checker are not triggered. (ParsingErrorCheck.class)
          Hide
          Evgeny Mandrikov added a comment -

          This doesn't work because in some visitors you assume that file is always parsed. For example in PublicDocumentedApiCounter method visitFile will be called with null argument, when file can't be parsed, which leads to NPE.

          Show
          Evgeny Mandrikov added a comment - This doesn't work because in some visitors you assume that file is always parsed. For example in PublicDocumentedApiCounter method visitFile will be called with null argument, when file can't be parsed, which leads to NPE.
          Hide
          Tamas Kende added a comment -

          Thanks Evgeny for your help, the problem is fixed.

          Show
          Tamas Kende added a comment - Thanks Evgeny for your help, the problem is fixed.
          Show
          Evgeny Mandrikov added a comment - To finally fix this I did two commits: https://github.com/SonarCommunity/sonar-erlang/commit/1a7ad64af59503368918afa61ace2464ed9c6317 and https://github.com/SonarCommunity/sonar-erlang/commit/4583cf474be2f8e18fdaba64dd6d7edf6954b6bf Hope problem will not be reintroduced again.

            People

            • Assignee:
              Tamas Kende
              Reporter:
              Evgeny Mandrikov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: