You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Code formatting is not particularly exciting but many researchers would consider it either unsolved or not well-solved. The two well-established solutions are:
6
+
7
+
1. Build a custom program that formats code for specific a language with ad hoc techniques, typically subject to parameters such as "*always put a space between operators*".
8
+
2. Define a set of formal rules that map input patterns to layout instructions such as "*line these expressions up vertically*".
9
+
10
+
Either techniques are painful and finicky.
11
+
12
+
This repository is a step towards what we hope will be a universal code formatter that looks for patterns in a corpus and attempts to format code using those patterns.
13
+
14
+
## Mechanism
15
+
16
+
For a given language *L*, the input to CodeBuff is:
17
+
18
+
1. a grammar for *L*
19
+
2. a set of input files written in *L*
20
+
3. a file written in *L* but not in the corpus that you would like to format
0 commit comments