8000 Possibly wrong command line split behavior on Windows · Issue #456 · akaihola/darker · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Possibly wrong command line split behavior on Windows #456
Closed
@akaihola

Description

@akaihola

A full linter command line can be provided to Darker, e.g.

darker --lint="mypy --strict" .

Splitting that command line into parts is done using shlex.split(), and on Windows the posix=False argument is added so backslashes as directory separators work correctly (todo: check this, not 100% sure).

This works otherwise as expected, but if there's a quoted parameter, the quotes don't get stripped properly:

>>> import shlex
>>> shlex.split('pylint --ignore "setup.py"'')
['pylint', '--ignore', '"setup.py"']  # on Windows

which is different from how it behaves on Unix.

A test xfail on Windows is added to test_check_linter_output() to mark this as a known issue but have the test suite still pass.

I'm not sure if the quotes are still removed correctly on Windows.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0