Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-hb committed Jan 27, 2025
1 parent 328ee4d commit 2e82437
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
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).

0 comments on commit 2e82437

Please sign in to comment.