FEM Python coding standard

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
vanuan
Posts: 465
Joined: Wed Oct 24, 2018 9:49 pm

Re: FEM Python coding standard

Post by vanuan » Fri Aug 28, 2020 4:22 pm

bernd wrote:
Fri Aug 28, 2020 4:06 pm
the document I referenced only has coding standards which are fulfilled by FEM python code already.
How do you enforce it? What if one day you discover FEM doesn't fulfill it anymore? Do you catch all the issues during review? What if you miss an issue? What if you need to change the code which is not a part of FEM? Aren't you annoyed it doesn't fulfill the coding style you've used to?
bernd wrote:
Fri Aug 28, 2020 4:06 pm
AFAIK FEM and Draft uses flake8. Only difference is the indent. Draft uses other indent style as FEM.
As far as I can see, flake8 is disabled:
https://github.com/FreeCAD/FreeCAD/blob ... #L124-L130

Do you mean you run it yourself each time you do a pull? How is it being run and when?
User avatar
bernd
Posts: 10956
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FEM Python coding standard

Post by bernd » Fri Aug 28, 2020 5:40 pm

all checks are done by myself. I use flake8 for this. The command I usd is in the code convention file.

Usually all FEM python code is reviewed by me before merge. If there are only a few changes needed I merge and do them manually. Werner himself does not really follow pep8 strictly. Normally I do change this afterwards. I do only change coding style in FEM. In other workbenches I would get in touch with the maintainer first. Most dev which do code in FEM makes flake8 themself. I just ask them very kindly to do this again and again. Most of them have adopted this.
User avatar
bernd
Posts: 10956
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FEM Python coding standard

Post by bernd » Fri Aug 28, 2020 5:42 pm

I am known commit history and code formating freak! :mrgreen: IMHO it helps very much to understand code. May be I like this because I am a poor dev :mrgreen:
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests