This document outlines the code style conventions used in the Clean project.
We follow the standard Lean and Mathlib conventions for most formatting:
-
Type annotations: Use spaces around
:- ✅
(F : Type) - ❌
(F:Type)
- ✅
-
Assignment operator: Use spaces around
:=- ✅
let x := 5 - ❌
let x:=5
- ✅
For more details, see:
We omit spaces around := in named parameters:
- ✅
(F:=F),(α:=α),(constant:=constant) - ❌
(F := F),(α := α),(constant := constant)
In polynomial expressions, we omit spaces around *:
- ✅
2*a*b,a*b + c,x*y*z - ❌
2 * a * b,a * b + c,x * y * z
Inside exponent expressions, we omit spaces around operators:
- ✅
2^(8-o),2^(n+1),x^(a*b) - ❌
2^(8 - o),2^(n + 1),x^(a * b)