git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/?

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 18, 2014, 19:39 UTC
Message-ID
<xmqqa9cn8fep.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAPig+cQPZrHf_Bm_s_qmP6nX2dKcFNi+EUKoPObXHn1novuaHw@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 5 quoted lines
>> 1. Git style guidelines are somewhat different and less strict than
>> their Linux equivalents.
>
> Are checkpatch.pl's customization options, such as --ignore,
> insufficient to make it behave in the desired fashion for git?

If we are to officially encourage the use of checkpatch.pl, we should stress that mechanically adhering to its check is *not* the goal. As long as people view it as a tool to _help_ them spot obvious problems before sending their patches out, but the final responsibility to produce readable code is upon themselves, not the script, I am personally fine. Oftentimes we find an occasional long line that is slightly longer than 80-column limit a lot easier to read than chopping it artificially in the middle, for example.

Show 12 quoted lines
>> 2. Several patch threads bounce back and forth because of style fixes.
>> A checkpatch script added as a hook could help reduce these and use
>> more efficiently our time.
>> 3. As far as I can tell, checkpatch needs to be run from the root
>> folder of a linux repository clone. Cloning several hundred MBs for a
>> single perl script looks a little foolish to me.
>
> No need to clone the kernel. checkpatch.pl runs fine standalone with
> the --no-tree option.
>
>> So, is there any interest in adding a port of checkpatch.pl to
>> contrib/?

Not really. Maintaining the forked version is an additional pain we do not necessarily need. Are we going to carry a port of gcc and others?

I would rather prefer to add a paragraph in CodingGuidelines that points at the canonical location to obtain the script, e.g.

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl

and a procedure to run the script over their patch. I am too lazy to check myself, but there must be somewhere we mention the use of format-patch and send-email in the document, and use of the script to check would fall naturally between these two steps, I would think.

Previous: Eric SunshineNext: Junio C Hamano
Message 3 of 6 in “[GSoC14][RFC] Is there any interest in adding a port of checkpatch.pl to contrib/?”
  1. Jacopo NotarstefanoMar 18, 2014
  2. Eric SunshineMar 18, 2014
  3. Junio C HamanoMar 18, 2014
  4. Junio C HamanoMar 18, 2014
  5. Jacopo NotarstefanoMar 18, 2014
  6. demerphqMar 19, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.