Code Monkey home page Code Monkey logo

prospector's People

Contributors

carl-tstpd avatar carlio avatar cclauss avatar chocoelho avatar dependabot[bot] avatar djpugh avatar eran-pinhas avatar gopackgo90 avatar guykisel avatar jakirkham avatar jayclassless avatar jquast avatar kilo59 avatar kirang89 avatar merwok avatar nasyxx avatar nnonexistent avatar pierre-sassoulas avatar pre-commit-ci[bot] avatar prophile avatar rik avatar rylans avatar sbrunner avatar sergeykosarchuk avatar sijis avatar smspillaz avatar stdweird avatar supernova4422 avatar timgates42 avatar tnir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prospector's Issues

ImportError: No module named pylint_common

I've installed by cloning from git and then ran python setup.py install

Traceback (most recent call last):
  File "/usr/local/bin/prospector", line 9, in <module>
    load_entry_point('prospector==0.5.1', 'console_scripts', 'prospector')()
  File "/usr/local/lib/python2.7/dist-packages/prospector-0.5.1-py2.7.egg/prospector/run.py", line 186, in main
    summary, messages = prospector.execute()
  File "/usr/local/lib/python2.7/dist-packages/prospector-0.5.1-py2.7.egg/prospector/run.py", line 131, in execute
    tool.prepare(self.path, self.ignores, self.config, self.adaptors)
  File "/usr/local/lib/python2.7/dist-packages/prospector-0.5.1-py2.7.egg/prospector/tools/pylint/__init__.py", line 83, in prepare
    adaptor.adapt_pylint(linter)
  File "/usr/local/lib/python2.7/dist-packages/prospector-0.5.1-py2.7.egg/prospector/adaptor/common.py", line 8, in adapt_pylint
    linter.load_plugin_modules(['pylint_common'])
  File "/usr/local/lib/python2.7/dist-packages/pylint-1.1.0-py2.7.egg/pylint/lint.py", line 357, in load_plugin_modules
    module = load_module_from_name(modname)
  File "/usr/local/lib/python2.7/dist-packages/logilab_common-0.61.0-py2.7.egg/logilab/common/modutils.py", line 125, in load_module_from_name
    return load_module_from_modpath(dotted_name.split('.'), path, use_sys)
  File "/usr/local/lib/python2.7/dist-packages/logilab_common-0.61.0-py2.7.egg/logilab/common/modutils.py", line 167, in load_module_from_modpath
    mp_file, mp_filename, mp_desc = find_module(part, path)
ImportError: No module named pylint_common

So I tried:

sjuul@development01:~/workspace/oversight$ sudo pip install -U pylint-common
Requirement already up-to-date: pylint-common in /usr/local/lib/python2.7/dist-packages/pylint_common-0.1-py2.7.egg
Requirement already up-to-date: pylint>=1.0 in /usr/local/lib/python2.7/dist-packages/pylint-1.1.0-py2.7.egg (from pylint-common)
Requirement already up-to-date: astroid>=1.0 in /usr/local/lib/python2.7/dist-packages/astroid-1.0.1-py2.7.egg (from pylint-common)
Requirement already up-to-date: pylint-plugin-utils>=0.1 in /usr/local/lib/python2.7/dist-packages/pylint_plugin_utils-0.1.1-py2.7.egg (from pylint-common)
Requirement already up-to-date: logilab-common>=0.53.0 in /usr/local/lib/python2.7/dist-packages/logilab_common-0.61.0-py2.7.egg (from pylint>=1.0->pylint-common)

But that didn't help

Needs mechanism for ignoring folders like .tox

On projects which use tox (it complements Travis-CI in the same way an offline copy of Prospector complements Landscape.io), the user is forced to choose between not inspecting files like setup.py in the root of the repository (which differs from my understanding of how Landscape.io does things) and a very awkward hack-around involving temporarily moving .tox outside the project repository.

