On 17/08/2020 18.12, sebb wrote:
On Mon, 17 Aug 2020 at 12:52, Daniel Gruno <[email protected]> wrote:

On 17/08/2020 13.49, sebb wrote:
I notice that various camelCase names have been changed to lower_case.

This does not appear to be part of PEP8, so it needs to be documented
to avoid unnecessary future changes.

Likewise for double- or single- quotes and any other local conventions.

S.


For single/double quoting and general look of the code, I've started
running our code through Black to produce a uniform and readable
codebase. It works very well and keeps things consistent :)

However it makes some code harder to follow.

For example, argument parser entries generally now take 7 lines instead of 2.
If I apply it to archiver.py from PM12, the file changes from about
720 lines to 850.
That is excessive.

I am only applying this to foal, not the current pony mail.
I would not consider foal to be just another version, but rather a rewrite with a lot of changes, so I'm not factoring in a need for super easy comparison between current PM and Foal.

Going forward with Foal, I think introducing reproducible styling is going to be a boon in the long run. And black does just that.


$ pip3 install black
$ black archiver.py
[black does its magic and archiver.py is formatted properly]


So why the change from camelCase to lower_case?
And where are the conventions going to be documented?


Camel case is generally reserved for classes, functions should use lowercase (snake I suppose), that's part of PEP8.
https://www.python.org/dev/peps/pep-0008/#function-and-variable-names

I realize that there are exceptions allowed, but since we're not releasing libraries, I don't think of it as a must to keep the old camelCased function names and arguments.

We can create a document that specifies that we want to follow PEP8 and Black for Foal, I'd be interested in that :)

Reply via email to