llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: None (rmarker)

<details>
<summary>Changes</summary>

The dump_format_style.py script generates the clang-format style options 
documentation.
There was an issue where the script could include spurious characters in the 
output when run in windows. It appears that it wasn't defaulting to the correct 
encoding when reading the input.
This has been addressed by explicitly setting the encoding when opening the 
file.

---
Full diff: https://github.com/llvm/llvm-project/pull/79805.diff


1 Files Affected:

- (modified) clang/docs/tools/dump_format_style.py (+1-1) 


``````````diff
diff --git a/clang/docs/tools/dump_format_style.py 
b/clang/docs/tools/dump_format_style.py
index 75d4a044ef19f68..e41891f07de2e32 100755
--- a/clang/docs/tools/dump_format_style.py
+++ b/clang/docs/tools/dump_format_style.py
@@ -474,7 +474,7 @@ class State:
 opts = sorted(opts, key=lambda x: x.name)
 options_text = "\n\n".join(map(str, opts))
 
-with open(DOC_FILE) as f:
+with open(DOC_FILE, encoding="utf-8") as f:
     contents = f.read()
 
 contents = substitute(contents, "FORMAT_STYLE_OPTIONS", options_text)

``````````

</details>


https://github.com/llvm/llvm-project/pull/79805
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to