Skip to content
This repository has been archived by the owner on Feb 11, 2022. It is now read-only.

IDE support: Convert Windows absolute filename arguments #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wmanley
Copy link
Contributor

@wmanley wmanley commented Jan 26, 2018

...to unix-style absolute paths.

We don't touch paths outside the test-pack as we don't know how to map them
into the docker-container. We don't touch relative paths inside the
test-pack because we don't have a reliable heuristic to identify them.

This is useful for IDE integration. You can configure Eclipse to run
stbt-docker stbt lint $filename or
stbt-docker stbt auto-selftest generate $filename, but it won't make
$filename relative to the test-pack route. We fix that by converting it
here.

I can think of one place where this heuristic will fail. An argument
--filename=c:\test-pack\tests\my_test.py would not trigger rewriting.
I'm sure there are others too.

TODO:

  • Decide that it's a good idea
  • Investigate exactly which strings os.path.isabs considers an absolute path on Windows

...to unix-style absolute paths.

We don't touch paths outside the test-pack as we don't know how to map them
into the docker-container.  We don't touch relative paths inside the
test-pack because we don't have a reliable heuristic to identify them.

This is useful for IDE integration.  You can configure Eclipse to run
`stbt-docker stbt lint $filename` or
`stbt-docker stbt auto-selftest generate $filename`, but it won't make
`$filename` relative to the test-pack route.  We fix that by converting it
here.

I can think of one place where this heuristic will fail.  An argument
`--filename=c:\test-pack\tests\my_test.py` would not trigger rewriting.
I'm sure there are others too.
@wmanley wmanley force-pushed the windows-convert-abs-paths branch from b6bfa9e to fe186a5 Compare January 27, 2018 14:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant