Zulip Chat Archive

Stream: Is there code for X?

Topic: opinionated formatter à la black


Xavier Martinet (Feb 08 2022 at 10:05):

Hi,

Is there a way to standardize code formatting? In Python I am very fond of black (https://github.com/psf/black), this is extremely useful when there are several people working on the same codebase and you want to avoid pointless diffs because of different formatting habits.
Is there something similar in Lean?

Eric Wieser (Feb 08 2022 at 10:12):

I think the closest thing we have right now is a CI script for mathlib that checks the indentation style roughtly matches #style, but it's fairly heuristic as lean is impossible for anything but lean itself to parse.

Yaël Dillies (Feb 08 2022 at 10:13):

Johan wrote a style linter for braces recently.

Patrick Massot (Feb 08 2022 at 10:13):

The more important answer is that all this will exist in Lean 4, but there is no point trying in Lean 3.


Last updated: Dec 20 2023 at 11:08 UTC