Skip to content

Commit 41a575a

Browse files
committed
Protocol auto formatting (spaces)
Runs on make so we should have consistent formatting from here on out.
1 parent 385d4c7 commit 41a575a

18 files changed

Lines changed: 379 additions & 366 deletions

‎protocol/Makefile‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ AVRO=java -jar jar/avro-tools-1.7.7.jar idl
55
ICED=node_modules/.bin/iced
66

77
json/%.json: avdl/%.avdl
8-
@ # Uncomment to convert tabs to spaces
9-
@ # expand -t 2 $< > $<~ && mv $<~ $<
108
$(AVRO) $< $@~ && mv $@~ $@
119

1210
config:
@@ -94,6 +92,9 @@ clean:
9492
deps:
9593
npm install
9694

97-
build: build-stamp ../go/protocol/keybase_v1.go js/keybase_v1.js js/flow-types.js
95+
fmt:
96+
@./fmt.sh
97+
98+
build: fmt build-stamp ../go/protocol/keybase_v1.go js/keybase_v1.js js/flow-types.js
9899

99100
.PHONY: test setup config

‎protocol/avdl/backend_common.avdl‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
@namespace("keybase.1")
22

33
protocol backendCommon {
4-
import idl "common.avdl";
4+
import idl "common.avdl";
55

6-
record BlockIdCombo{
7-
string blockHash;
8-
UID chargedTo;
9-
}
6+
record BlockIdCombo{
7+
string blockHash;
8+
UID chargedTo;
9+
}
1010

1111
}
1212

‎protocol/avdl/common.avdl‎

Lines changed: 109 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -2,113 +2,113 @@
22
@namespace("keybase.1")
33
protocol Common {
44

5-
@typedef("long")
6-
record Time {}
7-
8-
record StringKVPair {
9-
string key;
10-
string value;
11-
}
12-
13-
record Status {
14-
int code;
15-
string name;
16-
string desc;
17-
array<StringKVPair> fields;
18-
}
19-
20-
@typedef("string")
21-
record UID {}
22-
23-
@typedef("string")
24-
record DeviceID {}
25-
26-
@typedef("string")
27-
record SigID {}
28-
29-
@typedef("string")
30-
record KID {}
31-
32-
record Text {
33-
string data;
34-
boolean markup;
35-
}
36-
37-
record PGPIdentity {
38-
string username;
39-
string comment;
40-
string email;
41-
}
42-
43-
record PublicKey {
44-
KID KID;
45-
string PGPFingerprint; // empty for non-PGP keys
46-
array<PGPIdentity> PGPIdentities; // same
47-
boolean isSibkey;
48-
boolean isEldest;
49-
string parentID;
50-
DeviceID deviceID;
51-
string deviceDescription;
52-
string deviceType;
53-
Time cTime;
54-
Time eTime;
55-
}
56-
57-
record User {
58-
UID uid;
59-
string username;
60-
}
61-
62-
record Device {
63-
string type;
64-
string name;
65-
DeviceID deviceID;
66-
Time cTime;
67-
Time mTime;
68-
KID encryptKey;
69-
KID verifyKey;
70-
}
71-
72-
record Stream {
73-
int fd;
74-
}
75-
76-
enum LogLevel {
77-
NONE_0,
78-
DEBUG_1,
79-
INFO_2,
80-
NOTICE_3,
81-
WARN_4,
82-
ERROR_5,
83-
CRITICAL_6,
84-
FATAL_7
85-
}
86-
87-
enum ClientType {
88-
CLI_0,
89-
GUI_1
90-
}
91-
92-
record UserVersionVector {
93-
long id;
94-
int sigHints;
95-
long sigChain;
96-
Time cachedAt;
97-
Time lastIdentifiedAt;
98-
}
99-
100-
record UserPlusKeys {
101-
UID uid;
102-
string username;
103-
104-
// This is a misnomer; it's actually all keys, including PGP; let's deprecate
105-
// this field in a few versions
106-
array<PublicKey> deviceKeys;
107-
108-
// A duplicate of deviceKeys above, but with a better name
109-
array<PublicKey> keys;
110-
111-
UserVersionVector uvv;
112-
}
113-
5+
@typedef("long")
6+
record Time {}
7+
8+
record StringKVPair {
9+
string key;
10+
string value;
11+
}
12+
13+
record Status {
14+
int code;
15+
string name;
16+
string desc;
17+
array<StringKVPair> fields;
18+
}
19+
20+
@typedef("string")
21+
record UID {}
22+
23+
@typedef("string")
24+
record DeviceID {}
25+
26+
@typedef("string")
27+
record SigID {}
28+
29+
@typedef("string")
30+
record KID {}
31+
32+
record Text {
33+
string data;
34+
boolean markup;
35+
}
36+
37+
record PGPIdentity {
38+
string username;
39+
string comment;
40+
string email;
41+
}
42+
43+
record PublicKey {
44+
KID KID;
45+
string PGPFingerprint; // empty for non-PGP keys
46+
array<PGPIdentity> PGPIdentities; // same
47+
boolean isSibkey;
48+
boolean isEldest;
49+
string parentID;
50+
DeviceID deviceID;
51+
string deviceDescription;
52+
string deviceType;
53+
Time cTime;
54+
Time eTime;
55+
}
56+
57+
record User {
58+
UID uid;
59+
string username;
60+
}
61+
62+
record Device {
63+
string type;
64+
string name;
65+
DeviceID deviceID;
66+
Time cTime;
67+
Time mTime;
68+
KID encryptKey;
69+
KID verifyKey;
70+
}
71+
72+
record Stream {
73+
int fd;
74+
}
75+
76+
enum LogLevel {
77+
NONE_0,
78+
DEBUG_1,
79+
INFO_2,
80+
NOTICE_3,
81+
WARN_4,
82+
ERROR_5,
83+
CRITICAL_6,
84+
FATAL_7
85+
}
86+
87+
enum ClientType {
88+
CLI_0,
89+
GUI_1
90+
}
91+
92+
record UserVersionVector {
93+
long id;
94+
int sigHints;
95+
long sigChain;
96+
Time cachedAt;
97+
Time lastIdentifiedAt;
98+
}
99+
100+
record UserPlusKeys {
101+
UID uid;
102+
string username;
103+
104+
// This is a misnomer; it's actually all keys, including PGP; let's deprecate
105+
// this field in a few versions
106+
array<PublicKey> deviceKeys;
107+
108+
// A duplicate of deviceKeys above, but with a better name
109+
array<PublicKey> keys;
110+
111+
UserVersionVector uvv;
112+
}
113+
114114
}

0 commit comments

Comments
 (0)