Merge lp:~saviq/unity/phablet.newlines-at-end-check into lp:unity/phablet

Proposed by Michał Sawicz
Status: Merged
Approved by: Albert Astals Cid
Approved revision: no longer in the source branch.
Merged at revision: 661
Proposed branch: lp:~saviq/unity/phablet.newlines-at-end-check
Merge into: lp:unity/phablet
Diff against target: 230 lines (+8/-25)
23 files modified
Components/RatingStars.qml (+0/-1)
Dash/Apps/RunningApplicationsGrid.qml (+0/-1)
Dash/DashBar.qml (+0/-1)
plugins/Unity/CMakeLists.txt (+0/-1)
plugins/Unity/categories.cpp (+0/-1)
plugins/Unity/lens.cpp (+0/-1)
plugins/Unity/lenses.cpp (+0/-1)
plugins/Unity/peoplepreviewdata.cpp (+0/-1)
plugins/Utils/qsortfilterproxymodelqml.cpp (+0/-1)
plugins/Utils/ubuntuwindow.cpp (+0/-1)
tests/autopilot/qml_phone_shell/tests/__init__.py (+0/-1)
tests/cleanincludes/includechecker.py (+0/-2)
tests/mocks/Ubuntu/Application/ApplicationInfo.h (+0/-1)
tests/mocks/Ubuntu/Application/ApplicationListModel.h (+0/-1)
tests/mocks/Ubuntu/Application/plugin.h (+0/-2)
tests/plugins/Utils/modeltest.cpp (+0/-1)
tests/plugins/Utils/qlimitproxymodeltest.cpp (+0/-1)
tests/plugins/Utils/qsortfilterproxymodeltest.cpp (+0/-1)
tests/qmltests/Components/tst_FilterGrid.qml (+0/-1)
tests/qmltests/Components/tst_Revealer.qml (+0/-1)
tests/qmltests/Dash/tst_FilterGrids.qml (+0/-1)
tests/utils/modules/Unity/Test/testutil.h (+0/-1)
tests/whitespace/check_whitespace.py (+8/-1)
To merge this branch: bzr merge lp:~saviq/unity/phablet.newlines-at-end-check
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Albert Astals Cid (community) Approve
Review via email: mp+162948@code.launchpad.net

Commit message

add a check for multiple newlines at end of file to whitespace test

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :

Ok

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Components/RatingStars.qml'
2--- Components/RatingStars.qml 2013-02-27 18:19:51 +0000
3+++ Components/RatingStars.qml 2013-05-08 09:54:25 +0000
4@@ -39,4 +39,3 @@
5 }
6 }
7 }
8-
9
10=== modified file 'Dash/Apps/RunningApplicationsGrid.qml'
11--- Dash/Apps/RunningApplicationsGrid.qml 2013-04-19 15:09:24 +0000
12+++ Dash/Apps/RunningApplicationsGrid.qml 2013-05-08 09:54:25 +0000
13@@ -81,4 +81,3 @@
14 NumberAnimation { properties: "x,y"; duration: 400; easing.type: Easing.OutCubic }
15 }
16 }
17-
18
19=== modified file 'Dash/DashBar.qml'
20--- Dash/DashBar.qml 2013-01-15 11:37:07 +0000
21+++ Dash/DashBar.qml 2013-05-08 09:54:25 +0000
22@@ -145,4 +145,3 @@
23 }
24 ]
25 }
26-
27
28=== modified file 'plugins/Unity/CMakeLists.txt'
29--- plugins/Unity/CMakeLists.txt 2013-04-24 14:17:34 +0000
30+++ plugins/Unity/CMakeLists.txt 2013-05-08 09:54:25 +0000
31@@ -47,4 +47,3 @@
32 install(FILES qmldir
33 DESTINATION ${SHELL_APP_DIR}/plugins/Unity
34 )
35-
36
37=== modified file 'plugins/Unity/categories.cpp'
38--- plugins/Unity/categories.cpp 2013-04-10 23:56:47 +0000
39+++ plugins/Unity/categories.cpp 2013-05-08 09:54:25 +0000
40@@ -180,4 +180,3 @@
41 return QVariant();
42 }
43 }
44-
45
46=== modified file 'plugins/Unity/lens.cpp'
47--- plugins/Unity/lens.cpp 2013-04-10 23:56:47 +0000
48+++ plugins/Unity/lens.cpp 2013-05-08 09:54:25 +0000
49@@ -336,4 +336,3 @@
50
51 setNoResultsHint(hint);
52 }
53-
54
55=== modified file 'plugins/Unity/lenses.cpp'
56--- plugins/Unity/lenses.cpp 2013-04-19 16:09:55 +0000
57+++ plugins/Unity/lenses.cpp 2013-05-08 09:54:25 +0000
58@@ -180,4 +180,3 @@
59
60 delete lens;
61 }
62-
63
64=== modified file 'plugins/Unity/peoplepreviewdata.cpp'
65--- plugins/Unity/peoplepreviewdata.cpp 2013-04-24 13:23:27 +0000
66+++ plugins/Unity/peoplepreviewdata.cpp 2013-05-08 09:54:25 +0000
67@@ -436,4 +436,3 @@
68 m_addressList.append(address);
69 }
70 }
71-
72
73=== modified file 'plugins/Utils/qsortfilterproxymodelqml.cpp'
74--- plugins/Utils/qsortfilterproxymodelqml.cpp 2013-04-16 15:54:41 +0000
75+++ plugins/Utils/qsortfilterproxymodelqml.cpp 2013-05-08 09:54:25 +0000
76@@ -128,4 +128,3 @@
77 return -1;
78 }
79 }
80-
81
82=== modified file 'plugins/Utils/ubuntuwindow.cpp'
83--- plugins/Utils/ubuntuwindow.cpp 2013-04-10 08:11:52 +0000
84+++ plugins/Utils/ubuntuwindow.cpp 2013-05-08 09:54:25 +0000
85@@ -34,4 +34,3 @@
86 qDebug() << "setUbuntuSurfaceRole" << ubuntuSurfaceRole;
87 m_window->setProperty("UbuntuSurfaceRole", ubuntuSurfaceRole);
88 }
89-
90
91=== modified file 'tests/autopilot/qml_phone_shell/tests/__init__.py'
92--- tests/autopilot/qml_phone_shell/tests/__init__.py 2013-04-23 20:48:54 +0000
93+++ tests/autopilot/qml_phone_shell/tests/__init__.py 2013-05-08 09:54:25 +0000
94@@ -71,4 +71,3 @@
95 @property
96 def main_window(self):
97 return MainWindow(self.app)
98-
99
100=== modified file 'tests/cleanincludes/includechecker.py'
101--- tests/cleanincludes/includechecker.py 2013-04-10 11:40:01 +0000
102+++ tests/cleanincludes/includechecker.py 2013-05-08 09:54:25 +0000
103@@ -72,5 +72,3 @@
104 sys.exit(1)
105 if check_headers(incdir):
106 sys.exit(1)
107-
108-
109
110=== modified file 'tests/mocks/Ubuntu/Application/ApplicationInfo.h'
111--- tests/mocks/Ubuntu/Application/ApplicationInfo.h 2013-04-29 18:21:20 +0000
112+++ tests/mocks/Ubuntu/Application/ApplicationInfo.h 2013-05-08 09:54:25 +0000
113@@ -101,4 +101,3 @@
114 Q_DECLARE_METATYPE(ApplicationInfo*)
115
116 #endif // APPLICATION_H
117-
118
119=== modified file 'tests/mocks/Ubuntu/Application/ApplicationListModel.h'
120--- tests/mocks/Ubuntu/Application/ApplicationListModel.h 2013-04-29 18:21:20 +0000
121+++ tests/mocks/Ubuntu/Application/ApplicationListModel.h 2013-05-08 09:54:25 +0000
122@@ -69,4 +69,3 @@
123 Q_DECLARE_METATYPE(ApplicationListModel*)
124
125 #endif // APPLICATION_LIST_MODEL_H
126-
127
128=== modified file 'tests/mocks/Ubuntu/Application/plugin.h'
129--- tests/mocks/Ubuntu/Application/plugin.h 2013-04-12 14:41:56 +0000
130+++ tests/mocks/Ubuntu/Application/plugin.h 2013-05-08 09:54:25 +0000
131@@ -27,6 +27,4 @@
132 void registerTypes(const char *uri);
133 };
134
135-
136 #endif
137-
138
139=== modified file 'tests/plugins/Utils/modeltest.cpp'
140--- tests/plugins/Utils/modeltest.cpp 2013-04-17 08:12:32 +0000
141+++ tests/plugins/Utils/modeltest.cpp 2013-05-08 09:54:25 +0000
142@@ -602,4 +602,3 @@
143 QVERIFY(start < itemCount);
144 QVERIFY(end < itemCount);
145 }
146-
147
148=== modified file 'tests/plugins/Utils/qlimitproxymodeltest.cpp'
149--- tests/plugins/Utils/qlimitproxymodeltest.cpp 2013-04-16 15:56:55 +0000
150+++ tests/plugins/Utils/qlimitproxymodeltest.cpp 2013-05-08 09:54:25 +0000
151@@ -469,4 +469,3 @@
152 QTEST_MAIN(QLimitProxyModelTest)
153
154 #include "qlimitproxymodeltest.moc"
155-
156
157=== modified file 'tests/plugins/Utils/qsortfilterproxymodeltest.cpp'
158--- tests/plugins/Utils/qsortfilterproxymodeltest.cpp 2013-04-16 15:56:55 +0000
159+++ tests/plugins/Utils/qsortfilterproxymodeltest.cpp 2013-05-08 09:54:25 +0000
160@@ -268,4 +268,3 @@
161 QTEST_MAIN(QSortFilterProxyModelTest)
162
163 #include "qsortfilterproxymodeltest.moc"
164-
165
166=== modified file 'tests/qmltests/Components/tst_FilterGrid.qml'
167--- tests/qmltests/Components/tst_FilterGrid.qml 2013-04-22 10:27:07 +0000
168+++ tests/qmltests/Components/tst_FilterGrid.qml 2013-05-08 09:54:25 +0000
169@@ -196,4 +196,3 @@
170 }
171 }
172 }
173-
174
175=== modified file 'tests/qmltests/Components/tst_Revealer.qml'
176--- tests/qmltests/Components/tst_Revealer.qml 2013-04-17 13:01:10 +0000
177+++ tests/qmltests/Components/tst_Revealer.qml 2013-05-08 09:54:25 +0000
178@@ -260,4 +260,3 @@
179 }
180 }
181 }
182-
183
184=== modified file 'tests/qmltests/Dash/tst_FilterGrids.qml'
185--- tests/qmltests/Dash/tst_FilterGrids.qml 2013-04-19 10:52:54 +0000
186+++ tests/qmltests/Dash/tst_FilterGrids.qml 2013-05-08 09:54:25 +0000
187@@ -145,4 +145,3 @@
188 target: gridLoader.item
189 }
190 }
191-
192
193=== modified file 'tests/utils/modules/Unity/Test/testutil.h'
194--- tests/utils/modules/Unity/Test/testutil.h 2013-04-17 15:56:07 +0000
195+++ tests/utils/modules/Unity/Test/testutil.h 2013-05-08 09:54:25 +0000
196@@ -35,4 +35,3 @@
197 QML_DECLARE_TYPE(TestUtil)
198
199 #endif // TESTUTIL_H
200-
201
202=== modified file 'tests/whitespace/check_whitespace.py'
203--- tests/whitespace/check_whitespace.py 2013-04-18 08:58:58 +0000
204+++ tests/whitespace/check_whitespace.py 2013-05-08 09:54:25 +0000
205@@ -55,10 +55,15 @@
206 def scan_for_bad_whitespace(file_path):
207 global tab_indent_pat, whitespace_pat
208 errors = []
209+ newlines_at_end = 0
210 with open(file_path, 'rt', encoding='utf-8') as ifile:
211 for lino, line in enumerate(ifile, start=1):
212 if whitespace_pat.match(line) or tab_indent_pat.match(line):
213 errors.append(lino)
214+ if line == "\n":
215+ newlines_at_end += 1
216+ else:
217+ newlines_at_end = 0
218 if 0 < len(errors) <= 10:
219 if len(errors) > 1:
220 plural = 's'
221@@ -67,7 +72,9 @@
222 print("%s: bad whitespace in line%s %s" % (file_path, plural, ", ".join((str(i) for i in errors))))
223 elif errors:
224 print("%s: bad whitespace in multiple lines" % file_path)
225- return bool(errors)
226+ if newlines_at_end:
227+ print("%s: multiple new lines at end of file" % file_path)
228+ return bool(errors) or newlines_at_end
229
230 # Parse args
231

Subscribers

People subscribed via source and target branches