All of lore.kernel.org
 help / color / mirror / Atom feed
* Is there any tool can format source code according to kernel coding rule?
@ 2015-08-03  3:35 Nan Xiao
  2015-08-03  4:08 ` Chetan Nanda
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Nan Xiao @ 2015-08-03  3:35 UTC (permalink / raw)
  To: kernelnewbies

Hi all,

I am just wondering whether there is a script/tool which format source code
according to kernel coding rule automatically? Such as tab, space, brace,
etc.

Thanks very much in advance!

Best Regards
Nan Xiao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150803/7c8b0e73/attachment.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Is there any tool can format source code according to kernel coding rule?
  2015-08-03  3:35 Is there any tool can format source code according to kernel coding rule? Nan Xiao
@ 2015-08-03  4:08 ` Chetan Nanda
  2015-08-03  5:00 ` Aruna Hewapathirane
  2015-08-03 10:27 ` Daniel Baluta
  2 siblings, 0 replies; 6+ messages in thread
From: Chetan Nanda @ 2015-08-03  4:08 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Aug 3, 2015 at 9:05 AM, Nan Xiao <xiaonan830818@gmail.com> wrote:

> Hi all,
>
> I am just wondering whether there is a script/tool which format source
> code
> according to kernel coding rule automatically? Such as tab, space, brace,
> etc.
>
> Thanks very much in advance!
>

Bit of  googleing give you the lots of suggestion,
One such script is present inside linux tree 'scripts/Lindent'


>
Best Regards
> Nan Xiao
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
> ~ Chetan Nanda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150803/73b514f2/attachment.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Is there any tool can format source code according to kernel coding rule?
  2015-08-03  3:35 Is there any tool can format source code according to kernel coding rule? Nan Xiao
  2015-08-03  4:08 ` Chetan Nanda
@ 2015-08-03  5:00 ` Aruna Hewapathirane
       [not found]   ` <1248345698.1475860.1438595471226.JavaMail.zimbra@globaledgesoft.com>
  2015-08-03 10:27 ` Daniel Baluta
  2 siblings, 1 reply; 6+ messages in thread
From: Aruna Hewapathirane @ 2015-08-03  5:00 UTC (permalink / raw)
  To: kernelnewbies

> Hi all,
>
> I am just wondering whether there is a script/tool which format source
code
> according to kernel coding rule automatically? Such as tab, space, brace,
> etc.
>
> Thanks very much in advance!
>
> Best Regards
> Nan Xiao

If your using vi(m) in command mode type gg=G this will indent your code .
if your want kernel coding rules compatibility run your code through
scripts/Lindent. There is a vim plugi-in
http://www.vim.org/scripts/script.php?script_id=4369 will do the same.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150803/81de86f2/attachment.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Is there any tool can format source code according to kernel coding rule?
       [not found]   ` <1248345698.1475860.1438595471226.JavaMail.zimbra@globaledgesoft.com>
@ 2015-08-03  9:51     ` Rameshbabu
  0 siblings, 0 replies; 6+ messages in thread
From: Rameshbabu @ 2015-08-03  9:51 UTC (permalink / raw)
  To: kernelnewbies

Hi , 

There is a script in kernel source tree which used to check the code is in the proper coding style. 
But I don't about automatically changing code to specific coding style. 

The script name called checkpatch.pl present in kernel tree scripts/ directory. 

If you want to use this script. 

Make it as executable, by giving 

chmod +x checkpatch.pl 

./checkpatch.pl --no-tree -f <file_name> 


This will tell you what are all the coding style you have missed. So you can format your code 
to coding style easily. 

Thanks, 
Ramesh 


From: "Aruna Hewapathirane" <aruna.hewapathirane@gmail.com> 
To: "Nan Xiao" <xiaonan830818@gmail.com> 
Cc: "kernelnewbies" <kernelnewbies@kernelnewbies.org> 
Sent: Monday, August 3, 2015 10:30:47 AM 
Subject: Re: Is there any tool can format source code according to kernel coding rule? 

> Hi all, 
> 
> I am just wondering whether there is a script/tool which format source code 
> according to kernel coding rule automatically? Such as tab, space, brace, 
> etc. 
> 
> Thanks very much in advance! 
> 
> Best Regards 
> Nan Xiao 

If your using vi(m) in command mode type gg=G this will indent your code . if your want kernel coding rules compatibility run your code through scripts/Lindent. There is a vim plugi-in http://www.vim.org/scripts/script.php?script_id=4369 will do the same. 


_______________________________________________ 
Kernelnewbies mailing list 
Kernelnewbies at kernelnewbies.org 
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150803/ec0366e6/attachment-0001.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Is there any tool can format source code according to kernel coding rule?
  2015-08-03  3:35 Is there any tool can format source code according to kernel coding rule? Nan Xiao
  2015-08-03  4:08 ` Chetan Nanda
  2015-08-03  5:00 ` Aruna Hewapathirane
@ 2015-08-03 10:27 ` Daniel Baluta
  2015-08-03 23:07   ` Nan Xiao
  2 siblings, 1 reply; 6+ messages in thread
From: Daniel Baluta @ 2015-08-03 10:27 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Aug 3, 2015 at 6:35 AM, Nan Xiao <xiaonan830818@gmail.com> wrote:
> Hi all,
>
> I am just wondering whether there is a script/tool which format source code
> according to kernel coding rule automatically? Such as tab, space, brace,
> etc.


Try scripts/Lindent from the kernel source tree.

Daniel.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Is there any tool can format source code according to kernel coding rule?
  2015-08-03 10:27 ` Daniel Baluta
@ 2015-08-03 23:07   ` Nan Xiao
  0 siblings, 0 replies; 6+ messages in thread
From: Nan Xiao @ 2015-08-03 23:07 UTC (permalink / raw)
  To: kernelnewbies

Hi Chetan, Aruna, Rameshbabu, Daniel,

Thanks very much for all your time and kind advices!

Best Regards
Nan Xiao

On Mon, Aug 3, 2015 at 6:27 PM, Daniel Baluta <daniel.baluta@gmail.com>
wrote:

> On Mon, Aug 3, 2015 at 6:35 AM, Nan Xiao <xiaonan830818@gmail.com> wrote:
> > Hi all,
> >
> > I am just wondering whether there is a script/tool which format source
> code
> > according to kernel coding rule automatically? Such as tab, space, brace,
> > etc.
>
>
> Try scripts/Lindent from the kernel source tree.
>
> Daniel.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20150804/ee043217/attachment-0001.html 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-08-03 23:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-03  3:35 Is there any tool can format source code according to kernel coding rule? Nan Xiao
2015-08-03  4:08 ` Chetan Nanda
2015-08-03  5:00 ` Aruna Hewapathirane
     [not found]   ` <1248345698.1475860.1438595471226.JavaMail.zimbra@globaledgesoft.com>
2015-08-03  9:51     ` Rameshbabu
2015-08-03 10:27 ` Daniel Baluta
2015-08-03 23:07   ` Nan Xiao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.