[Announcement]: Developed an automating tool that can help RTEMS conform with Python coding style
joel at rtems.org
Wed Sep 2 23:07:19 UTC 2020
On Wed, Sep 2, 2020, 5:51 PM Chris Johns <chrisj at rtems.org> wrote:
> On 3/9/20 7:39 am, Gedare Bloom wrote:
> > On Wed, Sep 2, 2020 at 2:00 PM Mritunjay Sharma
> > <mritunjaysharma394 at gmail.com> wrote:
> >> Hello everyone!
> >> After recently seeing the Python Development
> >> guidelines for RTEMS, I found that
> >> "RTEMS Tools should be piped through the yapf Python code
> >> formatter before it is committed or sent for review."
> >> This gave me an idea to build something that can automate
> >> this process and take the pressure off both from
> >> Maintainers as well as Contributors.
> >> I am pleased to tell you that I have successfully implemented this
> >> idea by building an open-source GitHub action called 'autoyapf'.
> >> Link to the tool is: https://github.com/marketplace/actions/autoyapf
> >> Link to the github repo: https://github.com/mritunjaysharma394/autoyapf
> >> What it does is that whenever a maintainer pushes a python code in the
> >> or merges a PR of a contributor containing Python code, autoyapf action
> >> triggered and it automatically checks if the file is piped in 'yapf'
> format or not
> >> and if not then it will automatically commit the changes in concerned
> >> to make it follow the PEP 8 style guide using yapf.
> > Interesting concept. I think this would be more useful a bit earlier
> > in the development pipeline though. What about as a pre-commit
> > githook?
> It is interesting and I like the idea of some support but we are not a
> hosted project so workflows will not work for us. Plus at the moment the
> repos I
> am interested in need to be converted to yapf for any support like this to
> The yapf changes are not too bad, the pylint changes, which are worth
> take a lot longer.
> I am running `yapf -i myfile.py` before I create the commit. This way I
> the changes as part of a review before creating the commit.
> Could the precommit hook simply stop the commit and force you to run yapf
> there is a required change? Would this require you have yapf installed?
I think I would be ok with this behaviour. Whatever free checkers we use
should be no problem to expect someone to have and run.
We just have to be clean first. :)
> devel mailing list
> devel at rtems.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the devel