You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by Li Jin <ic...@gmail.com> on 2022/04/28 14:54:28 UTC

[C++] Question about "Code style and Linting"

Hello!

I am preparing for submitting a PR and reading the "Code style and Linting"
section of the development doc:

https://github.com/apache/arrow/blob/master/docs/source/developers/cpp/development.rst#code-style-linting-and-ci

I got to the point that I am running
""
archery lint --cpplint --clang-format --clang-tidy --fix
""
but got
"""
ninja: error: unknown target 'format'
"""

and wonder what I might have done wrong?

Thanks,
Li

Re: [C++] Question about "Code style and Linting"

Posted by Li Jin <ic...@gmail.com>.
I see. Thanks for the quick reply!

On Thu, Apr 28, 2022 at 11:09 AM Antoine Pitrou <an...@python.org> wrote:

>
> Le 28/04/2022 à 17:07, Li Jin a écrit :
> > Aha thanks Antoine!
> >
> > After digging the log I think I found the issue:
> > "
> > -- clang-tidy 12 not found
> > -- clang-format 12 not found
> > "
> >
> > after installing those two it got me over that step..
> >
> > A side question - does running
> >
> > "
> > archery lint --cpplint --clang-format --clang-tidy --fix
> > "
> >
> > supposed to fix the lint / code style?
>
> Yes, where possible, otherwise it will list the errors for you
> (some of the tools used under the hood support automatic fixing, some
> don't).
>

Re: [C++] Question about "Code style and Linting"

Posted by Antoine Pitrou <an...@python.org>.
Le 28/04/2022 à 17:07, Li Jin a écrit :
> Aha thanks Antoine!
> 
> After digging the log I think I found the issue:
> "
> -- clang-tidy 12 not found
> -- clang-format 12 not found
> "
> 
> after installing those two it got me over that step..
> 
> A side question - does running
> 
> "
> archery lint --cpplint --clang-format --clang-tidy --fix
> "
> 
> supposed to fix the lint / code style?

Yes, where possible, otherwise it will list the errors for you
(some of the tools used under the hood support automatic fixing, some 
don't).

Re: [C++] Question about "Code style and Linting"

Posted by Li Jin <ic...@gmail.com>.
Aha thanks Antoine!

After digging the log I think I found the issue:
"
-- clang-tidy 12 not found
-- clang-format 12 not found
"

after installing those two it got me over that step..

A side question - does running

"
archery lint --cpplint --clang-format --clang-tidy --fix
"

supposed to fix the lint / code style?

On Thu, Apr 28, 2022 at 10:57 AM Antoine Pitrou <an...@python.org> wrote:

>
> Le 28/04/2022 à 16:54, Li Jin a écrit :
> > Hello!
> >
> > I am preparing for submitting a PR and reading the "Code style and
> Linting"
> > section of the development doc:
> >
> >
> https://github.com/apache/arrow/blob/master/docs/source/developers/cpp/development.rst#code-style-linting-and-ci
> >
> > I got to the point that I am running
> > ""
> > archery lint --cpplint --clang-format --clang-tidy --fix
> > ""
> > but got
> > """
> > ninja: error: unknown target 'format'
> > """
>
> Don't you get an error before that one? Can you post the entire log
> somewhere?
>

Re: [C++] Question about "Code style and Linting"

Posted by Antoine Pitrou <an...@python.org>.
Le 28/04/2022 à 16:54, Li Jin a écrit :
> Hello!
> 
> I am preparing for submitting a PR and reading the "Code style and Linting"
> section of the development doc:
> 
> https://github.com/apache/arrow/blob/master/docs/source/developers/cpp/development.rst#code-style-linting-and-ci
> 
> I got to the point that I am running
> ""
> archery lint --cpplint --clang-format --clang-tidy --fix
> ""
> but got
> """
> ninja: error: unknown target 'format'
> """

Don't you get an error before that one? Can you post the entire log 
somewhere?