Skip to content

Commit

Permalink
FEM: code conventions small updates
Browse files Browse the repository at this point in the history
  • Loading branch information
berndhahnebach committed Jun 3, 2020
1 parent bbb0823 commit 8b1e220
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/Mod/Fem/coding_conventions.md
Expand Up @@ -35,7 +35,14 @@ These coding rules apply to FEM module code only. Other modules or the base syst
- double quotes as string identifier

### Imports
- Python imports should be grouped into three groups:
- Only one import per line.
- Even on import from some_module import something. There should only be one something per line.
- Each import group should be sorted alphabetically.
- First the import some_module ones, afterwards the from some_module import something.
- First absolute path imports than relative path imports.
- On relative path imports first the one dot ones, afterwards the two dot ones.
- Star import should not be used at all (from some_module import *).
- Python imports should be grouped into groups:
- Standard library imports
- One empty line
- Third-party imports
Expand All @@ -52,13 +59,7 @@ These coding rules apply to FEM module code only. Other modules or the base syst
- Third-party Gui imports
- FreeCAD-specific imports from module FreeCADGui
- other FreeCAD Gui imports
- Each group should be sorted alphabetically
- First the import imports, than the from imports
- On from imports firs the one dot, than two dot and so on imports
- Only one import per line
- Even for from mymodule import mymethod should only be one method
- The above paragraphs highly reduces merge conflicts
- Star import should not be used at all (from mymodule import *)
- The above paragraphs highly reduces merge conflicts.

### Naming policy
- snake_case_names
Expand Down

0 comments on commit 8b1e220

Please sign in to comment.