[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [Outreachy] Interested in contribution: Code Standards Checking using clang-format



Hi Ishani, (+Doug, +Andy)

not that the deadline as been extended to April 13. I am also CC'ing Andy 
Cooper as Doug has not responded. 

The challenge that we will have is to satisfy the small task requirement while 
also making the task sensible in the context of the project. Now we do have 
some flexibility there: in other words, we can declare for example an RFC that 
everyone agrees with as such a contribution.

But as a basic idea, the first step of the project would be to try and come up 
with a .clang-format file that matches one of the coding styles in the git tree 
(either http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=CODING_STYLE or 
http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/libxl/CODING_STYLE) and 
prove that it works. I don't know whether this is doable as a small task: the 
number of options in clang-format do not seem to be huge. And there are tools 
such as https://clangformat.com/ to experiment with.

If it is possible to do the whole thing in a small task, the output would be a 
.clang-format file that is submitted for code review to a suitable location in 
the xen tree. I don't know what the right location should be, but 
xen.git:tools/clang-format would be sensible. 

If it is not possible to do this for one of the complete coding standards, I 
would develop for one or two subsets: 
1: a .clang-format settings snippet for a reasonably complex coding style 
pattern in the coding standard
2: a piece of test code that adheres to the coding standard 
3: a variant of the same code snippet that does not adhere to the coding 
standard 
4: a small script that checks that .clang-format works correctly on these 
pieces of code 

For 4, you probably want to run clang-format with -output-replacements-xml on 
the files in 1 - 3 and then do some grep magic to see whether it does the right 
thing.

Again this could go into xen.git:tools/clang-format - maybe under 
tools/clang-format/tests for now

@Andy, @Doug: does this sound sensible?

Regards
Lars


> On 31 Mar 2017, at 10:37, Ishani <chugh.ishani@xxxxxxxxxxxxxxxxxxx> wrote:
> 
> Hello Sir,
> 
> I am Ishani Chugh, a fourth year undergraduate student of Electronics and 
> Communications Engineering at International Institute of Information 
> Technology, Hyderabad. I am passionate about Open Source Development. I am 
> interested to contribute to your organization Xen Project as an Outreachy 
> intern . I am interested to work in the project: Code Standards Checking 
> using clang-format. I am proficient in C++ and have slight experience of 
> working in clang-format.
> Please guide me for initial contributions to prove my candidature.
> 
> Regards
> Ishani
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxx
> https://lists.xen.org/xen-devel


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.