From 2148f244cafea4b8a0e0cf37ef03dcc02e8a6d19 Mon Sep 17 00:00:00 2001 From: ochafik Date: Mon, 8 Apr 2024 19:32:30 +0100 Subject: [PATCH] json: rename python schema converter to make import easier --- .../{json-schema-to-grammar.py => json_schema_to_grammar.py} | 2 +- examples/regex-to-grammar.py | 2 +- examples/ts-type-to-grammar.sh | 4 ++-- tests/test-json-schema-to-grammar.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename examples/{json-schema-to-grammar.py => json_schema_to_grammar.py} (99%) diff --git a/examples/json-schema-to-grammar.py b/examples/json_schema_to_grammar.py similarity index 99% rename from examples/json-schema-to-grammar.py rename to examples/json_schema_to_grammar.py index 91dd734cc..59265c4d6 100755 --- a/examples/json-schema-to-grammar.py +++ b/examples/json_schema_to_grammar.py @@ -547,4 +547,4 @@ def main(args_in = None): if __name__ == '__main__': - main() + main() \ No newline at end of file diff --git a/examples/regex-to-grammar.py b/examples/regex-to-grammar.py index c98118e95..5cd9210a4 100644 --- a/examples/regex-to-grammar.py +++ b/examples/regex-to-grammar.py @@ -8,7 +8,7 @@ print(subprocess.check_output( "python", os.path.join( os.path.dirname(os.path.realpath(__file__)), - "json-schema-to-grammar.py"), + "json_schema_to_grammar.py"), *rest, "-", "--raw-pattern", diff --git a/examples/ts-type-to-grammar.sh b/examples/ts-type-to-grammar.sh index a7ad00173..9abba2a3d 100755 --- a/examples/ts-type-to-grammar.sh +++ b/examples/ts-type-to-grammar.sh @@ -1,7 +1,7 @@ #!/bin/bash # # ./examples/ts-type-to-grammar.sh "{a:string,b:string,c?:string}" -# python examples/json-schema-to-grammar.py https://json.schemastore.org/tsconfig.json +# python examples/json_schema_to_grammar.py https://json.schemastore.org/tsconfig.json # set -euo pipefail @@ -25,4 +25,4 @@ npx ts-json-schema-generator --unstable --no-top-ref --path "$DTS_FILE" --type M # https://github.com/YousefED/typescript-json-schema # npx typescript-json-schema --defaultProps --required "$DTS_FILE" MyType | tee "$SCHEMA_FILE" >&2 -./examples/json-schema-to-grammar.py "$SCHEMA_FILE" +./examples/json_schema_to_grammar.py "$SCHEMA_FILE" diff --git a/tests/test-json-schema-to-grammar.cpp b/tests/test-json-schema-to-grammar.cpp index 4d110cf5a..848b925a8 100755 --- a/tests/test-json-schema-to-grammar.cpp +++ b/tests/test-json-schema-to-grammar.cpp @@ -816,7 +816,7 @@ int main() { test_all("Python", [](const TestCase & tc) { write("test-json-schema-input.tmp", tc.schema); tc.verify_status(std::system( - "python ./examples/json-schema-to-grammar.py test-json-schema-input.tmp > test-grammar-output.tmp") == 0 ? SUCCESS : FAILURE); + "python ./examples/json_schema_to_grammar.py test-json-schema-input.tmp > test-grammar-output.tmp") == 0 ? SUCCESS : FAILURE); tc.verify(read("test-grammar-output.tmp")); }); } else {