mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 07:14:48 +08:00
recursive file paths for the temporary linter api - #408
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
from sys import argv
|
from sys import argv
|
||||||
from os.path import join, dirname, abspath
|
from os.path import join, dirname, abspath, isdir
|
||||||
|
|
||||||
|
|
||||||
if len(argv) == 2 and argv[1] == 'repl':
|
if len(argv) == 2 and argv[1] == 'repl':
|
||||||
@@ -13,5 +13,17 @@ elif len(argv) > 1 and argv[1] == 'force':
|
|||||||
if '--debug' in sys.argv:
|
if '--debug' in sys.argv:
|
||||||
jedi.set_debug_function()
|
jedi.set_debug_function()
|
||||||
|
|
||||||
for error in jedi.Script(path=sys.argv[2])._analysis():
|
path = sys.argv[2]
|
||||||
|
if isdir(path):
|
||||||
|
import fnmatch
|
||||||
|
import os
|
||||||
|
|
||||||
|
paths = []
|
||||||
|
for root, dirnames, filenames in os.walk(path):
|
||||||
|
for filename in fnmatch.filter(filenames, '*.py'):
|
||||||
|
paths.append(os.path.join(root, filename))
|
||||||
|
else:
|
||||||
|
paths = [path]
|
||||||
|
for path in paths:
|
||||||
|
for error in jedi.Script(path=path)._analysis():
|
||||||
print(error)
|
print(error)
|
||||||
|
|||||||
Reference in New Issue
Block a user