[ANN] pylint-0.2

Discussion in 'Python' started by Alexandre Fayolle, Sep 26, 2003.

  1. Logilab has released pylint-0.2

    What's new?
    -----------

    In addition to a large number of bug fixes, this release adds two new
    checkers, for missing encoding declaration, and for FIXME comments. Zope
    support was improved.

    About Pylint
    ------------

    Pylint is a lint-like tool for Python code. It performs almost all the
    verifications that pychecker does, and additionally can perform some
    stylistic verification and coding standard enforcements. The checked
    code is assigned a mark based on the number and the severity of the
    encountered problems. The previous mark of a given piece of code is
    cached so that you can see if the code quality has improved since the
    last check.

    URLs
    ----

    Homepage: http://www.logilab.org/projects/pylint
    Download: ftp://ftp.logilab.org/pub/pylint/pylint-0.2.tar.gz


    --
    Alexandre Fayolle
    LOGILAB, Paris (France).
    http://www.logilab.com http://www.logilab.fr http://www.logilab.org
    Développement logiciel avancé - Intelligence Artificielle - Formations
    Alexandre Fayolle, Sep 26, 2003
    #1
    1. Advertising

  2. Alexandre Fayolle

    Mark Hahn Guest


    > Pylint is a lint-like tool for Python code


    Does pylint only work for modules? When I tried to run it on my code file
    (ezpicmailer.py) , it raised an exception:

    No config file found, using default configuration
    <snip>
    Exception: Unable to find module for C:\photoedit\ezpicmailer in
    <snip>

    and then it gave a long list of modules in my sys.path. It seems to insist
    that the argument I give it be a module in sys.path, not just an arbitrary
    python code file.

    ------------------------------------------

    "Alexandre Fayolle" <> wrote in message
    news:...
    Logilab has released pylint-0.2

    What's new?
    -----------

    In addition to a large number of bug fixes, this release adds two new
    checkers, for missing encoding declaration, and for FIXME comments. Zope
    support was improved.

    About Pylint
    ------------

    Pylint is a lint-like tool for Python code. It performs almost all the
    verifications that pychecker does, and additionally can perform some
    stylistic verification and coding standard enforcements. The checked
    code is assigned a mark based on the number and the severity of the
    encountered problems. The previous mark of a given piece of code is
    cached so that you can see if the code quality has improved since the
    last check.

    URLs
    ----

    Homepage: http://www.logilab.org/projects/pylint
    Download: ftp://ftp.logilab.org/pub/pylint/pylint-0.2.tar.gz


    --
    Alexandre Fayolle
    LOGILAB, Paris (France).
    http://www.logilab.com http://www.logilab.fr http://www.logilab.org
    Développement logiciel avancé - Intelligence Artificielle - Formations
    Mark Hahn, Sep 27, 2003
    #2
    1. Advertising

  3. I get the same error.

    I tried to find documentation to see whether I was using Pylint correctly or
    not but there isn't any. There seems to have been an attempt at providing
    the possible command line options (python pylint.py --help) but I don't find
    them particularly self-explanatory - so without documentation and the
    apparent ability to "run out of the box", I guess I'll just have to give
    this one a miss.

    One nice thing that has happened is it has led me to the Optik package
    (Option parsing). There is some nice documentation for this package - the
    author(s) of Pylint could take some direction from this package if they
    really want people to use Pylint (I have a personal hangup with people who
    write good, useful packages and then don't bother documenting them - life is
    just too short to read somebody else'e code to get around this deficiency
    :) I get frustrated however when I think there is something that I could be
    taking advantage of but something as simple as the lack of 0.5hr of
    documentation stops me :-( ).

    In the meantime, I'll just have to watch this space :)

    Peter


    "Mark Hahn" <> wrote in message
    news:EBkdb.3354$hp5.1305@fed1read04...
    >
    > > Pylint is a lint-like tool for Python code

    >
    > Does pylint only work for modules? When I tried to run it on my code file
    > (ezpicmailer.py) , it raised an exception:
    >
    > No config file found, using default configuration
    > <snip>
    > Exception: Unable to find module for C:\photoedit\ezpicmailer in
    > <snip>
    >
    > and then it gave a long list of modules in my sys.path. It seems to

    insist
    > that the argument I give it be a module in sys.path, not just an arbitrary
    > python code file.
    >
    > ------------------------------------------
    >
    > "Alexandre Fayolle" <> wrote in message
    > news:...
    > Logilab has released pylint-0.2
    >
    > What's new?
    > -----------
    >
    > In addition to a large number of bug fixes, this release adds two new
    > checkers, for missing encoding declaration, and for FIXME comments. Zope
    > support was improved.
    >
    > About Pylint
    > ------------
    >
    > Pylint is a lint-like tool for Python code. It performs almost all the
    > verifications that pychecker does, and additionally can perform some
    > stylistic verification and coding standard enforcements. The checked
    > code is assigned a mark based on the number and the severity of the
    > encountered problems. The previous mark of a given piece of code is
    > cached so that you can see if the code quality has improved since the
    > last check.
    >
    > URLs
    > ----
    >
    > Homepage: http://www.logilab.org/projects/pylint
    > Download: ftp://ftp.logilab.org/pub/pylint/pylint-0.2.tar.gz
    >
    >
    > --
    > Alexandre Fayolle
    > LOGILAB, Paris (France).
    > http://www.logilab.com http://www.logilab.fr http://www.logilab.org
    > Développement logiciel avancé - Intelligence Artificielle - Formations
    >
    >
    Peter Milliken, Sep 29, 2003
    #3
  4. Alexandre Fayolle

    Peter Hansen Guest

    Peter Milliken wrote:
    >
    > I get the same error.

    [snip]
    > (I have a personal hangup with people who
    > write good, useful packages and then don't bother documenting them - life is
    > just too short to read somebody else'e code to get around this deficiency
    > :) I get frustrated however when I think there is something that I could be
    > taking advantage of but something as simple as the lack of 0.5hr of
    > documentation stops me :-( ).


    Maybe RTFM would help. See http://www.logilab.org/projects/pylint/documentation and
    note the "dependancies" (sic) line which states "Pylint requires the
    logilab-common(version >= 0.2.1) and the optik packages."

    If you download the "Common libraries" from the links provided on that page,
    I suspect it will work better.

    Unfortunately, by posting the direct link to the download I suspect Alexandre
    led people astray by implying that a single download might be enough to make
    this work.

    -Peter
    Peter Hansen, Sep 29, 2003
    #4
  5. Alexandre Fayolle

    John J. Lee Guest

    "Peter Milliken" <> writes:
    [...]
    > One nice thing that has happened is it has led me to the Optik package

    [...]

    Optik is now in 2.3 standard library, renamed as the optparse module.


    John
    John J. Lee, Sep 29, 2003
    #5
  6. Hi Peter,

    No, I caught all of the dependencies that are required (common libraries and
    optik - I think that is all that is required). I installed both of them
    before attempting to run pylint and still received that error. Perhaps the
    install is order dependent i.e. I installed pylint, then the "common
    libraries" then the optik package.

    Does Pylint work for you?

    Peter

    "Peter Hansen" <> wrote in message
    news:...
    > Peter Milliken wrote:
    > >
    > > I get the same error.

    > [snip]
    > > (I have a personal hangup with people who
    > > write good, useful packages and then don't bother documenting them -

    life is
    > > just too short to read somebody else'e code to get around this

    deficiency
    > > :) I get frustrated however when I think there is something that I

    could be
    > > taking advantage of but something as simple as the lack of 0.5hr of
    > > documentation stops me :-( ).

    >
    > Maybe RTFM would help. See

    http://www.logilab.org/projects/pylint/documentation and
    > note the "dependancies" (sic) line which states "Pylint requires the
    > logilab-common(version >= 0.2.1) and the optik packages."
    >
    > If you download the "Common libraries" from the links provided on that

    page,
    > I suspect it will work better.
    >
    > Unfortunately, by posting the direct link to the download I suspect

    Alexandre
    > led people astray by implying that a single download might be enough to

    make
    > this work.
    >
    > -Peter
    Peter Milliken, Sep 29, 2003
    #6
  7. Alexandre Fayolle

    Mark Hahn Guest

    They not only feel no need to document, they also feel no need to follow ANN
    threads they start.

    "Peter Milliken" <> wrote in message
    news:ToKdb.9$...
    > I get the same error.
    >
    > I tried to find documentation to see whether I was using Pylint correctly

    or
    > not but there isn't any. There seems to have been an attempt at providing
    > the possible command line options (python pylint.py --help) but I don't

    find
    > them particularly self-explanatory - so without documentation and the
    > apparent ability to "run out of the box", I guess I'll just have to give
    > this one a miss.
    >
    > One nice thing that has happened is it has led me to the Optik package
    > (Option parsing). There is some nice documentation for this package - the
    > author(s) of Pylint could take some direction from this package if they
    > really want people to use Pylint (I have a personal hangup with people who
    > write good, useful packages and then don't bother documenting them - life

    is
    > just too short to read somebody else'e code to get around this deficiency
    > :) I get frustrated however when I think there is something that I could

    be
    > taking advantage of but something as simple as the lack of 0.5hr of
    > documentation stops me :-( ).
    >
    > In the meantime, I'll just have to watch this space :)
    >
    > Peter
    >
    >
    > "Mark Hahn" <> wrote in message
    > news:EBkdb.3354$hp5.1305@fed1read04...
    > >
    > > > Pylint is a lint-like tool for Python code

    > >
    > > Does pylint only work for modules? When I tried to run it on my code

    file
    > > (ezpicmailer.py) , it raised an exception:
    > >
    > > No config file found, using default configuration
    > > <snip>
    > > Exception: Unable to find module for C:\photoedit\ezpicmailer in
    > > <snip>
    > >
    > > and then it gave a long list of modules in my sys.path. It seems to

    > insist
    > > that the argument I give it be a module in sys.path, not just an

    arbitrary
    > > python code file.
    > >
    > > ------------------------------------------
    > >
    > > "Alexandre Fayolle" <> wrote in message
    > > news:...
    > > Logilab has released pylint-0.2
    > >
    > > What's new?
    > > -----------
    > >
    > > In addition to a large number of bug fixes, this release adds two new
    > > checkers, for missing encoding declaration, and for FIXME comments. Zope
    > > support was improved.
    > >
    > > About Pylint
    > > ------------
    > >
    > > Pylint is a lint-like tool for Python code. It performs almost all the
    > > verifications that pychecker does, and additionally can perform some
    > > stylistic verification and coding standard enforcements. The checked
    > > code is assigned a mark based on the number and the severity of the
    > > encountered problems. The previous mark of a given piece of code is
    > > cached so that you can see if the code quality has improved since the
    > > last check.
    > >
    > > URLs
    > > ----
    > >
    > > Homepage: http://www.logilab.org/projects/pylint
    > > Download: ftp://ftp.logilab.org/pub/pylint/pylint-0.2.tar.gz
    > >
    > >
    > > --
    > > Alexandre Fayolle
    > > LOGILAB, Paris (France).
    > > http://www.logilab.com http://www.logilab.fr http://www.logilab.org
    > > Développement logiciel avancé - Intelligence Artificielle - Formations
    > >
    > >

    >
    >
    Mark Hahn, Sep 30, 2003
    #7
  8. "Mark Hahn" <> writes:

    > They not only feel no need to document, they also feel no need to follow ANN
    > threads they start.


    Sorry, I don't have the time to follow c.l.py at the moment and that's
    just today that I've been informed about this thread.

    So, regarding the command line, pylint expects the name of a package
    or module as argument. As a convenience, you can give to it a file
    name if it's possible to guess a module name from the file's
    path, using the python path. Some examples :

    "pylint mymodule.py" should always works since the current working
    directory is automatically added on top of the python path

    "pylint directory/mymodule.py" will work if "directory" is a python
    package (i.e. has an __init__.py file) or if "directory" is in the
    python path.

    "pylint /whatever/directory/mymodule.py" will work if either:
    - "/whatever/directory" is in the python path
    - your cwd is "/whatever/directory"
    - "directory" is a python package and "/whatever" is in the python path
    - "directory" is a python package and your cwd is "/whatever"
    and so on...


    Regarding the lack of documentation, we're pretty busy at this time at
    logilab, but I hope we'll have the time to write some until the next
    release... Anyway, any contribution would be welcome ;)


    Hope that helps,
    regards
    --
    Sylvain Thénault LOGILAB, Paris (France).

    http://www.logilab.com http://www.logilab.fr http://www.logilab.org
    Sylvain =?iso-8859-1?q?Th=E9nault?=, Sep 30, 2003
    #8
  9. Sorry mate, but I am in the same directory of the Python file I am trying to
    run through pylint and I get the same message originally posted by Mark
    Hahn.

    So something is wrong - perhaps you should verify that what is on the
    web-site is actually working as you expect?

    Here is the full error message from one of my runs:

    roebourne#1(~/swimming)$ python
    c:/Python22/Lib/site-packages/logilab/pylint/lint.py roll.py
    No config file found, using default configuration
    Traceback (most recent call last):
    File "c:/Python22/Lib/site-packages/logilab/pylint/lint.py", line 529, in
    ?
    Run(*sys.argv[1:])
    File "c:/Python22/Lib/site-packages/logilab/pylint/lint.py", line 496, in
    __init__
    modname = '.'.join(modpath_from_file(modname))
    File "c:\Python22\Lib\site-packages\logilab\common\modutils.py", line 70,
    in modpath_from_file
    raise Exception('Unable to find module for %s in %s' % (
    Exception: Unable to find module for c:\usr\local\swimming\roll in
    c:\usr\local\swimming,
    c:/Python22/Lib/site-packages/logilab/pylint,
    c:\Python22,
    c:\Python22\DLLs,
    c:\Python22\Lib,
    c:\Python22\Lib\lib-tk,
    c:\usr\local\swimming,
    c:\Python22\lib\site-packages,
    c:\usr\local\share\emacs\site-lisp\pymacs
    [exited with 1]

    Note that I am running Python 2.2.2.

    Peter

    "Sylvain "Thénault"" <> wrote in message
    news:...
    > "Mark Hahn" <> writes:
    >
    > > They not only feel no need to document, they also feel no need to follow

    ANN
    > > threads they start.

    >
    > Sorry, I don't have the time to follow c.l.py at the moment and that's
    > just today that I've been informed about this thread.
    >
    > So, regarding the command line, pylint expects the name of a package
    > or module as argument. As a convenience, you can give to it a file
    > name if it's possible to guess a module name from the file's
    > path, using the python path. Some examples :
    >
    > "pylint mymodule.py" should always works since the current working
    > directory is automatically added on top of the python path
    >
    > "pylint directory/mymodule.py" will work if "directory" is a python
    > package (i.e. has an __init__.py file) or if "directory" is in the
    > python path.
    >
    > "pylint /whatever/directory/mymodule.py" will work if either:
    > - "/whatever/directory" is in the python path
    > - your cwd is "/whatever/directory"
    > - "directory" is a python package and "/whatever" is in the python path
    > - "directory" is a python package and your cwd is "/whatever"
    > and so on...
    >
    >
    > Regarding the lack of documentation, we're pretty busy at this time at
    > logilab, but I hope we'll have the time to write some until the next
    > release... Anyway, any contribution would be welcome ;)
    >
    >
    > Hope that helps,
    > regards
    > --
    > Sylvain Thénault LOGILAB, Paris (France).
    >
    > http://www.logilab.com http://www.logilab.fr http://www.logilab.org
    Peter Milliken, Sep 30, 2003
    #9
  10. On Wednesday 01 October à 07:42, Peter Milliken wrote:
    > Sorry mate, but I am in the same directory of the Python file I am trying to
    > run through pylint and I get the same message originally posted by Mark
    > Hahn.
    >
    > So something is wrong - perhaps you should verify that what is on the
    > web-site is actually working as you expect?


    ok, that was actually a problem in the common library. I've just made a
    new release which should fix this problem :

    ftp://ftp.logilab.fr/pub/common/common-0.3.3.tar.gz

    --
    Sylvain Thénault LOGILAB, Paris (France).

    http://www.logilab.com http://www.logilab.fr http://www.logilab.org
    Sylvain =?iso-8859-1?Q?Th=E9nault?=, Oct 1, 2003
    #10
  11. Alexandre Fayolle

    Peter Hansen Guest

    Peter Milliken wrote:
    >
    > No, I caught all of the dependencies that are required (common libraries and
    > optik - I think that is all that is required). I installed both of them
    > before attempting to run pylint and still received that error. Perhaps the
    > install is order dependent i.e. I installed pylint, then the "common
    > libraries" then the optik package.
    >
    > Does Pylint work for you?


    Sorry, I was jumping to conclusions. I got the same message you did,
    after a pylint-only install, so then I visited the web site and saw
    the notes about common and posted my response. Didn't actually try
    it out yet.

    Thanks to Sylvain for posting the fix that resolves this. (Assuming
    it does... anyone try it yet? ;-)

    -Peter
    Peter Hansen, Oct 1, 2003
    #11
  12. Getting closer but still no prizes :)

    Installed the supplied common and re-ran with the following result:

    roebourne#1(~/swimming)$ python
    c:/Python22/Lib/site-packages/logilab/pylint/lint.py roll.py
    No config file found, using default configuration
    An error occured while parsing roll
    Traceback (most recent call last):
    File "c:/Python22/Lib/site-packages/logilab/pylint/lint.py", line 529, in
    ?
    Run(*sys.argv[1:])
    File "c:/Python22/Lib/site-packages/logilab/pylint/lint.py", line 497, in
    __init__
    linter.check(modname)
    File "c:/Python22/Lib/site-packages/logilab/pylint/lint.py", line 230, in
    check
    astng = self.manager.astng_from_module_name(mod_name)
    File "c:\Python22\Lib\site-packages\logilab\common\astng\manager.py", line
    85, in astng_from_module_name
    return self.astng_from_module(module, norm_mod_name)
    File "c:\Python22\Lib\site-packages\logilab\common\astng\manager.py", line
    62, in astng_from_module
    astng = self._builder.build_from_module(module, mod_name)
    File "c:\Python22\Lib\site-packages\logilab\common\astng\astng.py", line
    179, in build_from_module
    astng = self._string_build(data)
    File "c:\Python22\Lib\site-packages\logilab\common\astng\astng.py", line
    234, in _string_build
    ast = parser.suite(data + linesep)
    parser.ParserError: could not parse string
    [exited with 1]


    I assume that we are getting closer? :)

    Peter


    "Sylvain Thénault" <> wrote in message
    news:...
    > On Wednesday 01 October à 07:42, Peter Milliken wrote:
    > > Sorry mate, but I am in the same directory of the Python file I am

    trying to
    > > run through pylint and I get the same message originally posted by Mark
    > > Hahn.
    > >
    > > So something is wrong - perhaps you should verify that what is on the
    > > web-site is actually working as you expect?

    >
    > ok, that was actually a problem in the common library. I've just made a
    > new release which should fix this problem :
    >
    > ftp://ftp.logilab.fr/pub/common/common-0.3.3.tar.gz
    >
    > --
    > Sylvain Thénault LOGILAB, Paris (France).
    >
    > http://www.logilab.com http://www.logilab.fr http://www.logilab.org
    >
    >
    Peter Milliken, Oct 1, 2003
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Re: [ANN] pylint-0.1.2

    , Jun 25, 2003, in forum: Python
    Replies:
    2
    Views:
    828
  2. POYEN OP Olivier (DCL)

    RE: [ANN] pylint-0.2

    POYEN OP Olivier (DCL), Sep 30, 2003, in forum: Python
    Replies:
    1
    Views:
    306
    Mark Hahn
    Sep 30, 2003
  3. Alexandre Fayolle

    [ANN] logilab-common [fixes bug in pylint]

    Alexandre Fayolle, Oct 9, 2003, in forum: Python
    Replies:
    0
    Views:
    296
    Alexandre Fayolle
    Oct 9, 2003
  4. Alexandre Fayolle

    [ANN] pylint-0.2.1

    Alexandre Fayolle, Oct 10, 2003, in forum: Python
    Replies:
    0
    Views:
    324
    Alexandre Fayolle
    Oct 10, 2003
  5. Giacomo Boffi
    Replies:
    4
    Views:
    1,652
    Jean-Michel Pichavant
    Apr 19, 2010
Loading...

Share This Page