I'm a little worried about the no exceptions part of that, since we might
have some weird restrictions that we have to do weird things to work
around, but I can't really think of an example of that off hand. I'd want
to look at it to see how much wiggle room there is in the style, since I
think ironclad rules which make no accommodation for occasional common
sense are maybe more trouble than they're worth. I'm not opposed to having
at least some stated standard for python though, and the "official" one
seems like a pretty reasonable choice. I guess it's fine with me, up until
it causes me some sort of problem :-)

Maybe the right thing to do would be to give it a shot but not make it
compulsory until we have a feeling for how much trouble it is.

Gabe

On Wed, Mar 3, 2021 at 11:24 AM Bobby Bruce via gem5-dev <gem5-dev@gem5.org>
wrote:

> Sounds like a good idea to me.
> ---
> Dr. Bobby R. Bruce
> Room 2235,
> Kemper Hall, UC Davis
> Davis,
> CA, 95616
>
> web: https://www.bobbybruce.net
>
>
> On Wed, Mar 3, 2021 at 10:11 AM Daniel Carvalho via gem5-dev <
> gem5-dev@gem5.org> wrote:
>
>> +1
>>
>> Em quarta-feira, 3 de março de 2021 14:35:57 BRT, Jason Lowe-Power via
>> gem5-dev <gem5-dev@gem5.org> escreveu:
>>
>>
>> Hi all,
>>
>> Right now, we don't have an official style guide for python. Our style
>> guide (
>> http://www.gem5.org/documentation/general_docs/development/coding_style/)
>> is very C++ focused.
>>
>> I would like to propose adopting a relatively strict PEP 8 style guide:
>> https://www.python.org/dev/peps/pep-0008. This is the "official" style
>> guide for python (as much as there is anything official). I say "relatively
>> strict" to mean that we will limit our exceptions *as much as possible*.
>>
>> To implement this, Andreas S. recently pointed me to the "Black" package (
>> https://pypi.org/project/black/) which automatically fixes code style. I
>> just tried it out with gem5art (patch coming soon) and found that it works
>> really well. The only downside is that it's not configurable at all. Adding
>> special cases would be almost impossible.
>>
>> Concrete and specific proposal:
>> - Adopt PEP 8 as our official style guide
>> - Use black to reformat all python code in src/
>> - Use black to reformat code in configs/
>> - Use black to reformat other python code
>> - Use black as part of our commit hook to make sure all future python is
>> formatted to PEP 8
>>
>> Let me know what you think!
>>
>> Cheers,
>> Jason
>> _______________________________________________
>> gem5-dev mailing list -- gem5-dev@gem5.org
>> To unsubscribe send an email to gem5-dev-le...@gem5.org
>> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
>> _______________________________________________
>> gem5-dev mailing list -- gem5-dev@gem5.org
>> To unsubscribe send an email to gem5-dev-le...@gem5.org
>> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
>
> _______________________________________________
> gem5-dev mailing list -- gem5-dev@gem5.org
> To unsubscribe send an email to gem5-dev-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to