-
All non-private methods should have a torch-dokx documentation describing input/output.
-
All classes should have a class docstring at the top of the file.
-
All comments should be on their own line, and be a complete English sentence with capitalization.
The torch-dokx documentation is automatically deployed here.
-
All files should pass
luacheck
. -
Use object-oriented programming whenever appropriate.
-
Avoid using global variables.
-
Avoid writing functions with more than 100 lines.
-
Use
onmt.utils.Logger
to log messages for the user. -
If a new module relies on command line options, consider defining a static
declareOpts(cmd)
function. Seeonmt/translate/Translator.lua
for an example.
-
All indentation should be 2 spaces.
-
All variables, functions and methods should use camelCase.
-
Commande line options and scripts name should use snake_case.
-
Use spaces around operators to increase readability.
-
Avoid lines with more than 100 columns.