Skip to content

nedbat/pylintdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pylint DB

Put pylint results into a SQLite database, then query them.

Typical use:

  1. Run pylint in the usual way.

  2. Read the reports into the database:

    $ python pylintdb.py read REPORTFILE.txt REPORTFILE2.txt ...
    
  3. Get the author and commit information for each violation:

    $ python pylintdb.py blame
    
  4. Query the database to find violations:

    $ python pylintdb.py where "author = 'ned@edx.org'"
    $ python pylintdb.py where "code = 'W0110' and file like 'common/%'"
    $ python pylintdb.py where "slug = 'unused-import'"
    
  5. You can also use the sqlite3 command (available separately):

    $ sqlite3 pylint.db
    sqlite> select * from (select slug, count(*) c from violation where modified > '2017-03-22' group by 1 order by 2) where c >= 5;
    slug                            c
    ------------------------------  ----------
    relative-import                 5
    protected-access                5
    unused-variable                 5
    unused-argument                 8
    line-too-long                   8
    unused-import                   10
    invalid-name                    10
    bad-continuation                14
    no-member                       24
    missing-docstring               63
    

There are details in the code that you will have to change: GIT_DIR is the location of the source you are linting, and the pylint reporting format might be specific to edX.

Licensed under the Apache 2.0 license.

About

Put pylint violations into sqlite

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages