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
=== modified file 'Components/RatingStars.qml'
--- Components/RatingStars.qml 2013-02-27 18:19:51 +0000
+++ Components/RatingStars.qml 2013-05-08 09:54:25 +0000
@@ -39,4 +39,3 @@
39 }39 }
40 }40 }
41}41}
42
4342
=== modified file 'Dash/Apps/RunningApplicationsGrid.qml'
--- Dash/Apps/RunningApplicationsGrid.qml 2013-04-19 15:09:24 +0000
+++ Dash/Apps/RunningApplicationsGrid.qml 2013-05-08 09:54:25 +0000
@@ -81,4 +81,3 @@
81 NumberAnimation { properties: "x,y"; duration: 400; easing.type: Easing.OutCubic }81 NumberAnimation { properties: "x,y"; duration: 400; easing.type: Easing.OutCubic }
82 }82 }
83}83}
84
8584
=== modified file 'Dash/DashBar.qml'
--- Dash/DashBar.qml 2013-01-15 11:37:07 +0000
+++ Dash/DashBar.qml 2013-05-08 09:54:25 +0000
@@ -145,4 +145,3 @@
145 }145 }
146 ]146 ]
147}147}
148
149148
=== modified file 'plugins/Unity/CMakeLists.txt'
--- plugins/Unity/CMakeLists.txt 2013-04-24 14:17:34 +0000
+++ plugins/Unity/CMakeLists.txt 2013-05-08 09:54:25 +0000
@@ -47,4 +47,3 @@
47install(FILES qmldir47install(FILES qmldir
48 DESTINATION ${SHELL_APP_DIR}/plugins/Unity48 DESTINATION ${SHELL_APP_DIR}/plugins/Unity
49 )49 )
50
5150
=== modified file 'plugins/Unity/categories.cpp'
--- plugins/Unity/categories.cpp 2013-04-10 23:56:47 +0000
+++ plugins/Unity/categories.cpp 2013-05-08 09:54:25 +0000
@@ -180,4 +180,3 @@
180 return QVariant();180 return QVariant();
181 }181 }
182}182}
183
184183
=== modified file 'plugins/Unity/lens.cpp'
--- plugins/Unity/lens.cpp 2013-04-10 23:56:47 +0000
+++ plugins/Unity/lens.cpp 2013-05-08 09:54:25 +0000
@@ -336,4 +336,3 @@
336336
337 setNoResultsHint(hint);337 setNoResultsHint(hint);
338}338}
339
340339
=== modified file 'plugins/Unity/lenses.cpp'
--- plugins/Unity/lenses.cpp 2013-04-19 16:09:55 +0000
+++ plugins/Unity/lenses.cpp 2013-05-08 09:54:25 +0000
@@ -180,4 +180,3 @@
180180
181 delete lens;181 delete lens;
182}182}
183
184183
=== modified file 'plugins/Unity/peoplepreviewdata.cpp'
--- plugins/Unity/peoplepreviewdata.cpp 2013-04-24 13:23:27 +0000
+++ plugins/Unity/peoplepreviewdata.cpp 2013-05-08 09:54:25 +0000
@@ -436,4 +436,3 @@
436 m_addressList.append(address);436 m_addressList.append(address);
437 }437 }
438}438}
439
440439
=== modified file 'plugins/Utils/qsortfilterproxymodelqml.cpp'
--- plugins/Utils/qsortfilterproxymodelqml.cpp 2013-04-16 15:54:41 +0000
+++ plugins/Utils/qsortfilterproxymodelqml.cpp 2013-05-08 09:54:25 +0000
@@ -128,4 +128,3 @@
128 return -1;128 return -1;
129 }129 }
130}130}
131
132131
=== modified file 'plugins/Utils/ubuntuwindow.cpp'
--- plugins/Utils/ubuntuwindow.cpp 2013-04-10 08:11:52 +0000
+++ plugins/Utils/ubuntuwindow.cpp 2013-05-08 09:54:25 +0000
@@ -34,4 +34,3 @@
34 qDebug() << "setUbuntuSurfaceRole" << ubuntuSurfaceRole;34 qDebug() << "setUbuntuSurfaceRole" << ubuntuSurfaceRole;
35 m_window->setProperty("UbuntuSurfaceRole", ubuntuSurfaceRole);35 m_window->setProperty("UbuntuSurfaceRole", ubuntuSurfaceRole);
36}36}
37
3837
=== modified file 'tests/autopilot/qml_phone_shell/tests/__init__.py'
--- tests/autopilot/qml_phone_shell/tests/__init__.py 2013-04-23 20:48:54 +0000
+++ tests/autopilot/qml_phone_shell/tests/__init__.py 2013-05-08 09:54:25 +0000
@@ -71,4 +71,3 @@
71 @property71 @property
72 def main_window(self):72 def main_window(self):
73 return MainWindow(self.app)73 return MainWindow(self.app)
74
7574
=== modified file 'tests/cleanincludes/includechecker.py'
--- tests/cleanincludes/includechecker.py 2013-04-10 11:40:01 +0000
+++ tests/cleanincludes/includechecker.py 2013-05-08 09:54:25 +0000
@@ -72,5 +72,3 @@
72 sys.exit(1)72 sys.exit(1)
73 if check_headers(incdir):73 if check_headers(incdir):
74 sys.exit(1)74 sys.exit(1)
75
76
7775
=== modified file 'tests/mocks/Ubuntu/Application/ApplicationInfo.h'
--- tests/mocks/Ubuntu/Application/ApplicationInfo.h 2013-04-29 18:21:20 +0000
+++ tests/mocks/Ubuntu/Application/ApplicationInfo.h 2013-05-08 09:54:25 +0000
@@ -101,4 +101,3 @@
101Q_DECLARE_METATYPE(ApplicationInfo*)101Q_DECLARE_METATYPE(ApplicationInfo*)
102102
103#endif // APPLICATION_H103#endif // APPLICATION_H
104
105104
=== modified file 'tests/mocks/Ubuntu/Application/ApplicationListModel.h'
--- tests/mocks/Ubuntu/Application/ApplicationListModel.h 2013-04-29 18:21:20 +0000
+++ tests/mocks/Ubuntu/Application/ApplicationListModel.h 2013-05-08 09:54:25 +0000
@@ -69,4 +69,3 @@
69Q_DECLARE_METATYPE(ApplicationListModel*)69Q_DECLARE_METATYPE(ApplicationListModel*)
7070
71#endif // APPLICATION_LIST_MODEL_H71#endif // APPLICATION_LIST_MODEL_H
72
7372
=== modified file 'tests/mocks/Ubuntu/Application/plugin.h'
--- tests/mocks/Ubuntu/Application/plugin.h 2013-04-12 14:41:56 +0000
+++ tests/mocks/Ubuntu/Application/plugin.h 2013-05-08 09:54:25 +0000
@@ -27,6 +27,4 @@
27 void registerTypes(const char *uri);27 void registerTypes(const char *uri);
28};28};
2929
30
31#endif30#endif
32
3331
=== modified file 'tests/plugins/Utils/modeltest.cpp'
--- tests/plugins/Utils/modeltest.cpp 2013-04-17 08:12:32 +0000
+++ tests/plugins/Utils/modeltest.cpp 2013-05-08 09:54:25 +0000
@@ -602,4 +602,3 @@
602 QVERIFY(start < itemCount);602 QVERIFY(start < itemCount);
603 QVERIFY(end < itemCount);603 QVERIFY(end < itemCount);
604}604}
605
606605
=== modified file 'tests/plugins/Utils/qlimitproxymodeltest.cpp'
--- tests/plugins/Utils/qlimitproxymodeltest.cpp 2013-04-16 15:56:55 +0000
+++ tests/plugins/Utils/qlimitproxymodeltest.cpp 2013-05-08 09:54:25 +0000
@@ -469,4 +469,3 @@
469QTEST_MAIN(QLimitProxyModelTest)469QTEST_MAIN(QLimitProxyModelTest)
470470
471#include "qlimitproxymodeltest.moc"471#include "qlimitproxymodeltest.moc"
472
473472
=== modified file 'tests/plugins/Utils/qsortfilterproxymodeltest.cpp'
--- tests/plugins/Utils/qsortfilterproxymodeltest.cpp 2013-04-16 15:56:55 +0000
+++ tests/plugins/Utils/qsortfilterproxymodeltest.cpp 2013-05-08 09:54:25 +0000
@@ -268,4 +268,3 @@
268QTEST_MAIN(QSortFilterProxyModelTest)268QTEST_MAIN(QSortFilterProxyModelTest)
269269
270#include "qsortfilterproxymodeltest.moc"270#include "qsortfilterproxymodeltest.moc"
271
272271
=== modified file 'tests/qmltests/Components/tst_FilterGrid.qml'
--- tests/qmltests/Components/tst_FilterGrid.qml 2013-04-22 10:27:07 +0000
+++ tests/qmltests/Components/tst_FilterGrid.qml 2013-05-08 09:54:25 +0000
@@ -196,4 +196,3 @@
196 }196 }
197 }197 }
198}198}
199
200199
=== modified file 'tests/qmltests/Components/tst_Revealer.qml'
--- tests/qmltests/Components/tst_Revealer.qml 2013-04-17 13:01:10 +0000
+++ tests/qmltests/Components/tst_Revealer.qml 2013-05-08 09:54:25 +0000
@@ -260,4 +260,3 @@
260 }260 }
261 }261 }
262}262}
263
264263
=== modified file 'tests/qmltests/Dash/tst_FilterGrids.qml'
--- tests/qmltests/Dash/tst_FilterGrids.qml 2013-04-19 10:52:54 +0000
+++ tests/qmltests/Dash/tst_FilterGrids.qml 2013-05-08 09:54:25 +0000
@@ -145,4 +145,3 @@
145 target: gridLoader.item145 target: gridLoader.item
146 }146 }
147}147}
148
149148
=== modified file 'tests/utils/modules/Unity/Test/testutil.h'
--- tests/utils/modules/Unity/Test/testutil.h 2013-04-17 15:56:07 +0000
+++ tests/utils/modules/Unity/Test/testutil.h 2013-05-08 09:54:25 +0000
@@ -35,4 +35,3 @@
35QML_DECLARE_TYPE(TestUtil)35QML_DECLARE_TYPE(TestUtil)
3636
37#endif // TESTUTIL_H37#endif // TESTUTIL_H
38
3938
=== modified file 'tests/whitespace/check_whitespace.py'
--- tests/whitespace/check_whitespace.py 2013-04-18 08:58:58 +0000
+++ tests/whitespace/check_whitespace.py 2013-05-08 09:54:25 +0000
@@ -55,10 +55,15 @@
55def scan_for_bad_whitespace(file_path):55def scan_for_bad_whitespace(file_path):
56 global tab_indent_pat, whitespace_pat56 global tab_indent_pat, whitespace_pat
57 errors = []57 errors = []
58 newlines_at_end = 0
58 with open(file_path, 'rt', encoding='utf-8') as ifile:59 with open(file_path, 'rt', encoding='utf-8') as ifile:
59 for lino, line in enumerate(ifile, start=1):60 for lino, line in enumerate(ifile, start=1):
60 if whitespace_pat.match(line) or tab_indent_pat.match(line):61 if whitespace_pat.match(line) or tab_indent_pat.match(line):
61 errors.append(lino)62 errors.append(lino)
63 if line == "\n":
64 newlines_at_end += 1
65 else:
66 newlines_at_end = 0
62 if 0 < len(errors) <= 10:67 if 0 < len(errors) <= 10:
63 if len(errors) > 1:68 if len(errors) > 1:
64 plural = 's'69 plural = 's'
@@ -67,7 +72,9 @@
67 print("%s: bad whitespace in line%s %s" % (file_path, plural, ", ".join((str(i) for i in errors))))72 print("%s: bad whitespace in line%s %s" % (file_path, plural, ", ".join((str(i) for i in errors))))
68 elif errors:73 elif errors:
69 print("%s: bad whitespace in multiple lines" % file_path)74 print("%s: bad whitespace in multiple lines" % file_path)
70 return bool(errors)75 if newlines_at_end:
76 print("%s: multiple new lines at end of file" % file_path)
77 return bool(errors) or newlines_at_end
7178
72# Parse args79# Parse args
7380

Subscribers

People subscribed via source and target branches