Example #1
0
                      help='create graphs of code quality evolution.')

    options, args = parser.parse_args()

    # Filenames
    if args:
        filenames = set([])
        for arg in args:
            filenames = filenames.union(glob(arg))
        filenames = list(filenames)
    elif git.is_available():
        filenames = git.get_filenames()
        filenames = [ x for x in filenames if x.endswith('.py') ]
    else:
        filenames = []
        for path in lfs.traverse():
            if lfs.is_file(path) and basename(path).endswith('.py'):
                filenames.append(relpath(path))

    # Check options
    if len(filenames) == 0:
        parser.error(u'Please give at least one file to analyse.')
    if options.worse > 0 and options.show_lines is True:
        parser.error(
            u'Options --worse and --show-lines are mutually exclusive.')
    if options.show_lines == True and len(filenames) != 1:
        parser.error(
            u'The option --show-lines takes one file in parameter.')

    # (1) Export graph
    if options.graph:
Example #2
0
 def test_traverse(self):
     for x in lfs.traverse('.'):
         self.assertEqual(lfs.exists(x), True)
Example #3
0
    options, args = parser.parse_args()

    # Filenames
    worktree = open_worktree('.', soft=True)
    if args:
        filenames = set([])
        for arg in args:
            filenames = filenames.union(glob(arg))
        filenames = list(filenames)
    elif worktree:
        filenames = worktree.get_filenames()
        filenames = [x for x in filenames if x.endswith('.py')]
    else:
        filenames = []
        for path in lfs.traverse():
            if lfs.is_file(path) and basename(path).endswith('.py'):
                filenames.append(relpath(path))

    # Check options
    if len(filenames) == 0:
        parser.error(u'Please give at least one file to analyse.')
    if options.worse > 0 and options.show_lines is True:
        parser.error(
            u'Options --worse and --show-lines are mutually exclusive.')
    if options.show_lines == True and len(filenames) != 1:
        parser.error(u'The option --show-lines takes one file in parameter.')

    # (1) Show Lines
    if options.show_lines:
        show_lines(filenames)
Example #4
0
 def test_traverse(self):
     for x in lfs.traverse('.'):
         self.assertEqual(lfs.exists(x), True)