Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

Last modified 11 years ago

#418 closed defect (fixed)

Pylint output show wrong nodes for files

Reported by: anonymous Owned by: osimons
Priority: minor Milestone: 0.6
Component: General Version: dev
Keywords: Cc:
Operating System: BSD

Description

With Bitten r

How to reprodruce

Use this recipe :

  <step id="Checkout" description="Get source code from svn">
    <sh:exec executable="svn" args="co http://bitten.edgewall.org/svn/${path} . -r ${revision} --quiet"/>
  </step>
  <step id="Pylint" description="Pylint check" onerror="ignore">
    <sh:exec executable="pylint" args="--rcfile=pylint.rc bitten" output="build/pylint-results.out"/>
    <python:pylint file="build/pylint-results.out"/>
  </step>

This steeps works perfectly for me and i am able to see logs results and the "Code Lint" report.

The logs resuslt are perfects and clicikng on the file links display tehm correctly in Trac. But in the Code Lint report the file links are incorrects as they are mixed with local file system directories of the bitten-slave.

Exemple in log :
project/controllers/help.py:1: link correctly to the file in Trac source browser.

Same file in Code Lint result :
/home/bertrand/Mydocuments/Developpement/project/controllers/help.py link to an incorrect node because /home/bertrand/Mydocuments/Developpement/ are direcories from my slave filesystem.

PS : Just note than i use a pylint.rc file than is get from the svn project, but i do not think it's in cause.

Attachments (1)

t418-lint_filenames-r667.diff (3.7 KB) - added by osimons 15 years ago.
Roughly same patch - but with tests to prove it :-)

Download all attachments as: .zip

Change History (4)

comment:1 Changed 15 years ago by osimons

  • Owner set to osimons

Yup. Confirmed. I'll look into it.

comment:2 Changed 15 years ago by osimons

This makes it work for me on Windows and OSX at least - please test:

  • bitten/build/pythontools.py

    a b  
    152152                    category = msg_categories.get(msg_type[0])
    153153                    if len(msg_type) == 1:
    154154                        msg_type = None
    155                     filename = os.path.realpath(match.group('file'))
    156                     if filename.startswith(ctxt.basedir):
     155                    filename = match.group('file')
     156                    if os.path.isabs(filename) \
     157                            and filename.startswith(ctxt.basedir):
    157158                        filename = filename[len(ctxt.basedir) + 1:]
    158159                    filename = filename.replace(os.sep, '/')
    159160                    lineno = int(match.group('line'))

Changed 15 years ago by osimons

Roughly same patch - but with tests to prove it :-)

comment:3 Changed 15 years ago by osimons

  • Resolution set to fixed
  • Status changed from new to closed

Last patch committed in [669].

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.