Style guide update, vscode config to make tab indent follow the style guide

This commit is contained in:
Able 2024-11-24 12:22:06 -06:00
parent d7e0d573e2
commit 8b2b50e433
2 changed files with 20 additions and 1 deletions

View file

@ -1,4 +1,6 @@
{ {
"editor.insertSpaces": false,
"editor.detectIndentation": false,
"rust-analyzer.checkOnSave.allTargets": false, "rust-analyzer.checkOnSave.allTargets": false,
"rust-analyzer.showUnlinkedFileNotification": false, "rust-analyzer.showUnlinkedFileNotification": false,
"C_Cpp.errorSquiggles": "disabled" "C_Cpp.errorSquiggles": "disabled"

View file

@ -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. `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 ## 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. 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 $VGA_PTR := 0xB8000
``` ```
## Tabs Vs Spaces | loose ## Tabs Vs Spaces | strict
I prefer for hblang code to use hard tabs. 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 The rational behind this is that a tab is `1 Indent` which some developers might want to be various different sizes when displayed