├── README.md
├── configs
├── Airbnb.xml
└── AirbnbAndroid.xml
└── install.sh
/README.md:
--------------------------------------------------------------------------------
1 | Java Code Styles
2 | ================
3 |
4 | IntelliJ IDEA code style settings for Airbnb's Java and Android projects (forked from Square's).
5 |
6 |
7 | Installation
8 | ------------
9 |
10 | * Run the `install.sh` script.
11 | * Restart IntelliJ if it's running.
12 | * Open IntelliJ Project Settings -> Code Styles, change the code style for the
13 | project to the one you want.
14 |
--------------------------------------------------------------------------------
/configs/Airbnb.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
--------------------------------------------------------------------------------
/configs/AirbnbAndroid.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 | xmlns:android
75 | Namespace:
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | xmlns:.*
85 | Namespace:
86 |
87 |
88 | BY_NAME
89 |
90 |
91 |
92 |
93 |
94 |
95 | .*:id
96 | http://schemas.android.com/apk/res/android
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 | .*:name
106 | http://schemas.android.com/apk/res/android
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 | name
116 | ^$
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 | style
126 | ^$
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 | .*
136 | ^$
137 |
138 |
139 | BY_NAME
140 |
141 |
142 |
143 |
144 |
145 |
146 | .*:layout_width
147 | http://schemas.android.com/apk/res/android
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 | .*:layout_height
157 | http://schemas.android.com/apk/res/android
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 | .*:layout_.*
167 | http://schemas.android.com/apk/res/android
168 |
169 |
170 | BY_NAME
171 |
172 |
173 |
174 |
175 |
176 |
177 | .*:width
178 | http://schemas.android.com/apk/res/android
179 |
180 |
181 | BY_NAME
182 |
183 |
184 |
185 |
186 |
187 |
188 | .*:height
189 | http://schemas.android.com/apk/res/android
190 |
191 |
192 | BY_NAME
193 |
194 |
195 |
196 |
197 |
198 |
199 | .*
200 | http://schemas.android.com/apk/res/android
201 |
202 |
203 | BY_NAME
204 |
205 |
206 |
207 |
208 |
209 |
210 | .*
211 | .*
212 |
213 |
214 | BY_NAME
215 |
216 |
217 |
218 |
219 |
220 |
--------------------------------------------------------------------------------
/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Installs Airbnb's IntelliJ configs into your user configs.
3 |
4 | echo "Installing Airbnb code style configs..."
5 |
6 | CONFIGS="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/configs"
7 |
8 | for i in $HOME/Library/Preferences/IntelliJIdea* \
9 | $HOME/Library/Preferences/IdeaIC* \
10 | $HOME/Library/Preferences/AndroidStudio* \
11 | $HOME/.IntelliJIdea*/config \
12 | $HOME/.IdeaIC*/config \
13 | $HOME/.AndroidStudio*/config
14 | do
15 | if [ -d $i ]; then
16 | mkdir -p $i/codestyles
17 | cp -frv "$CONFIGS"/* $i/codestyles
18 | fi
19 | done
20 |
21 | echo "Done."
22 | echo ""
23 | echo "Restart IntelliJ and/or AndroidStudio, go to preferences, and apply 'Airbnb' or 'AirbnbAndroid'."
24 |
--------------------------------------------------------------------------------