File: run-pylint.py

package info (click to toggle)
sasmodels 1.0.10-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 16,488 kB
  • sloc: python: 26,277; ansic: 8,036; makefile: 150; sh: 63
file content (29 lines) | stat: -rwxr-xr-x 789 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python

import os
import sys
from os.path import dirname, join as joinpath, abspath

def main():
    extra = abspath(dirname(__file__))
    root = abspath(joinpath(extra, '..'))

    envpath = os.environ.get('PYTHONPATH', None)
    path = [envpath] if envpath else []
    path.append(extra)

    #bumps = abspath(joinpath(root, "..", "bumps"))
    #periodictable = abspath(joinpath(root, "..", "periodictable"))
    #sasview = abspath(joinpath(root, "..", "sasview", "src"))
    #path.extend((bumps, periodictable, sasview))

    os.environ['PYTHONPATH'] = ':'.join(path)

    # Run the lint command
    cmd = "pylint --rcfile extra/pylint.rc -f parseable sasmodels"
    os.chdir(root)
    status = os.system(cmd)
    sys.exit(status)

if __name__ == "__main__":
    main()