Add a coursier_launch integration

This is a follow up to the repository based coursier integration. The
standard coursier integration is to this integration what the docker
integration is to the docker_image integration.

This is meant to target either maven coordinates or coursier apps
directly without depending on a hook repository containing app
descriptors and hook configs making this integration highly suitable
for local hooks.

An example of hook local targets are bellow
```yaml
- repo: local
  hooks:
    - id: scalafmt
      name: scalafmt
      entry: scalafmt # coursier app target
      language: coursier_launch
      files: (\.scala|\.sbt|\.sc)$
    - id: scalafix
      name: scalafix
      entry: ch.epfl.scala:::scalafix-cli:latest.release # maven coordinates target
      language: coursier_launch
      files: (\.scala|\.sbt|\.sc)$
    - id: echo-java
      name: echo-java
      entry: echo-java
      language: coursier_launch
      args: ["--", "hello from java"] # forward arguments to the app
```
This commit is contained in:
Joseph Moniz 2020-11-06 12:55:21 -05:00
parent c972205214
commit 0603c3c931
5 changed files with 41 additions and 4 deletions

View file

@ -205,6 +205,15 @@ def test_run_a_coursier_hook(tempdir_factory, store):
)
@skipif_cant_run_coursier # pragma: win32 no cover
def test_run_a_coursier_launch_hook(tempdir_factory, store, hook_id):
_test_hook_repo(
tempdir_factory, store, 'coursier_hooks_repo',
'echo-java',
['Hello World from coursier'], b'Hello World from coursier\n',
)
@skipif_cant_run_docker # pragma: win32 no cover
def test_run_a_docker_hook(tempdir_factory, store):
_test_hook_repo(