Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-70547

flake8 parser complains about empty file if no violations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • warnings-ng-plugin
    • None
    • Jenkins: 2.388
      OS: OpenSUSE Leap 15.4
      warnings-ng: 9.23.0

      I am running flake8 as part of my pipeline. There are no violations, so the log file is empty.

      When calling `recordIssues` on the file, Jenkins reports two errors about the file being empty (which is the default if no violations occur):

      Errors during parsing
      Skipping file 'flake8.log' because it's empty
      Errors during parsing
      Skipping file 'flake8.log' because it's empty

       
      I could not identify a usable (non-hacky) way to disable this warning, probably originating from https://github.com/jenkinsci/warnings-ng-plugin/blob/250c0d7ce19c273ff011690b783baa543e93b146/plugin/src/main/java/io/jenkins/plugins/analysis/core/model/FilesScanner.java#L89
       
      Relevant call in pipeline after generating the actual linting report:
       

      recordIssues(tools: [flake8(pattern: 'flake8.log')])

       
      These errors should not occur or a clean solution should be available/documented.

            drulli Ulli Hafner
            stefan6419846 Stefan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: