Pregunta

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?

¿Fue útil?

Solución

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).

Otros consejos

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]))
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top