Skip to content

Commit

Permalink
Remove the canonicalize and identify niche commands (#209)
Browse files Browse the repository at this point in the history
These are very specialised commands that pretty much nobody seems to be
using right now.

Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti authored Jan 14, 2025
1 parent 7e5001a commit b880248
Show file tree
Hide file tree
Showing 26 changed files with 0 additions and 811 deletions.
2 changes: 0 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ documentation:
- [`jsonschema lint`](./docs/lint.markdown)
- [`jsonschema bundle`](./docs/bundle.markdown) (for inlining remote references in a schema)
- [`jsonschema frame`](./docs/frame.markdown) (for debugging references)
- [`jsonschema identify`](./docs/identify.markdown)
- [`jsonschema canonicalize`](./docs/canonicalize.markdown) (for static analysis)
- [`jsonschema encode`](./docs/encode.markdown) (for binary compression)
- [`jsonschema decode`](./docs/decode.markdown)

Expand Down
83 changes: 0 additions & 83 deletions docs/canonicalize.markdown

This file was deleted.

48 changes: 0 additions & 48 deletions docs/identify.markdown

This file was deleted.

2 changes: 0 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ add_executable(jsonschema_cli
command_lint.cc
command_metaschema.cc
command_validate.cc
command_identify.cc
command_canonicalize.cc
command_encode.cc
command_decode.cc)

Expand Down
2 changes: 0 additions & 2 deletions src/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ auto test(const std::span<const std::string> &arguments) -> int;
auto lint(const std::span<const std::string> &arguments) -> int;
auto validate(const std::span<const std::string> &arguments) -> int;
auto metaschema(const std::span<const std::string> &arguments) -> int;
auto identify(const std::span<const std::string> &arguments) -> int;
auto canonicalize(const std::span<const std::string> &arguments) -> int;
auto encode(const std::span<const std::string> &arguments) -> int;
auto decode(const std::span<const std::string> &arguments) -> int;
} // namespace sourcemeta::jsonschema::cli
Expand Down
30 changes: 0 additions & 30 deletions src/command_canonicalize.cc

This file was deleted.

132 changes: 0 additions & 132 deletions src/command_identify.cc

This file was deleted.

14 changes: 0 additions & 14 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,6 @@ Global Options:
Statically analyse a schema to display schema locations and
references in a human-readable manner.
identify <schema.json> [--relative-to/-t <uri>]
Print the URI of the given schema to standard output, optionally
relative to a given base URI.
canonicalize <schema.json>
Pre-process a JSON Schema into JSON BinPack's canonical form
for static analysis.
encode <document.json|.jsonl> <output.binpack>
Encode a JSON document or JSONL dataset using JSON BinPack.
Expand Down Expand Up @@ -97,10 +87,6 @@ auto jsonschema_main(const std::string &program, const std::string &command,
return sourcemeta::jsonschema::cli::metaschema(arguments);
} else if (command == "test") {
return sourcemeta::jsonschema::cli::test(arguments);
} else if (command == "identify") {
return sourcemeta::jsonschema::cli::identify(arguments);
} else if (command == "canonicalize") {
return sourcemeta::jsonschema::cli::canonicalize(arguments);
} else if (command == "encode") {
return sourcemeta::jsonschema::cli::encode(arguments);
} else if (command == "decode") {
Expand Down
21 changes: 0 additions & 21 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -144,32 +144,11 @@ add_jsonschema_test_unix(frame/fail_no_schema)
add_jsonschema_test_unix(frame/fail_schema_invalid_json)
add_jsonschema_test_unix(frame/fail_unknown_metaschema)

# Identify
add_jsonschema_test_unix(identify/fail_resolve_from_no_match)
add_jsonschema_test_unix(identify/fail_resolve_from_equal)
add_jsonschema_test_unix(identify/fail_invalid_id)
add_jsonschema_test_unix(identify/fail_invalid_id_uri)
add_jsonschema_test_unix(identify/fail_invalid_base_uri)
add_jsonschema_test_unix(identify/fail_no_id)
add_jsonschema_test_unix(identify/fail_no_schema)
add_jsonschema_test_unix(identify/pass_with_official_dialect)
add_jsonschema_test_unix(identify/pass_with_official_dialect_verbose)
add_jsonschema_test_unix(identify/pass_with_resolve_from)
add_jsonschema_test_unix(identify/pass_with_resolve_from_verbose)
add_jsonschema_test_unix(identify/pass_with_unknown_dialect)
add_jsonschema_test_unix(identify/pass_with_unknown_dialect_verbose)

# Lint
add_jsonschema_test_unix(lint/pass_lint_fix)
add_jsonschema_test_unix(lint/pass_lint_no_fix)
add_jsonschema_test_unix(lint/fail_lint)

# Canonicalize
add_jsonschema_test_unix(canonicalize/pass_1)
add_jsonschema_test_unix(canonicalize/fail_no_schema)
add_jsonschema_test_unix(canonicalize/fail_schema_invalid_json)
add_jsonschema_test_unix(canonicalize/fail_unknown_metaschema)

# Encode
add_jsonschema_test_unix(encode/pass_schema_less)
add_jsonschema_test_unix(encode/pass_schema_less_jsonl)
Expand Down
Loading

0 comments on commit b880248

Please sign in to comment.