summaryrefslogtreecommitdiffstats
path: root/testing/gen-languages-all
blob: c933c1435dfcc698e0bd60698176fa23fa385c1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python3
import sys

LANGUAGES = [
    'conda', 'coursier', 'dart', 'docker', 'docker_image', 'dotnet', 'fail',
    'golang', 'node', 'perl', 'pygrep', 'python', 'r', 'ruby', 'rust',
    'script', 'swift', 'system',
]
FIELDS = [
    'ENVIRONMENT_DIR', 'get_default_version', 'healthy', 'install_environment',
    'run_hook',
]


def main() -> int:
    print(f'    # BEGIN GENERATED ({sys.argv[0]})')
    for lang in LANGUAGES:
        parts = [f'    {lang!r}: Language(name={lang!r}']
        for k in FIELDS:
            parts.append(f', {k}={lang}.{k}')
        parts.append('),  # noqa: E501')
        print(''.join(parts))
    print('    # END GENERATED')
    return 0


if __name__ == '__main__':
    raise SystemExit(main())