]> git.madduck.net Git - etc/vim.git/blob - action.yml

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Pin setuptools-scm build time dependency (#2457)
[etc/vim.git] / action.yml
1 name: "Black"
2 description: "The uncompromising Python code formatter."
3 author: "Łukasz Langa and contributors to Black"
4 inputs:
5   options:
6     description:
7       "Options passed to Black. Use `black --help` to see available options. Default:
8       '--check'"
9     required: false
10     default: "--check --diff"
11   src:
12     description: "Source to run Black. Default: '.'"
13     required: false
14     default: "."
15   black_args:
16     description: "[DEPRECATED] Black input arguments."
17     required: false
18     default: ""
19     deprecationMessage:
20       "Input `with.black_args` is deprecated. Use `with.options` and `with.src` instead."
21   version:
22     description: 'Python Version specifier (PEP440) - e.g. "21.5b1"'
23     required: false
24     default: ""
25 branding:
26   color: "black"
27   icon: "check-circle"
28 runs:
29   using: composite
30   steps:
31     - run: |
32         # Exists since using github.action_path + path to main script doesn't work because bash
33         # interprets the backslashes in github.action_path (which are used when the runner OS
34         # is Windows) destroying the path to the target file.
35         #
36         # Also semicolons are necessary because I can't get the newlines to work
37         entrypoint="import sys;
38         import subprocess;
39         from pathlib import Path;
40
41         MAIN_SCRIPT = Path(r'${{ github.action_path }}') / 'action' / 'main.py';
42
43         proc = subprocess.run([sys.executable, str(MAIN_SCRIPT)]);
44         sys.exit(proc.returncode)
45         "
46
47         if [ "$RUNNER_OS" == "Windows" ]; then
48           echo $entrypoint | python
49         else
50           echo $entrypoint | python3
51         fi
52       env:
53         # TODO: Remove once https://github.com/actions/runner/issues/665 is fixed.
54         INPUT_OPTIONS: ${{ inputs.options }}
55         INPUT_SRC: ${{ inputs.src }}
56         INPUT_BLACK_ARGS: ${{ inputs.black_args }}
57         INPUT_VERSION: ${{ inputs.version }}
58         pythonioencoding: utf-8
59       shell: bash