summaryrefslogtreecommitdiffstats
path: root/testing/gen-languages-all
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2020-03-24 21:59:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2020-03-24 21:59:15 +0000
commit63fad53303381388673073de580a32088a4ef0fe (patch)
treea2c5c329ee5e79a220fac7e079283235fecc0cda /testing/gen-languages-all
parentInitial commit. (diff)
downloadpre-commit-63fad53303381388673073de580a32088a4ef0fe.tar.xz
pre-commit-63fad53303381388673073de580a32088a4ef0fe.zip
Adding upstream version 2.2.0.upstream/2.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/gen-languages-all')
-rwxr-xr-xtesting/gen-languages-all28
1 files changed, 28 insertions, 0 deletions
diff --git a/testing/gen-languages-all b/testing/gen-languages-all
new file mode 100755
index 0000000..6d0b26f
--- /dev/null
+++ b/testing/gen-languages-all
@@ -0,0 +1,28 @@
+#!/usr/bin/env python3
+import sys
+
+LANGUAGES = [
+ 'conda', 'docker', 'docker_image', 'fail', 'golang', 'node', 'perl',
+ 'pygrep', 'python', 'python_venv', '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__':
+ exit(main())