Skip to content

Conversation

@blowekamp
Copy link
Member

Change separator to match pre-commit configuration.

Add argparse interface to support multiple json file on the command line, and different verbosity levels.

Change separator to match pre-commit configuration.

Add argparse interface to support multiple json file on the command
line, and different verbosity levels.
@blowekamp blowekamp requested a review from zivy June 16, 2025 15:10

# Write beautified JSON back to the file
with open(json_file, 'w', encoding='utf-8') as fp:
json.dump(json_data, fp, indent=args.indent, separators=(",", ": "), ensure_ascii=False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for changing the default ensure_ascii from True to False? Are there non-ascii characters in the JSON files that should not be escaped?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are non-ascii characters in the JSON. In the documentation strings from ITK as I recall. I am unaware of a need for them to be escaped. In general we can use UTF-8 character encoding for text files.

@blowekamp blowekamp merged commit aa3145d into SimpleITK:master Jun 16, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants