diff mbox series

[ovs-dev,1/4] .gitignore: add clangd configuration file

Message ID 20240620085906.153885-1-whitecrowbar@gmail.com
State Superseded
Delegated to: aaron conole
Headers show
Series [ovs-dev,1/4] .gitignore: add clangd configuration file | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

Grigorii Nazarov June 20, 2024, 8:58 a.m. UTC
Signed-off-by: Grigorii Nazarov <whitecrowbar@gmail.com>
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

Comments

Aaron Conole June 20, 2024, 6:52 p.m. UTC | #1
Grigorii Nazarov <whitecrowbar@gmail.com> writes:

> Signed-off-by: Grigorii Nazarov <whitecrowbar@gmail.com>
> ---

Why is this file existing?  Maybe it would be better to generate the
compile_commands.json in automake?  Or generate it via the makefile?

>  .gitignore | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/.gitignore b/.gitignore
> index 26ed8d3d0..3c7250159 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -79,3 +79,4 @@ testsuite.tmp.orig
>  /Documentation/_build
>  /.venv
>  /cxx-check
> +/compile_flags.txt
Grigorii Nazarov June 25, 2024, 8:53 a.m. UTC | #2
On Thursday, June 20, 2024 9:52:07 PM GMT+3 Aaron Conole wrote:
> Why is this file existing?  Maybe it would be better to generate the
> compile_commands.json in automake?  Or generate it via the makefile?
I'm not checking in the file. It's local configuration file, used by clangd, 
which is clang-based language server used by IDEs like Visual Studio Code. It 
shouldn't be generated by project files and strictly speaking is not part of a 
project in the first place. I found some other local files being mentioned in 
.gitignore, and thus considered adding this one. In general it's a common 
practice to gitignore files like that. I can work it out differently if it's not 
to be here.

> >  .gitignore | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/.gitignore b/.gitignore
> > index 26ed8d3d0..3c7250159 100644
> > --- a/.gitignore
> > +++ b/.gitignore
> > @@ -79,3 +79,4 @@ testsuite.tmp.orig
> > 
> >  /Documentation/_build
> >  /.venv
> >  /cxx-check
> > 
> > +/compile_flags.txt
Aaron Conole June 27, 2024, 1:43 p.m. UTC | #3
Grigorii Nazarov <whitecrowbar@gmail.com> writes:

> On Thursday, June 20, 2024 9:52:07 PM GMT+3 Aaron Conole wrote:
>> Why is this file existing?  Maybe it would be better to generate the
>> compile_commands.json in automake?  Or generate it via the makefile?
> I'm not checking in the file. It's local configuration file, used by clangd, 
> which is clang-based language server used by IDEs like Visual Studio Code. It 
> shouldn't be generated by project files and strictly speaking is not part of a 
> project in the first place. I found some other local files being mentioned in 
> .gitignore, and thus considered adding this one. In general it's a common 
> practice to gitignore files like that. I can work it out differently
> if it's not
> to be here.

My understanding is that the compile_flags.txt is editor / clangd
generated when there is no compile_commands.json file.  My suggestion is
to add the relevant code to the makefile to generate the
compile_commands.json file, and then add that to the gitignore as well.

The reason is that after reading quickly on it, I see that the
compile_commands.json file supposedly can accommodate per-file flags,
where as compile_flags.txt cannot.  It seems that having this additional
support would be quite useful, and I don't think it would be too
difficult to add?  At least from documentation here:

https://github.com/Sarcasm/notes/blob/master/dev/compilation-database.rst#clang

Do you think this would be okay for you to do?

>> >  .gitignore | 1 +
>> >  1 file changed, 1 insertion(+)
>> > 
>> > diff --git a/.gitignore b/.gitignore
>> > index 26ed8d3d0..3c7250159 100644
>> > --- a/.gitignore
>> > +++ b/.gitignore
>> > @@ -79,3 +79,4 @@ testsuite.tmp.orig
>> > 
>> >  /Documentation/_build
>> >  /.venv
>> >  /cxx-check
>> > 
>> > +/compile_flags.txt
diff mbox series

Patch

diff --git a/.gitignore b/.gitignore
index 26ed8d3d0..3c7250159 100644
--- a/.gitignore
+++ b/.gitignore
@@ -79,3 +79,4 @@  testsuite.tmp.orig
 /Documentation/_build
 /.venv
 /cxx-check
+/compile_flags.txt