From e4ea86cfd1a0aec8a0bdc03724cb6236170424ec Mon Sep 17 00:00:00 2001 From: Bernd Hahnebach Date: Wed, 3 Jun 2020 17:58:08 +0200 Subject: [PATCH] FEM: code conventions small updates --- src/Mod/Fem/coding_conventions.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Mod/Fem/coding_conventions.md b/src/Mod/Fem/coding_conventions.md index 9f103a9ea2..1b6d43cadf 100644 --- a/src/Mod/Fem/coding_conventions.md +++ b/src/Mod/Fem/coding_conventions.md @@ -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 @@ -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