Skip to content

Commit

Permalink
Merge branch 'list_intersections' of https://github.com/dmitrishastin…
Browse files Browse the repository at this point in the history
…/Open3D into list_intersections
  • Loading branch information
dmitrishastin committed Oct 29, 2023
2 parents 9d7dccf + bd0511a commit 58abef6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions util/check_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def _check_style(file_path, clang_format_bin):
"""
Returns (true, true) if (style, header) is valid.
"""
with open(file_path, 'r') as f:
with open(file_path, 'r', encoding='utf-8') as f:
is_valid_header = f.read().startswith(CppFormatter.standard_header)

cmd = [
Expand Down Expand Up @@ -156,7 +156,7 @@ def _check_style(file_path, style_config):
Returns (true, true) if (style, header) is valid.
"""

with open(file_path, 'r') as f:
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()
is_valid_header = (len(content) == 0 or content.startswith(
PythonFormatter.standard_header))
Expand Down Expand Up @@ -218,7 +218,7 @@ def _check_or_apply_style(file_path, style_config, apply):
are merged into one.
"""
# Ref: https://gist.github.com/oskopek/496c0d96c79fb6a13692657b39d7c709
with open(file_path, "r") as f:
with open(file_path, "r", encoding='utf-8') as f:
notebook = nbformat.read(f, as_version=nbformat.NO_CONVERT)
nbformat.validate(notebook)

Expand All @@ -241,7 +241,7 @@ def _check_or_apply_style(file_path, style_config, apply):
changed = True

if apply:
with open(file_path, "w") as f:
with open(file_path, "w", encoding='utf-8') as f:
nbformat.write(notebook, f, version=nbformat.NO_CONVERT)

return not changed
Expand Down Expand Up @@ -444,4 +444,4 @@ def main():


if __name__ == "__main__":
main()
main()

0 comments on commit 58abef6

Please sign in to comment.