-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Askrella Go Linters | ||
|
||
This is a collection of custom Go linters that we use to enforce best practices in our code. | ||
|
||
## Linter Rules | ||
|
||
### Infinite Loop | ||
|
||
This linter checks for infinite loops by ensuring that every loop has an integer based counter as | ||
a guardrail. The decision to use an integer based counter is to ensure that the loop will never | ||
run indefinitely. We conciously decided to limit the guardrail to use an integer based counter, | ||
because in the past (game development) we encountered fatal issues when the guardrail was based | ||
on a float due to floating point precision issues (e.g. when coming too close to the precision limits where the float comparison for f1 == f2 would be true despite being incremented by a very small amount). | ||
|
||
This linter will report a warning if it finds a loop that does not have an integer based counter as a guardrail or other loop features preventing it from running indefinitely (e.g range statements, context timeouts). |