JP Simard
2b1a3fab88
remove unused function dictFromKeyValuePairs
2016-11-28 23:12:54 -08:00
JP Simard
0999f6a24b
refactor nameStrippingLeadingUnderscoreIfPrivate
2016-11-28 21:48:25 -08:00
Marcelo Fabri
fd71465cd2
Add support for filePrivate and open in rules
...
Fixes #781 and #831
2016-11-27 16:26:41 -02:00
JP Simard
e93eee31e7
generally clean up usage of swiftlint comment commands
...
used within the codebase itself.
2016-11-25 13:10:38 -08:00
JP Simard
639a18181c
allow specifying multiple rule identifiers in comment commands
2016-11-25 12:56:48 -08:00
Marcelo Fabri
c4b960000d
Adding SyntacticSugar rule
2016-11-25 12:25:10 -08:00
JP Simard
3568245c19
fix single file usage: swiftlint lint --path File.swift
2016-11-23 17:13:22 -08:00
Norio Nomura
21e3439bfa
Merge pull request #766 from masters3d/no-autocorrect-disabled-rules
...
Added disable rule test to autocorrect
2016-10-29 14:09:11 +09:00
Norio Nomura
c16efa15fb
Merge pull request #807 from masters3d/closure-spacing
...
added closure-spacing-rule
2016-10-24 19:30:13 +09:00
Norio Nomura
7702493c6c
Change File.cacheKey algorithm when File.path is nil
...
Sometime `ObjectIdentifier(self)` might collide between tests in SourceKitCrashTests.
The collision caused fail on `testAssertHandlerIsNotCalledOnNormalFile`.
2016-10-12 09:45:23 +09:00
J Cheyo Jimenez
8bed233282
added closure-spacing-rule
2016-09-03 21:10:33 -07:00
J Cheyo Jimenez
48a085cfc1
Added disable rule test to autocorrect
2016-08-30 15:41:17 -07:00
J Cheyo Jimenez
651351e3bd
fix for verticalspace regex bug
2016-08-28 21:43:42 -07:00
Cristian Filipov
ed192f35bd
Fix long lines and unit test
2016-08-22 23:17:50 -07:00
Cristian Filipov
c2a58a574a
Merge remote-tracking branch 'upstream/master' into cfilipov/fix_absolute_path
2016-08-21 23:21:39 -07:00
JP Simard
fbe768ec3c
assorted simplifications throughout the project
2016-08-21 18:36:16 -07:00
Cristian Filipov
27aa8e3383
Use path arg as root for include/exclude paths
2016-08-18 16:44:21 -07:00
JP Simard
c66c5c8df0
formatting fixes
...
found running `swiftlint autocorrect --format`
2016-05-29 14:58:28 -07:00
Craig Siemens
c3a5e33a59
Add autocorrect for ReturnArrowWhitespaceRule
2016-04-23 23:56:40 -06:00
Norio Nomura
2c19f759b2
Add File.assertHandler for testing
...
Because XCTest does not have functions that expecting assert happens.
That will be used only when sourcekitd failed, so performance regression by this is ignorable.
2016-04-13 18:40:25 +09:00
Norio Nomura
e4a161132e
Change File.sourcekitdFailed to settable and internal
...
settable is for testing.
2016-04-13 18:40:25 +09:00
Norio Nomura
43f75642f8
Change Cache<T> to working for file without path
2016-04-13 18:40:25 +09:00
Norio Nomura
350a85a3cb
Request.sendMayThrow() has been changed to Request.failableSend()
2016-04-13 18:40:25 +09:00
Norio Nomura
3ae3bfef71
Add early returns by checking File.sourcekitdFailed
2016-04-13 18:40:25 +09:00
Norio Nomura
b0cda17c4c
Move calling queueForRebuild.append(structure) to structureCache's factory closure
...
Because Swift does not allow `as? Structure?`.
2016-04-13 18:40:25 +09:00
Norio Nomura
d92b2d6037
Use Request.sendMayThrow() in SourceKittenFramework
...
For gaining advantage of using `sourcekitd_set_notification_handler()`,
we need to vacate main thread to `dispatch_main()`.
2016-04-13 18:40:25 +09:00
Erik Aigner
2c5b7a61d6
Accept variable names starting with more than one capital letter
...
The rule was modified to allow for names that start with multiple uppercase letters like XMLString or MIMEType.
Closes #566
2016-03-13 12:08:32 +01:00
JP Simard
0979aa3b64
Merge pull request #552 from realm/nn-rewrite-force-unwrapping-rule
...
Rewrite `ForceUnwrappingRule`
2016-03-09 19:53:44 -08:00
JP Simard
1166b697c2
fix docs typos
2016-03-09 19:43:52 -08:00
Neil Gall
1b4cf0c574
Do not overwrite files whose contents have not changed
2016-03-02 14:23:33 +00:00
Norio Nomura
c042258ac3
Add Structure.kindsFor(_:)
...
That returns array of tupple containing "key.kind" and "byteRange" from Structure that containing the byte offset.
2016-02-21 22:35:56 +09:00
Norio Nomura
7c2c4ac270
Apply workaround for false positive of valid_docs
...
```
SwiftLintFrameworkTests.IntegrationTests
testSwiftLintLints, failed - Documented declarations should be valid.
```
That has been fixed on locally by https://github.com/jpsim/SourceKitten/pull/175
2016-02-19 18:17:20 +09:00
Norio Nomura
67be11ac92
Improve performance of SyntaxMap.tokensIn(_:)
...
On linting Carthage 0.14, the duration of `SyntaxMap.tokensIn(_:)` reduced from 145ms to 51ms.
2016-02-19 17:55:44 +09:00
Norio Nomura
704e7bde1d
Add SyntaxMap.tokensIn(_:)
...
That returns array of SyntaxTokens intersecting with byte range.
2016-02-19 17:30:54 +09:00
Norio Nomura
be8f2ce63d
Remove surplus map calls in rangesAndTokensMatching(_:)
2016-02-17 11:11:47 +09:00
Norio Nomura
669fbf09d0
Refine ForceUnwrappingRule
...
Fix #535
The duration of `ForceUnwrappingRule` on linting Carthage 0.14 is reduced from 1415ms to 339ms by Instruments.
2016-02-14 23:07:18 +09:00
JP Simard
1866edae77
adjust access control levels for many APIs in SwiftLintFramework
...
this is done in an effort to stabilize the API for SwiftLint 1.0.
2016-02-10 17:26:06 -08:00
JP Simard
7d0afb190b
rename matchAndTokensPattern to rangesAndTokensMatching
...
also align regex pattern comments & fix indentation
2016-02-10 15:42:07 -08:00
Norio Nomura
83c008507b
Improve performance of ColonRule
...
The duration of `ColonRule` on linting Carthage 0.13 is reduced from 1673ms to 515ms by Instruments.
2016-02-10 15:16:21 -08:00
Norio Nomura
94fabdd11d
Add fflush(stdout) before fputs(…, stderr)
...
`Swift.print()` uses buffered stdout by calling `putchar(_:)`.
This avoids mixing strings from stdout and stderr.
fix #432
2016-02-08 10:26:49 +09:00
Scott Hoyt
d17f5b9d92
Modified access level of matchPattern(_, excludingSyntaxKinds:, excludingPattern:)
2016-02-02 17:15:00 -08:00
Scott Hoyt
2a623e926e
Eliminated unneeded local variable.
2016-02-02 17:15:00 -08:00
Scott Hoyt
ebaa6ec871
Increase performance by early return if matches isEmpty.
2016-02-02 17:15:00 -08:00
Scott Hoyt
0ee04c3fa3
Added exclusion pattern for matching patterns in a file. Added Array and NSRange extensions to support. Used this in OpeningBraceRule.
2016-02-02 17:15:00 -08:00
Norio Nomura
cd307cfe5a
Improve performance of syntaxKindsByLine
...
This depends on https://github.com/jpsim/SourceKitten/pull/152
The duration of linting Carthage 0.11 is reduced from 17sec to 16sec
SwiftLint(32b325b ) with SourceKitten(0f54e19):
```
swiftlint lint --config ~/.swiftlint-test.yml 17.48s user 1.12s system 83% cpu 22.182 total
```
SwiftLint(this) with SourceKitten(d7f9266):
```
swiftlint lint --config ~/.swiftlint-test.yml 16.05s user 1.05s system 85% cpu 20.051 total
```
2016-01-31 13:47:48 -08:00
Norio Nomura
28ae84600c
Add missing calls responseCache.clear() to File.clearCaches()
2016-01-30 15:35:49 +09:00
Norio Nomura
01e3da0dd3
Add File.invalidateCache() that invalidate cache entry of the file
2016-01-30 15:34:22 +09:00
Norio Nomura
97392bdc94
Add NSRegularExpression.cached(pattern:)
...
All rules enabled linting Carthage 0.11 with this commit:
- Persistent Bytes on termination is reduced from 584.67MB to 556.62MB.
- Duration is reduced from 22sec to 21sec.
Related: #394
2016-01-27 14:33:19 +09:00
Scott Hoyt
2f60e0b8f1
Removed unneeded rule disable.
2016-01-25 10:02:55 -08:00
Scott Hoyt
c1406e10ce
Added convenience initializer to NSRegularExpression for SwiftLint defaults.
2016-01-25 07:26:31 -08:00