From: "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
To: chunguang qu <quchunguang@gmail.com>,
Joe Perches <joe@perches.com>,
linux-kernel@vger.kernel.org
Subject: Re: Indent issus in kernel module development
Date: Mon, 21 Dec 2015 10:13:09 -0500 [thread overview]
Message-ID: <56781705.5060900@gmail.com> (raw)
In-Reply-To: <CABk77DhDTetFTRbOUaJ9+VE_k1RZUo2bDhWjSv8syXJifBApTA@mail.gmail.com>
On 2015-12-20 07:52, chunguang qu wrote:
> I tried it. Not worked unfortunately,.
>
> ```bash
> $ ~/share/linux/scripts/checkpatch.pl --fix --types=spacing testcompletion.c
> total: 0 errors, 0 warnings, 0 lines checked
>
> testcompletion.c has no obvious style problems and is ready for submission.
>
> NOTE: Used message types: SPACING
> ```
You might try something with clang-format. It doesn't have a built-in
style option for the kernel (probably because the kernel can't currently
be compiled with Clang/LLVM, but Linux does qualify for the first two
criteria for having a new style default added, so if someone wants to
actually work on it, they could probably get it included), but something
like this for the config should get you pretty close:
BasedOnStyle: LLVM
IndentWidth: 8
UseTab: Always
BreakBeforeBraces: Linux
AllowShortIfStatementOnASingleLine: false
IndentCaseLabels: false
I'm pretty certain that this doesn't cover everything from CodingStyle,
but it should cover most things, and most of the other stuff should be
relatively easily scriptable using regex based replacements.
>
> 2015-12-19 14:16 GMT+08:00 Joe Perches <joe@perches.com>:
>> On Sat, 2015-12-19 at 13:50 +0800, chunguang qu wrote:
>>> Yes, I just tried `scripts/Lindent` and it has the same problem.
>>>
>>> I had compared the source of `Lindent` with `-linux` option of
>>> `indent` long time ago, there's seems no major difference.
>>> So i used `indent -linux <file>` above.
>>>
>>> Thanks for your advice about `emace`, but `vi` is my only editor for
>>> dozens of years.
>>
>> Try:
>>
>> $ ./scripts/checkpatch.pl --fix --types=spacing <file>
>>
prev parent reply other threads:[~2015-12-21 15:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-19 2:07 Indent issus in kernel module development chunguang qu
2015-12-19 2:26 ` Randy Dunlap
2015-12-19 5:50 ` chunguang qu
2015-12-19 6:16 ` Joe Perches
2015-12-20 12:52 ` chunguang qu
2015-12-21 15:13 ` Austin S. Hemmelgarn [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56781705.5060900@gmail.com \
--to=ahferroin7@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=quchunguang@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox