From 8b2b50e43333f99427ce177fe1b77d6bf43604dc Mon Sep 17 00:00:00 2001 From: Able Date: Sun, 24 Nov 2024 12:22:06 -0600 Subject: [PATCH] Style guide update, vscode config to make tab indent follow the style guide --- .vscode/settings.json | 2 ++ STYLE_GUIDE.md | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e0c3d059c..893772838 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,6 @@ { + "editor.insertSpaces": false, + "editor.detectIndentation": false, "rust-analyzer.checkOnSave.allTargets": false, "rust-analyzer.showUnlinkedFileNotification": false, "C_Cpp.errorSquiggles": "disabled" diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index 63707b328..5f2e22242 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md @@ -5,6 +5,23 @@ This style guide has two modes that a guideline may be. `loose` means that a pr would be accepted but should later be fixed. +## Empty Functions | loose +Empty functions are typically a sign of an unfinished program or driver. + +In cases where there is a clear reason to have an empty function it will be allowed. +For example FakeAlloc is only empty functions because it is a example of an the allocator api. + +### Allowed +```rust +/// in example.hb +a := fn(): void {} +``` +### Not Allowed +```rust +/// in fat32.hb +a := fn(): void {} +``` + ## Magic Numbers | loose The policy on magic numbers is make them const and have a comment above them. Typically linking to a source of information about the magic number. @@ -16,7 +33,7 @@ This helps cut down on magic numbers while making acceptable names and atleast h $VGA_PTR := 0xB8000 ``` -## Tabs Vs Spaces | loose +## Tabs Vs Spaces | strict I prefer for hblang code to use hard tabs. The rational behind this is that a tab is `1 Indent` which some developers might want to be various different sizes when displayed