FEM Python coding standard

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: OpenSees, the Open System for Earthquake Engineering Simulation

Post by Kunda1 »

ebrahim raeyat wrote: Wed Mar 25, 2020 10:08 pm @bernd, when i type codespell -L:

Code: Select all

codespell: error: no such option: -L

Code: Select all

 -L WORDS, --ignore-words-list WORDS
                        Comma separated list of words to be ignored by
                        codespell. Words are case sensitive based on how they
                        are written in the dictionary file

From codespell --help
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
ebrahim raeyat
Posts: 621
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: FEM Python coding standard

Post by ebrahim raeyat »

Kunda1 wrote: Thu Sep 12, 2019 8:59 pm

Code: Select all

  -L WORDS, --ignore-words-list WORDS

when i type this command with -L flag, it takes me this error:

Code: Select all

Usage: 
	codespell [OPTIONS] [file1 file2 ... fileN]


codespell: error: no such option: -L
codespell version 1.8
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: FEM Python coding standard

Post by Kunda1 »

ebrahim raeyat wrote: Wed Mar 25, 2020 11:15 pm codespell version 1.8

Code: Select all

$ codespell --version
1.17.0.dev0
Check out https://github.com/codespell-project/codespell#updating
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
ebrahim raeyat
Posts: 621
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: FEM Python coding standard

Post by ebrahim raeyat »

Kunda1 wrote: Wed Mar 25, 2020 11:21 pm
ebrahim raeyat wrote: Wed Mar 25, 2020 11:15 pm codespell version 1.8

Code: Select all

$ codespell --version
1.17.0.dev0
Check out https://github.com/codespell-project/codespell#updating
thanks, it works.
User avatar
ebrahim raeyat
Posts: 621
Joined: Sun Sep 09, 2018 7:00 pm
Location: Iran
Contact:

Re: OpenSees, the Open System for Earthquake Engineering Simulation

Post by ebrahim raeyat »

bernd wrote: Thu Mar 26, 2020 5:34 am double posted! Is solved here https://forum.freecadweb.org/viewtopic. ... 70#p380760
yes, i prefer to solve this in related topic. if you can please move those to related topic. thanks.
User avatar
vanuan
Posts: 539
Joined: Wed Oct 24, 2018 9:49 pm

Re: FEM Python coding standard

Post by vanuan »

User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM Python coding standard

Post by bernd »

are they conform with FEM conding standards? See https://github.com/FreeCAD/FreeCAD/blob ... entions.md
User avatar
vanuan
Posts: 539
Joined: Wed Oct 24, 2018 9:49 pm

Re: FEM Python coding standard

Post by vanuan »

bernd wrote: Fri Aug 28, 2020 2:22 pm are they conform with FEM conding standards? See https://github.com/FreeCAD/FreeCAD/blob ... entions.md
Have you read the proposal? It mainly focuses on a method to enforce those. But yeah, the first rules I propose to enable are the snake_case naming and the import grouping which are included in the document you referenced.

Does FEM already use flake8?
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM Python coding standard

Post by bernd »

vanuan wrote: Fri Aug 28, 2020 3:22 pm
bernd wrote: Fri Aug 28, 2020 2:22 pm are they conform with FEM conding standards? See https://github.com/FreeCAD/FreeCAD/blob ... entions.md
Have you read the proposal? It mainly focuses on a method to enforce those. But yeah, the first rules I propose to enable are the snake_case naming and the import grouping which are included in the document you referenced.

Does FEM already use flake8?
the document I referenced only has coding standards which are fulfilled by FEM python code already. I only add new coding standard if at least the most code of FEM does use the coding standard. Thus there is only rare coding standard for FEM C++ code, since I do not do that much c++ code and thus I do not change the coding standard.
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: FEM Python coding standard

Post by bernd »

AFAIK FEM and Draft uses flake8. Only difference is the indent. Draft uses other indent style as FEM.

vocx might give some more information in this regard.

vocx wrote: :bell:
Post Reply