<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 2, 2021, 6:59 PM Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Apr 2, 2021 at 4:48 PM Ida Delphine <<a href="mailto:idadelm@gmail.com" target="_blank" rel="noreferrer">idadelm@gmail.com</a>> wrote:<br>
><br>
> Hello,<br>
> Please can you help explain what you mean by Adding a "check-style" target to the RTEMS build system?<br>
> And how I could possibly go about this?<br>
><br>
I don't know if this makes sense exactly to me.  When compiling RTEMS<br>
it could be nice to have an option to check the style rules for<br>
compliance. This would be something to integrate in the<br>
rtems.git/wscript file most likely, as part of the waf build system.<br>
However, since checking style does not generate a target file, I don't<br>
know that this really is suitable as a way to verify style rules. It<br>
may be suitable to add a standalone script in rtems-tools.git that can<br>
be run over the rtems.git that creates a report about style problems.<br>
Maybe, a way to configure it to ignore some files or to add exceptions<br>
to the style rules for certain cases then could be possible.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">If you have a configuration that produces the code formatted as expected in certain directories, then if a change is made as part of normal development, running uncrustify will result in changes to the file needed. In a way the goal is to have a directory full of files that an RTEMS uncrustify configuration does not change.</div><div dir="auto"><br></div><div dir="auto">If you have a script that can do that manually then we can easily add an automated check somewhere in the process to ensure that directories that adhere to the style rules continue to adhere to them.</div><div dir="auto"><br></div><div dir="auto">One thing to keep in mind is that there there are places where uncrustify does not have the ability to format code the way RTEMS has historically done it. we want the rules to be as close as possible to the existing practice but we are willing to adjust practice if it allows the tool to produce formatted output we can trust. </div><div dir="auto"><br></div><div dir="auto">On each point where this type of issue occurs, we'll have to have a discussion about our Style versus what tool supports. It's likely indicates we're doing something that's not common in the open source world.</div><div dir="auto"><br></div><div dir="auto">Once the delta between the output of uncrustify and the committed source is zero, running uncrustify should produce no changes. Anything uncrustify wants to change at that point would be a style violation and flagged. In a perfect world it would prevent you from committing.</div><div dir="auto"> </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I think focus on 1 and 3 is better as a way to start, and perhaps<br>
something like the above can be the phase 2 effort.<br>
<br>
Gedare<br>
<br>
> Cheers,<br>
> Ida<br>
><br>
> On Mon, Mar 29, 2021 at 9:45 PM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank" rel="noreferrer">gedare@rtems.org</a>> wrote:<br>
>><br>
>> On Mon, Mar 29, 2021 at 1:28 PM Ida Delphine <<a href="mailto:idadelm@gmail.com" target="_blank" rel="noreferrer">idadelm@gmail.com</a>> wrote:<br>
>> ><br>
>> > Yes I have. But wondering how to run it with the given configuration I saw in this thread(<a href="https://lists.rtems.org/pipermail/devel/2020-October/062770.html" rel="noreferrer noreferrer" target="_blank">https://lists.rtems.org/pipermail/devel/2020-October/062770.html</a>).<br>
>> ><br>
>><br>
>> If you download/copy the configuration into a cfg file, then you can<br>
>> use the examples from<br>
>> <a href="https://github.com/uncrustify/uncrustify#running-the-program" rel="noreferrer noreferrer" target="_blank">https://github.com/uncrustify/uncrustify#running-the-program</a> and<br>
>> attempt to run it on some files within rtems.git/cpukit/score/src<br>
>> would be my suggestion.<br>
>><br>
>> > On Mon, Mar 29, 2021 at 3:37 PM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank" rel="noreferrer">gedare@rtems.org</a>> wrote:<br>
>> >><br>
>> >> Hi Ida,<br>
>> >><br>
>> >> On Mon, Mar 29, 2021 at 7:36 AM Ida Delphine <<a href="mailto:idadelm@gmail.com" target="_blank" rel="noreferrer">idadelm@gmail.com</a>> wrote:<br>
>> >> ><br>
>> >> > Hello,<br>
>> >> > Please do you mind telling me how to run uncrustify with the given configuration with any sample file?<br>
>> >><br>
>> >> What have you tried? Any directions followed/attempted or notes that<br>
>> >> you have taken would be helpful.<br>
>> >><br>
>> >> I guess all the info that you should need is in Uncrustify's readme<br>
>> >> file. <a href="https://github.com/uncrustify/uncrustify" rel="noreferrer noreferrer" target="_blank">https://github.com/uncrustify/uncrustify</a><br>
>> >><br>
>> >> Did you successfully compile uncrustify tool?<br>
>> >><br>
>> >> > I'm a bit stuck.<br>
>> >> ><br>
>> >> > Thanks,<br>
>> >> > Ida.<br>
>> >> ><br>
>> >> > On Wed, Mar 17, 2021 at 10:34 PM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank" rel="noreferrer">gedare@rtems.org</a>> wrote:<br>
>> >> >><br>
>> >> >> On Wed, Mar 17, 2021 at 2:28 PM Ida Delphine <<a href="mailto:idadelm@gmail.com" target="_blank" rel="noreferrer">idadelm@gmail.com</a>> wrote:<br>
>> >> >> ><br>
>> >> >> > Hello,<br>
>> >> >> > So I have gone through this configuration file and I think I'm getting it. However I'm a bit lost in the reading the messages in the thread. Do you mind explaining? Or we can start talking about a way forward.<br>
>> >> >> > Also can you help me with some steps on how to test this by myself if possible?<br>
>> >> >> ><br>
>> >> >><br>
>> >> >> It may be easier if you go "up" a level to see the full thread<br>
>> >> >> context: <a href="https://lists.rtems.org/pipermail/devel/2020-October/thread.html#62769" rel="noreferrer noreferrer" target="_blank">https://lists.rtems.org/pipermail/devel/2020-October/thread.html#62769</a><br>
>> >> >> Then you can go through the messages non-linearly. Right now, the<br>
>> >> >> basic idea is to follow the steps outlined in the open project ticket.<br>
>> >> >> I think Christian has summarized it nicely in his recent email [1]: "I<br>
>> >> >> think the contributions from this project that would add value would<br>
>> >> >> be:<br>
>> >> >> 1. Finding a tool and a configuration that can do an RTEMS style or an<br>
>> >> >> acceptable close one.<br>
>> >> >> 2. Adding a "check-style" target to our build system.<br>
>> >> >> 3. Maybe add some kind of script similar to Linux "<a href="http://checkpatch.pl" rel="noreferrer noreferrer" target="_blank">checkpatch.pl</a>" that<br>
>> >> >> could check whether patches would need changes _before_ they are<br>
>> >> >> applied.<br>
>> >> >> "<br>
>> >> >><br>
>> >> >> The proposal preparation phase should work through identifying the<br>
>> >> >> options and pros/cons for different tools while preparing a plan for<br>
>> >> >> how to integrate style checks in 2, 3 and thinking through the coding<br>
>> >> >> tasks for the summer.<br>
>> >> >><br>
>> >> >> Getting the style checking tool's configuration to match with the<br>
>> >> >> RTEMS style will be some effort, and testing it out and submitting<br>
>> >> >> some patches based on it could be a good proposal activity also to<br>
>> >> >> build some confidence about the tools that will be used.<br>
>> >> >><br>
>> >> >> We also have some Python style guidelines that might be worth<br>
>> >> >> addressing. Those are harder maybe, since the style refactoring might<br>
>> >> >> be challenging to review for correctness.<br>
>> >> >><br>
>> >> >> For getting started, I would recommend that you try running uncrustify<br>
>> >> >> with the given configuration on some files in RTEMS, see what it<br>
>> >> >> results in. Play around.<br>
>> >> >><br>
>> >> >> [1] <a href="https://lists.rtems.org/pipermail/devel/2021-March/065547.html" rel="noreferrer noreferrer" target="_blank">https://lists.rtems.org/pipermail/devel/2021-March/065547.html</a><br>
>> >> >><br>
>> >> >> -Gedare<br>
>> >> >><br>
>> >> >> > Thanks,<br>
>> >> >> > Ida<br>
>> >> >> ><br>
>> >> >> > On Mon, Mar 15, 2021 at 9:39 PM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank" rel="noreferrer">gedare@rtems.org</a>> wrote:<br>
>> >> >> >><br>
>> >> >> >> See the related thread, and we'll have to discuss how to move forward.<br>
>> >> >> >> The existing approach provides an uncrustify script:<br>
>> >> >> >> <a href="https://lists.rtems.org/pipermail/devel/2020-October/062769.html" rel="noreferrer noreferrer" target="_blank">https://lists.rtems.org/pipermail/devel/2020-October/062769.html</a><br>
>> >> >> >><br>
>> >> >> >><br>
>> >> >> >> On Sun, Mar 14, 2021 at 9:47 PM Ida Delphine <<a href="mailto:idadelm@gmail.com" target="_blank" rel="noreferrer">idadelm@gmail.com</a>> wrote:<br>
>> >> >> >> ><br>
>> >> >> >> > Hello everyone,<br>
>> >> >> >> > This ticket(<a href="https://devel.rtems.org/ticket/3860" rel="noreferrer noreferrer" target="_blank">https://devel.rtems.org/ticket/3860</a>) was proposed to me and I'm interested in it for GSoC.<br>
>> >> >> >> > The first task there is to find a code checker or formater that can produce results that match the RTEMS coding conventions. It also made mention some tools have been discussed in the past. Please I will love suggestions on possible tools I could use to achieve this.<br>
>> >> >> >> ><br>
>> >> >> >> ><br>
>> >> >> >> > Cheers,<br>
>> >> >> >> > Ida.<br>
>> >> >> >> > _______________________________________________<br>
>> >> >> >> > devel mailing list<br>
>> >> >> >> > <a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a><br>
>> >> >> >> > <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div></div>