src/Mod/Draft/coding_conventions.md
"strings".from module import *, as this
makes it hard to validate imported functions and classes.FreeCADGui, should be guarded by an if FreeCAD.GuiUp: test.snake_case_names.py for modules.variable_names_without_capitals for variables.CamelCaseClass for classes.CONSTANTS_USE_CAPITALS for constants.functions_without_capitals() for functions and class methods.is_mesh_valid is a good name, but check_mesh is not a good name._MyInternalClass or _my_small_variable.pylint, pyflakes, pycodestyle, jedi,
sphinx, etc., that automatically test the code as you write it,
and can provide documentation and hints on the used functions and classes
in real time, even the ones that you have just written.flake8 --ignore=E226,E266,W503 file.py
We may ignore certain errors and warnings.
*, /, +, -;
sometimes we don't need a space.# for comments; we need two ## for Doxygen documentation.and and or.
The W503 warning will be changed in the future so we can ignore it for now.A good way to test entire folders for compliance is to run the following command.
find src/Mod/Draft -name '*.py' ! -name InitGui.py -exec flake8 --ignore=E226,E266,W503 --max-line-length=100 '{}' '+'
The following command tests files in the Draft directory, but skips translation files and certain words which could be custom defined variables, functions, and classes.
codespell -q 3 -S '*.ts' -L beginn,childs,eiter,methode,programm src/Mod/Draft
Interactively fix the errors found.
codespell -i 3 -w -S '*.ts' -L beginn,childs,eiter,methode,programm src/Mod/Draft