> I think it should be fine to add these:
>
>     charset = utf-8
>     end_of_line = lf
>
> The exception are some files under windows/vs*. Those files will
> hopefully be gone in the future though. They use LF, not CR+LF but have
> BOM:

I wasn't sure how to handle potential issues with utf-8 and
translations files, compressed test files, and visual studio files,
but after a bit of research your solution looks great.

> Is it good enough or did I add bad bugs? :-)

I apologize for an error in the original patch. I had only used
editorconfig files in simple projects before, so I didn't know that
curly braces are required to apply the formatting to two or more
globs. Here is the adjusted version of the editorconfig file with
those changes:

# To use this config on your editor, follow the instructions at:
# https://editorconfig.org/

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[**{.{c,h,S,map,sh,bash},Makefile*,configure.ac,po4a/update-po,src/scripts/{xzless,xzmore}.in}]
indent_style = tab
indent_size = 8

[/src/scripts/{xzdiff,xzgrep}.in]
indent_style = space
indent_size = 2

[{CMakeLists.txt,*.cmake}]
indent_style = space
indent_size = 4

[{*.vcxproj,xz_win.sln}]
charset = utf-8-bom

Two questions I have are:
1. Why are xzgrep.in and xzdiff.in formatted differently than
xzless.in and xzmore.in?

> I guess it makes sense to set also indent_size = 8 because viewing the
> files with any other setting will look weird when long lines are
> wrapped and can editing can result in wrong word wrapping.

2. Why do you use tab width 8 for your source files? I have no problem
with tab width 8, I'm just used to using width 4 since it's nice for
viewing several files on the same screen or for people with small
screens. Either way, it's your preference and I will follow your lead.

Jia Tan

Reply via email to