30 lines
817 B
Markdown
30 lines
817 B
Markdown
# Batter Up!
|
|
|
|
## Style Guide
|
|
|
|
This project uses StyLua for linting, and Selene for various other checks.
|
|
|
|
In addition to using `<const>`, where applicable, PascalCase is used for any
|
|
values which should **never** be mutated, including any elements in a table.
|
|
|
|
E.g.
|
|
|
|
```lua
|
|
local Screen <const> = { x = 400, y = 240 }
|
|
```
|
|
|
|
should be treated the same as
|
|
|
|
```lua
|
|
local ScreenX <const> = 400
|
|
local ScreenY <const> = 240
|
|
```
|
|
|
|
Though the compiler will not enforce this. Furthermore, PascalCase is also used
|
|
for values that may mutate *themselves* through method calls. For example,
|
|
instances of `playdate.graphics.animator`. The one exception is `gfx`
|
|
|
|
N.b. Selene does not understand `<const>`, so `make check` uses a `sed` hack to
|
|
filter them out.
|
|
|
|
`camelCase` tables may be `<const>`, but can still have mutable fields. |