{{toc}} OpenAtlas is developed with some standards in mind. h1. Open source To guaranty that the OpenAtlas application can be shared as open source (GPL 2) make sure that: * Only open source software is used and required * Non-code files are open data, e.g. a CC BY 4.0 license for images * When including 3rd party software or media it is important to: ** Make sure that the license is compatible ** Add a license file if available ** Place them in openatlas/static/vendor h1. Bugs Of course we do our best to avoid them in the first place but if bugs get apparent they always have the highest priority. h1. HTML * Standard: "HTML 5":https://www.w3.org/TR/html5/. Exceptions may be acceptable if invalid but harmless HTML 5 is produced by 3rd party libraries. * Indentation: 2 spaces h1. Type-/JavaScript * Indentation: 2 spaces * Use semicolons at the end of statements, see "Eslint: Semi Always":https://eslint.org/docs/latest/rules/semi#always for details. |_. |_<.Version|_<.Setup |_<.Configuration |_<.| |*"Eslint":https://eslint.org/* |>. 8.35.0| Through npm in relevant projects |*.eslintrc* |Checks for errors, coding standards and code smells in js/ts code| h1. CSS * Indentation: 2 spaces h1. Python * Indentation: 4 spaces * Listed below are used standards and tests |_. |_<.Version|_<.PyCharm |_<.Configuration |_<.| |*"PEP 8":https://www.python.org/dev/peps/pep-0008/* | |integrated | |Style guide for Python code| |*"nose tests":https://realpython.com/python-testing/* |>. 1.3.7|integrated |*tests/.noserc* *tests/.coveragerc*|Cover Python code using assertions, some parts (e.g. mail) are excluded via *# pragma: no cover*. Can be run manually with: *nosetests3 -c tests/.noserc*| |*"Mypy":https://mypy.readthedocs.io/en/latest/* |>. 1.01|plugin *Mypy* |*mypy.ini* |Optional static type checker for Python| |*"Pylint":http://pylint.pycqa.org* |>. 2.16.2|plugin *Pylint*|*.pylintrc* |Checks for errors, coding standards and code smells| |*"SonarQube":https://github.com/SonarSource/sonarqube*|>. 5| |*sonar-project.properties* |Cumbersome to install (so not mandatory for developers) but interesting code hints. PyCharm plugin exists but doesn't seem to work for Python| "Radon":https://radon.readthedocs.io can be used to compute various code metrics. Installation: *apt install radon*. To show e.g. metrics about cyclic complexity: *radon cc openatlas* h1. Software packages (Debian) Although "pip":https://pip.pypa.io/en/stable/ offers some advantages (e.g more current packages and usable for different installation environments) we prefer packages from the "Debian":https://www.debian.org/distrib/packages repository for the OpenAtlas backend. Main reasons concern security, reliability and stability.