btrfs-progs: Add basic .editorconfig
diff mbox series

Message ID 20200728012409.130252-1-dxu@dxuuu.xyz
State New
Headers show
Series
  • btrfs-progs: Add basic .editorconfig
Related show

Commit Message

Daniel Xu July 28, 2020, 1:24 a.m. UTC
Not all contributors work on projects that use linux kernel coding
style. This commit adds a basic editorconfig [0] to assist contributors
with managing configuration.

[0]: https://editorconfig.org/

Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
---
 .editorconfig | 10 ++++++++++
 .gitignore    |  1 +
 2 files changed, 11 insertions(+)
 create mode 100644 .editorconfig

--
2.27.0

Comments

Qu Wenruo July 28, 2020, 1:50 a.m. UTC | #1
On 2020/7/28 上午9:24, Daniel Xu wrote:
> Not all contributors work on projects that use linux kernel coding
> style. This commit adds a basic editorconfig [0] to assist contributors
> with managing configuration.
> 
> [0]: https://editorconfig.org/

I like the idea of the generic style file.
It's just one single file for all editors.

Although most btrfs developers I know use vim, and it's not supported
natively, it shouldn't be a big problem, a plugin would handle it
without problem.

> 
> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>

Reviewed-by: Qu Wenruo <wqu@suse.com>

But a small nitpick inlined below.

> ---
>  .editorconfig | 10 ++++++++++
>  .gitignore    |  1 +
>  2 files changed, 11 insertions(+)
>  create mode 100644 .editorconfig
> 
> diff --git a/.editorconfig b/.editorconfig
> new file mode 100644
> index 00000000..2829cfbe
> --- /dev/null
> +++ b/.editorconfig
> @@ -0,0 +1,10 @@
> +[*]
> +end_of_line = lf
> +insert_final_newline = true
> +trim_trailing_whitespace = true
> +charset = utf-8
> +indent_style = space
> +indent_size = 8
> +
> +[*.py]
> +indent_size = 4
> diff --git a/.gitignore b/.gitignore
> index aadf9ae7..1c70ec94 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -65,6 +65,7 @@
>  /cscope.in.out
>  /cscope.po.out
>  .*
> +!.editorconfig

You can force add that file and git should handle it without problem,
and later modification would also be traced by git.

Thanks,
Qu

> 
>  /Documentation/Makefile
>  /Documentation/*.html
> --
> 2.27.0
>
Qu Wenruo July 28, 2020, 1:57 a.m. UTC | #2
On 2020/7/28 上午9:50, Qu Wenruo wrote:
> 
> 
> On 2020/7/28 上午9:24, Daniel Xu wrote:
>> Not all contributors work on projects that use linux kernel coding
>> style. This commit adds a basic editorconfig [0] to assist contributors
>> with managing configuration.
>>
>> [0]: https://editorconfig.org/
> 
> I like the idea of the generic style file.
> It's just one single file for all editors.
> 
> Although most btrfs developers I know use vim, and it's not supported
> natively, it shouldn't be a big problem, a plugin would handle it
> without problem.
> 
>>
>> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
> 
> Reviewed-by: Qu Wenruo <wqu@suse.com>
> 
> But a small nitpick inlined below.
> 
>> ---
>>  .editorconfig | 10 ++++++++++
>>  .gitignore    |  1 +
>>  2 files changed, 11 insertions(+)
>>  create mode 100644 .editorconfig
>>
>> diff --git a/.editorconfig b/.editorconfig
>> new file mode 100644
>> index 00000000..2829cfbe
>> --- /dev/null
>> +++ b/.editorconfig
>> @@ -0,0 +1,10 @@
>> +[*]
>> +end_of_line = lf
>> +insert_final_newline = true
>> +trim_trailing_whitespace = true
>> +charset = utf-8
>> +indent_style = space

Wait for a minute, does that mean, we use space as indent?
IIRC kernel code style goes tab if possible?

Thanks,
Qu

>> +indent_size = 8
>> +
>> +[*.py]
>> +indent_size = 4
>> diff --git a/.gitignore b/.gitignore
>> index aadf9ae7..1c70ec94 100644
>> --- a/.gitignore
>> +++ b/.gitignore
>> @@ -65,6 +65,7 @@
>>  /cscope.in.out
>>  /cscope.po.out
>>  .*
>> +!.editorconfig
> 
> You can force add that file and git should handle it without problem,
> and later modification would also be traced by git.
> 
> Thanks,
> Qu
> 
>>
>>  /Documentation/Makefile
>>  /Documentation/*.html
>> --
>> 2.27.0
>>
>
Daniel Xu July 28, 2020, 1:57 a.m. UTC | #3
On Mon Jul 27, 2020 at 6:57 PM PDT, Qu Wenruo wrote:
>
>
> On 2020/7/28 上午9:50, Qu Wenruo wrote:
> > 
> > 
> > On 2020/7/28 上午9:24, Daniel Xu wrote:
> >> Not all contributors work on projects that use linux kernel coding
> >> style. This commit adds a basic editorconfig [0] to assist contributors
> >> with managing configuration.
> >>
> >> [0]: https://editorconfig.org/
> > 
> > I like the idea of the generic style file.
> > It's just one single file for all editors.
> > 
> > Although most btrfs developers I know use vim, and it's not supported
> > natively, it shouldn't be a big problem, a plugin would handle it
> > without problem.
> > 
> >>
> >> Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
> > 
> > Reviewed-by: Qu Wenruo <wqu@suse.com>
> > 
> > But a small nitpick inlined below.
> > 
> >> ---
> >>  .editorconfig | 10 ++++++++++
> >>  .gitignore    |  1 +
> >>  2 files changed, 11 insertions(+)
> >>  create mode 100644 .editorconfig
> >>
> >> diff --git a/.editorconfig b/.editorconfig
> >> new file mode 100644
> >> index 00000000..2829cfbe
> >> --- /dev/null
> >> +++ b/.editorconfig
> >> @@ -0,0 +1,10 @@
> >> +[*]
> >> +end_of_line = lf
> >> +insert_final_newline = true
> >> +trim_trailing_whitespace = true
> >> +charset = utf-8
> >> +indent_style = space
>
> Wait for a minute, does that mean, we use space as indent?
> IIRC kernel code style goes tab if possible?
>
> Thanks,
> Qu

Sorry, that was mistake. Just sent out a V2 before I saw your email.

Thanks,
Daniel

Patch
diff mbox series

diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 00000000..2829cfbe
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,10 @@ 
+[*]
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
+charset = utf-8
+indent_style = space
+indent_size = 8
+
+[*.py]
+indent_size = 4
diff --git a/.gitignore b/.gitignore
index aadf9ae7..1c70ec94 100644
--- a/.gitignore
+++ b/.gitignore
@@ -65,6 +65,7 @@ 
 /cscope.in.out
 /cscope.po.out
 .*
+!.editorconfig

 /Documentation/Makefile
 /Documentation/*.html