Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1296031

Re: Indent issus in kernel module development

From "Austin S. Hemmelgarn" <ahferroin7@gmail.com>
Newsgroups linux.kernel
Subject Re: Indent issus in kernel module development
Date 2015-12-21 16:20 +0100
Message-ID <qIapH-88b-3@gated-at.bofh.it> (permalink)
References <qHf85-5om-7@gated-at.bofh.it> <qHfrs-5uX-7@gated-at.bofh.it> <qHiIG-7zM-7@gated-at.bofh.it> <qHj21-7Wr-5@gated-at.bofh.it> <qHLKG-Hp-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Indent issus in kernel module development chunguang qu <quchunguang@gmail.com> - 2015-12-19 03:10 +0100
  Re: Indent issus in kernel module development Randy Dunlap <rdunlap@infradead.org> - 2015-12-19 03:30 +0100
    Re: Indent issus in kernel module development chunguang qu <quchunguang@gmail.com> - 2015-12-19 07:00 +0100
      Re: Indent issus in kernel module development Joe Perches <joe@perches.com> - 2015-12-19 07:20 +0100
        Re: Indent issus in kernel module development chunguang qu <quchunguang@gmail.com> - 2015-12-20 14:00 +0100
          Re: Indent issus in kernel module development "Austin S. Hemmelgarn" <ahferroin7@gmail.com> - 2015-12-21 16:20 +0100

csiph-web