Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibly wrong command line split behavior on Windows #456

Closed
akaihola opened this issue Jan 13, 2023 · 1 comment
Closed

Possibly wrong command line split behavior on Windows #456

akaihola opened this issue Jan 13, 2023 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@akaihola
Copy link
Owner

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.

@akaihola akaihola added the question Further information is requested label Jan 13, 2023
@akaihola akaihola added this to the 1.8.0 milestone Jan 13, 2023
@akaihola akaihola self-assigned this Jan 13, 2023
akaihola added a commit that referenced this issue Jan 13, 2023
akaihola added a commit that referenced this issue Jan 13, 2023
@akaihola
Copy link
Owner Author

Moved to akaihola/graylint#27 together with the linting support implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Development

No branches or pull requests

1 participant