https://bugs.kde.org/show_bug.cgi?id=451978

            Bug ID: 451978
           Summary: Kate Build plugin does not recognize pylint command
                    output
           Product: kate
           Version: 20.12.2
          Platform: Debian stable
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: application
          Assignee: kwrite-bugs-n...@kde.org
          Reporter: fores...@sonic.net
  Target Milestone: ---

SUMMARY

Python programmers often run pylint to quickly find code defects. When pylint
is used as a build command in Kate, the output is excluded from Kate's parsed
output window. It is visible only by manually selecting the Full Output filter
every time the command is run, which is not very useful, because warnings and
errors are not flagged, and clicking on them does not navigate to the line
where the problem was found, and the next/previous error shortcuts do not work.

Pylint's output looks like this:

    ************* Module myfile
    /path/to/myfile:12:0: R0903: Too few public methods (1/2)
(too-few-public-methods)
    /path/to/myfile:345:0: R0903: Too few public methods (1/2)
(too-few-public-methods)

    ------------------------------------------------------------------
    Your code has been rated at 9.88/10 (previous run: 9.88/10, +0.00)

The first space-delimited field of each warning/error line follows the format
used by many C compilers: a colon-separated file path, line number, and column
number. This makes it fairly easy for code editors to support. (Geany handles
it nicely, for example.)

The second field is a pylint message ID: A single capital letter followed by
four numeric digits, then a colon. In regex: "^[CRWEF]\\d\\d\\d\\d:" Those
letters indicate the message type: Convention, Refactor, Warning, Error, Fatal

After that field is a human-readable message description.

Subtleties:
Pylint uses zero-based column numbers, while Kate seems to assume one-based
column numbers.
Pylint's output is on stdout, while Kate seems to assume errors and warnings
will appear on stderr.

STEPS TO REPRODUCE
1. Make "pylint %f" a build command in a Kate project.
2. Open a python file with some defects that pylint will detect.
3. Run the build command .

OBSERVED RESULT

No pylint output appears in Kate's output tab. Changing to tab's filter to
"Full Output" reveals the pylint output, but it is just raw text. No
distinction is made between errors, warnings, and misc. messages. Clicking the
messages does not navigate to the relevant line of the python file.

EXPECTED RESULT

Pylint output should be parsed and clickable to navigate to the referenced
line, and should respond to the Next Error / Previous Error shortcuts, just
like any other compiler-style output. Ideally, it should also work with Kate's
Errors/Warnings/Parsed Output filter.

SOFTWARE/OS VERSIONS
Linux Version: 5.16.0
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to