Skip to content

Commit 098f93c

Browse files
authored
fix import pattern (#1604)
* fix import pattern * fix style * move check into cpplint.py * replace than with rather than
1 parent c1a0bf3 commit 098f93c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Firestore/Example/Tests/Local/FSTLevelDBLRUGarbageCollectorTests.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
#import <Firestore/Source/Local/FSTLevelDB.h>
1817
#import "Firestore/Example/Tests/Local/FSTLRUGarbageCollectorTests.h"
1918
#import "Firestore/Example/Tests/Local/FSTPersistenceTestHelpers.h"
19+
#import "Firestore/Source/Local/FSTLevelDB.h"
2020

2121
NS_ASSUME_NONNULL_BEGIN
2222

@@ -31,4 +31,4 @@ @implementation FSTLevelDBLRUGarbageCollectorTests
3131

3232
@end
3333

34-
NS_ASSUME_NONNULL_END
34+
NS_ASSUME_NONNULL_END

scripts/cpplint.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4529,6 +4529,13 @@ def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
45294529
'<%s> should be #include "%s" or #import <%s>' %
45304530
(match.group(1), match.group(1), match.group(1)))
45314531

4532+
# framework-style imports should not be used for project imports
4533+
match = Match(r'#import\s*<(Firestore/Source/[^>]+)', line)
4534+
if match:
4535+
error(filenamne, linenum, 'build/include', 4,
4536+
'Prefer #import "%s" for project import rather than #import <>' %
4537+
match.group(1))
4538+
45324539
# C++ system files should not be #imported
45334540
match = Match(r'#import\s*<([^/>.]+)>', line)
45344541
if match:

0 commit comments

Comments
 (0)