(Since letting it inspect .tox takes forever and produces a flood of spurious errors from the project's dependencies in the virtualenvs)

There needs to be some kind of mechanism for ignoring folders and .tox should be included in the default setting.

Allow specifying multiple paths as positional arguments

This is related to #56. It would be easier to wrap prospector in other tools (such as a git commit hook) if it could accept more than one path at a time.

I'm interested in implementing this myself and submitting it as a pull request, but I wouldn't mind if someone else with more free time does it instead.

Include and improve python-skeletons if possible

The python-skeletons project has a lot of goals in common with prospector's attempts to adapt static analyis tools to particular frameworks. Ideally, pylint-django and pylint-celery could be subsumed into pylint-skeletons, and prospector would include pylint-skeletons.

This issue is a rather vague "investigate this" reminder rather than anything specific.

Add support for diffcov

diffcov automatically finds the diff lines that needs tests.
It also finds lint errors on diffs which is very useful for PRs.

only one error of each type per line

just noticed that the linter appears to not display multiple instances of an error on the same page.

if i have

import json, pprint, 

a = 1
b = 1
print a + b

I will get 2 errors, one E401, and one W0611 for pprint.
However I should have 3, E401, W0611 for json, and W0611 for pprint.

Prospector seems to be swallowing multiple instances of errors on the same line.

Add support for excluding south migrations

While using South and it's generated migrations, you'll get lot of automatically generated code with poor PEP-8 compliance, so it would be great to ignore them.

It could probably be done automatically once using Django (ignore */migrations/*.py) or providing some generic way to define files to be skipped from checking.

check single files

Can prospector be given an option to check single files?

Having a single file mode would make building a prospector powered atom.io linter possible.

py26: datetime.timedelta issue

installed via pip,
executed via py26 in venv

$ python

Python 2.6.8 (unknown, Mar  9 2014, 22:16:00) 
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.


$ prospector --version                                                                                                                                                                                                         
prospector 0.7

have an error

$ prospector

Traceback (most recent call last):                                                                                                                                                  
  File "/Users/iremizov/Py26/bin/prospector", line 9, in <module>
    load_entry_point('prospector==0.7', 'console_scripts', 'prospector')()
  File "/Users/iremizov/Py26/lib/python2.6/site-packages/prospector/run.py", line 312, in main
    prospector.execute()
  File "/Users/iremizov/Py26/lib/python2.6/site-packages/prospector/run.py", line 253, in execute
    summary['time_taken'] = '%0.2f' % delta.total_seconds()
AttributeError: 'datetime.timedelta' object has no attribute 'total_seconds'

Exclude virtual environments

If someone puts a virtualenvironment in the root of their project, prospector will attempt to check every package. It should detect virtualenvironment directories and skip them

Better documentation

The current README is becoming insufficient to explain all of the features of prospector, and is missing things like the motivation for the project and clarification of some behaviour. A nice big "Read the docs" page would be useful.

Supported tools section

The README says to see the supported tools section below, but this is actually another page in the documentation and there should probably be a link to that instead.

Needs a mechanism for specifying more nuanced strictness

Prospector and Landscape.io need some way to say "I want 'veryhigh' strictness in general, but use 'medium' for PyLint and use this raw config file with pep8.py instead."

prospector -s medium doesn't enforce PEP8 strictly enough but prospector -s high makes PyLint too pedantic and makes PEP8 complain about "E401: multiple imports on one line", which I've ignored in my flake8 configuration.

As-is, I have to continue to enforce my PEP8 policy by leaving Travis-CI configured to run flake8 and fail the entire test run if the code fails the style check.

For pep8.py, might I suggest just restoring its ability to let a [pep8] section in setup.cfg or tox.ini override the default values? (In other words, supply the prospector configuration via whatever mechanism pep8 --config uses and make sure Prospector isn't confusing its idea of where the project's root directory is.)

Code comment to ignore/disable/exclude warning

To ignore a specific error/warning, as Prospector is a collection of tools, it could either:

  • Show in README.md how to exclude warnings for different tools
  • Implement a general prospector warning exclusion (better)

Known exclusion in comment:

  • PyLint, usually before a line block: # pylint: disable=MESSAGE_ID_OR_KEY
  • PEP-8 add at end of line: # noqa
  • dodgy: ?
    -...

strictness_medium needs to exclude C0325 from PyLint's output

Currently, in code written to work in both Python 2.x and Python 3.x, the default strictness_medium profile for prospector causes PyLint to return this error when run under Python 2.x:

run_tests (run_tests.py):
    L41:0 : pylint - C0325
    Unnecessary parens after 'print' keyword

Exit code

It's hard to make it part of CI because:

  • There is no Jenkins plugin that can read the outputs (if there is, please add it to the Wiki).
  • The tool doesn't exit code 1 or more when there are lint warnings/errors

I'd suggest first to support exit code.

Column number inconsistency for pylint

There seems to be an inconsistency when reporting column numbers: the pylint tool returns 0-based columns, while all other tools report 1-based columns (provided the column number is available, that is):

$ echo import sys >test.py
$ prospector -B -M test.py 
Messages
========

test.py:
    L1:1 None: frosted - E101
     sys imported but unused

test.py:
    L1:1 None: pyflakes - FL0001
    'sys' imported but unused

test (test.py):
    L1:0 None: pylint - W0611
    Unused import sys

UnicodeDecodeError:'utf-8' codec can't decode byte 0x89

Prospector is throwing exception for python package "django-http-proxy". Version of package is 0.3.2.

Below is the stack trace:

Traceback (most recent call last):
  File "/usr/local/bin/prospector", line 9, in <module>
    load_entry_point('prospector==0.6.4', 'console_scripts', 'prospector')()
  File "/usr/local/lib/python3.4/dist-packages/prospector-0.6.4-py3.4.egg/prospector/run.py", line 190, in main
    prospector = Prospector(config, paths[0])
  File "/usr/local/lib/python3.4/dist-packages/prospector-0.6.4-py3.4.egg/prospector/run.py", line 34, in __init__
    self._determine_adapters()
  File "/usr/local/lib/python3.4/dist-packages/prospector-0.6.4-py3.4.egg/prospector/run.py", line 46, in _determine_adapters
    for name, adaptor in autodetect_libraries(self.path):
  File "/usr/local/lib/python3.4/dist-packages/prospector-0.6.4-py3.4.egg/prospector/autodetect.py", line 69, in autodetect_libraries
    adaptor_names = find_from_path(path)
  File "/usr/local/lib/python3.4/dist-packages/prospector-0.6.4-py3.4.egg/prospector/autodetect.py", line 35, in find_from_path
    names |= find_from_path(item_path)
  File "/usr/local/lib/python3.4/dist-packages/prospector-0.6.4-py3.4.egg/prospector/autodetect.py", line 35, in find_from_path
    names |= find_from_path(item_path)
  File "/usr/local/lib/python3.4/dist-packages/prospector-0.6.4-py3.4.egg/prospector/autodetect.py", line 38, in find_from_path
    names |= find_from_imports(fip.read())
  File "/usr/lib/python3.4/codecs.py", line 313, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x89 in position 37: invalid start byte

Please let me know if you need any further details to look into this issue..

Could you please look into this ?

Reinstate --path argument

The change to use jayclassless/setopfconf removed the ability to specify the path from a command line option. This may be used by people already, so should be reinstated for backwards compatability (and possibly deprecated).

See #14

Support emacs compilation output mode

If you put the line number after the file, then will be much more useful to emacs users that use the compile command. This:

foo/__init__.py :
    L5:1 None: pyflakes - FL0001
    'ApiException' imported but unused

should be:

foo/__init__.py:5 :
    L5:1 None: pyflakes - FL0001
    'ApiException' imported but unused

Claim the Ohloh entry

In order to add Prospector to my Ohloh "tools I actively use for development" list, I took advantage of their "you don't have to be a project manager to add an entry" feature. (It's also one more way people can discover Prospector and Landscape.io)

You'll probably want to declare yourself a project manager on this entry. (Among other things, it gives you the option of disallowing edits by random Joe Nobodies like me.)

https://www.ohloh.net/p/landscapeio-prospector

I've filled out everything I could but I highly recommend checking these pages to see if there's anything I missed:

  • News Feeds (Ohloh lets you incorporate announcements into their system via RSS)
  • Links (In case there are any categories you can add which I couldn't)
  • Logo (In some places, "stuff I use" lists are just icon grids and it's currently using a placeholder)
  • Aliases (In case you need to claim commits under multiple names)

Finally, while I think they're large and gaudy, Ohloh does have their own statistics widgets. (But only for GitHub Pages. They use <script> tags)

Add support of twisted framework, or possible error is climbing inheritance hierarchy

For this code:

from twisted.internet.protocol import DatagramProtocol

class Class(DatagramProtocol):
    def __init__(self, string, host, port):
        self.transport.write(string, (host, port))

The inspector gives an error that class Class has no method transport. Whereas transport is defined by AbstractDatagramProtocol which is inherited by DatagramProtocol

Segmentation fault (core dumped)

When Prospector is run on some python libraries, it simply exit out with message:

"Segmentation fault (core dumped)"

Sample libraries: pygtkspellcheck, Netzob, GladeBuilder, gtimelog

Please let me know if you need any further information.

Python path option

There is no option to alter the Python path used to look for modules during the static analysis, thus causing a lot of "pylint - F0401 - Unable to import" error message.

Suppress "Messages" header or configure verbosity

This is somewhat related to pre-commit/pre-commit#178

I'm working on setting up a Prospector hook for http://pre-commit.com/ (a handy git pre-commit hook manager). The way I'm configuring it, pre-commit runs prospector via xargs. See https://github.com/pre-commit/pre-commit/blob/master/pre_commit/languages/system.py

I'm currently setting the entry point to prospector as -n 1 prospector so that pre-commit ends up running xargs -0 -n 1 prospector, which then calls prospector once per input file. This ends up creating a lot of redundant summaries and message headers in the output, when I would rather just get the messages themselves. I can supply the -M argument to suppress the summaries, but I still get the Messages header once per file, even when there are no messages for that file.

My request is to add some sort of flag for either suppressing the Messages header specifically, or for more generally controlling output verbosity.

If this seems reasonable, I'd be willing to work on it and submit a pull request. Alternatively, if there's a better way to do this or something obvious I'm missing, I would appreciate any help.

(my efforts so far are at https://github.com/guykisel/prospector-mirror [which could probably use a better project name])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.