문제

When trying to run epylint.py_run to lint a file I pass in the filename and command-line options as a string, as specified in the docs. The file gets analyzed but the command-line options I pass aren't being applied. How can I get the function to apply the options I'm passing?

도움이 되었습니까?

해결책

There is a bug in epylint.Run which omit to give the options, hence your problem.

In your case you should rather use the lint(filename, options) function, where options should be passed as a list of strings).

다른 팁

There is a bug in epylint.Run. I've submitted an issue. This should work:

def Run():
    if len(sys.argv) == 1:
        print("Usage: %s [options] <filename or module>" % sys.argv[0])
        sys.exit(1)
    elif not osp.exists(sys.argv[-1]):
        print("%s does not exist" % sys.argv[1])
        sys.exit(1)
    else:
        sys.exit(lint(options=sys.argv[:-1], filename=sys.argv[-1]))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top