Skip to content

Conversation

@mbland
Copy link
Owner

@mbland mbland commented Jan 31, 2017

This updates _GO_USE_MODULES to provide correct @go command script scope for plugin modules. It is germane to #120.

Whereas #136 implemented correctly-scoped lookup of other plugin modules, this allows any module, plugin or otherwise, to invoke its own command scripts or plugin command scripts via @go.

This PR contains lots of granular commits that contain individual refactoring steps building up to the final one that implements correct @go command scope. The last commit is the only one that introduces fundamentally new behavior.

This eliminates a slight amount of complexity from both
`@go.search_plugins`, `lib/internal/path`, and `lib/internal/use`.
This is part of the refactoring of `_GO_USE_MODULES` to provide correct
`@go` command script scope for plugin modules.
This is part of the refactoring of `_GO_USE_MODULES` to provide correct
`@go` command script scope for plugin modules.

This also eliminates the need for `_@go.set_use_caller`.
This is part of the refactoring of `_GO_USE_MODULES` to provide correct
`@go` command script scope for plugin modules.
This is part of the refactoring of `_GO_USE_MODULES` to provide correct
`@go` command script scope for plugin modules.
This is part of the refactoring of `_GO_USE_MODULES` to provide correct
`@go` command script scope for plugin modules.

Specifically, it allows the `@go plugins` builtin command to produce the
proper output relative to each plugin, but more generally, it makes
sense to strip a plugin's `_GO_SCRIPTS_DIR` out of its
`_GO_PLUGINS_PATHS`, rather than just stripping it from
`_GO_SEARCH_PATHS`.
This is part of the refactoring of `_GO_USE_MODULES` to provide correct
`@go` command script scope for plugin modules.

Specifically, this makes sure that the module search paths are set
correctly independent of the `@go` function being called. This is to
ensure that modules behave as expected when imported before the
top-level `./go` script calls `@go`.
This concludes the refactoring of `_GO_USE_MODULES` to provide correct
`@go` command script scope for plugin modules. It is germane to #120.

Whereas #136 implemented correctly-scoped lookup of other plugin
modules, this allows any module, plugin or otherwise, to invoke its own
command scripts or plugin command scripts via `@go`.
@mbland mbland added this to the v1.4.0 milestone Jan 31, 2017
@mbland mbland self-assigned this Jan 31, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 95.157% when pulling 18f686c on plugin-scope into 4de3d6a on master.

@mbland mbland merged commit 41d8ba4 into master Jan 31, 2017
@mbland mbland deleted the plugin-scope branch January 31, 2017 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants