Coding Conventions
- Conventions for all languages used
- Try to lean towards established conventions for most cases
- Automatic style checks where possible
-
Meta Documentation on Coding Conventions tbd by @david
Languages, tools and frameworks
- git - Update here whenever something pops up
- Steering (Python, Django): Coding Conventions: Integrate Black and Flake8 (steering#86 - closed) and Coding Conventions: Setup pre-commit and add co... (steering#87 - closed)
- Engine (Python): Coding Conventions: Integrate Black and Flake8 (engine#96 - closed)
- Engine API (Python): Coding Conventions: Integrate Black and Flake8 (engine-api#21 - closed)
- Engine Core (Liquidsoap): n/a
- Tank (Go): @nnrcschmdt can you please suggest something here or should we leave it as is?
- Dashboard (VueJS, ECMAScript): ESLint
- Dashboard Clock (Svelte, ECMAScript): ESLint
- Player (Svelte, ECMAScript, TypeScript): ESLint
- OIDC Client stubs (Python, ECMAScript): https://gitlab.servus.at/aura/oidc-client-stubs/-/issues/1
Custom conventions
If there's some project defining custom conventions and style configs, please discuss with the team if they should be applied globally. Document here: (https://gitlab.servus.at/aura/meta/-/blob/master/docs/development/coding-conventions.md)
Aggregated thoughts and input
Suggestion by @sumpfralle regarding Python Code:
Currently the code is quite close to PEP-8, but it still contains quite a lot of issues (mainly due to whitespace or blank lines). flake8 is quite a common tool for verifying the style.
In addition black is a common tool for auto-formatting python code. It relieves developers from the chore of bike-shedding discussions by providing a widespread standard.