From 57886016abc417797cfce381f7de2325bd9dcdb5 Mon Sep 17 00:00:00 2001 From: gilex-dev Date: Tue, 24 Oct 2023 23:39:28 +0200 Subject: [PATCH] add rules for time format, casing, sql & Codegen --- CONTRIBUTIN.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTIN.md b/CONTRIBUTIN.md index 6487bc3..31b8a82 100644 --- a/CONTRIBUTIN.md +++ b/CONTRIBUTIN.md @@ -58,6 +58,8 @@ Do **not** change the formatting of license texts (e.g. - We use the string `TODO` to mark bits of code that need improvement. - We use the string `DEBUG` to mark bits of code that are only for debugging (remove before next commit). +- We use `YYYY-MM-DD hh:mm:ss` (in `UTC`) as date & time format. +- We use `camelCase` where possible. - We add (if possible) the following header to files that contain a reasonable amount of self-written code or are essential to the project: @@ -82,6 +84,16 @@ Do **not** change the formatting of license texts (e.g. ### File specific rules +#### SQL (.sql) + +- We avoid using spaces and keywords (escape with `` ` `` if necessary). +- We write keywords in queries as `ALL CAPS`. +- We name databases in `ALL CAPS` +- We name tables in `PascalCase`. +- We name columns in `camelCase`. +- We name foreign keys in this scheme: `FK_SourceTable_sourceColumn`. +- We prefix booleans with `IS_`. + #### Markdown (.md) - We add a single `h1` element per document (as a title of the document). @@ -99,7 +111,7 @@ Do **not** change the formatting of license texts (e.g. --- ``` -#### YAML +#### YAML (.yaml) We indent using spaces (1 space wide). @@ -119,6 +131,17 @@ We use the `.yaml` file ending. - We use `.graphqls` for defining our graph scheme. +## Generating code/using tools + +This paragraph does not refer to code generation using neural networks/Ai/LLMs, +which is currently disallowed, but instead to _classical Codegen_ (e.g. +[gqlgen](https://github.com/99designs/gqlgen)). + +- We document the general steps & commands we use to generate code in + [CMD_HISTORY.md](./CMD_HISTORY.md) and commit the result without much + modifications. Instead, we commit the necessary changes in an additional + commit. + ## Commit messages - We write in all lowercase except for special names, e.g. `update Makefile`