Commit Graph

467 Commits

Author SHA1 Message Date
Denis Lebedev 81e7f347ce Implement ParametersListLengthRule 2016-01-31 14:09:11 -08:00
Norio Nomura 5ebd64629a Improve performance of LineLengthRule
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.31s user 1.05s system 85% cpu 20.313 total
```
2016-01-31 13:57:37 -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 57025565d5 Improve performance of ColonRule
The duration of `ColonRule` on linting Carthage 0.11 is reduced from 2287ms to 1581ms by Instruments.
2016-01-30 22:10:38 +09:00
Norio Nomura fe6cdb2bdc Add calls invalidateCache() on every corrections in Linter.correct()
Cache entry should be invalidate on every corrections,
because caches and content may not match after corrections.
2016-01-30 15:46:47 +09: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
Daniel Beard 998bed9716 Add whitelist only rules 2016-01-29 13:55:31 -08:00
JP Simard 532c7d7ce7 release 0.7.2 2016-01-28 17:21:13 -08:00
JP Simard b8ed788775 add more validation when setting a config dictionary
in SeverityLevelsConfig.setConfig
2016-01-28 10:39:15 -08:00
Robin Kunde f65b9d3e44 Disable SeverityLevelsConfig error ruleParam if only warning is set. This prevents the potential creation of invalid configs by implicit definition in Yaml. 2016-01-28 10:39:15 -08:00
JP Simard 611c4a8558 fix indentation in one ValidDocsRule example 2016-01-28 10:14:17 -08:00
Diogo Guimaraes 232873832b Fix validDocsRule 2016-01-28 15:29:56 +00: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
JP Simard 2e56ac513a release 0.7.1 2016-01-26 11:27:27 -08:00
JP Simard 614c27ab1d optimize ForceUnwrappingRule 2016-01-26 10:49:14 -08:00
JP Simard 01832356ce make ForceUnwrappingRule conform to ConfigProviderRule 2016-01-26 10:49:05 -08:00
JP Simard b3c68474f7 fix indentation in ForceUnwrappingRule 2016-01-26 10:48:40 -08:00
Benjamin Otto fccd2796d1 Changed location for force unwrapping rule violation
- Changed the `Location` of the StyleViolation to point to the `!` that actually does the unwrapping
2016-01-26 10:48:40 -08:00
Benjamin Otto 5d02d70c63 Added a force unwrapping rule
The rule will create a warning for all force unwrappings
2016-01-26 10:48:31 -08:00
JP Simard eb89b89d4b make ValidDocsRule a bit more DRY 2016-01-26 09:54:24 -08:00
Diogo Guimaraes 0aaf01417b Fix ValidDocs rule 2016-01-26 13:54:56 +00:00
JP Simard 6a3c3bfa3b also benchmark rule times when running lint with --benchmark 2016-01-25 23:27:30 -08:00
JP Simard d8167e83d7 add --benchmark option to LintCommand
to benchmark how long each file took to lint
2016-01-25 23:27:30 -08:00
Norio Nomura d48bf364f8 Remove old VariableName*LengthRules.swift files
These are unused since ee3fe42.
2016-01-26 09:54:33 +09:00
Scott Hoyt 3aa5393b3d Fix typo. 2016-01-25 10:03:28 -08:00
Scott Hoyt 2f60e0b8f1 Removed unneeded rule disable. 2016-01-25 10:02:55 -08:00
Scott Hoyt 9ef5f165eb Made regex required for RegexConfig. 2016-01-25 07:26:31 -08:00
Scott Hoyt ccdd81af61 Switch guard early exit with if for CustomRules.validateFile. 2016-01-25 07:26:31 -08:00
Scott Hoyt c1406e10ce Added convenience initializer to NSRegularExpression for SwiftLint defaults. 2016-01-25 07:26:31 -08:00
Scott Hoyt b76a3d2ae6 Added tests. 2016-01-25 07:26:31 -08:00
Scott Hoyt 021affba73 Added the ability to set a rule name. 2016-01-25 07:26:31 -08:00
Scott Hoyt 2974a81c54 Switched out SyntaxKind(shortName:) implementation for something simpler. 2016-01-25 07:26:31 -08:00
Scott Hoyt 08a7560881 Switch RegexConfig.matchTokens to RegexConfig.matchKinds. Properly reset set if key exists. 2016-01-25 07:26:31 -08:00
Scott Hoyt c6c088b3bc Fix broken tests by removing SwiftXCP import. 2016-01-25 07:26:31 -08:00
Scott Hoyt 45d8633514 Added CustomRules to masterRuleList. 2016-01-25 07:26:31 -08:00
Scott Hoyt 923b4c4e7e Update RegexConfig to use a Set for matchTokens. Fixed CustomRules. 2016-01-25 07:26:31 -08:00
Scott Hoyt 0a4602b3e6 Refactored matchPattern to expose a method for supplying pre-initialized regex. 2016-01-25 07:26:31 -08:00
Scott Hoyt 615873adc2 Added to SyntaxKind+SwiftLint. RegexConfig now defaults to allKinds(). 2016-01-25 07:26:31 -08:00
Scott Hoyt b984d05e32 Use shortName instead of nickname. 2016-01-25 07:26:31 -08:00
Scott Hoyt fede0ccc2d Added convenience for RegexConfig.severity 2016-01-25 07:26:31 -08:00
Scott Hoyt 49bd5ae91f Use flatMap instead. 2016-01-25 07:26:31 -08:00
Scott Hoyt db10bff4d2 Fleshed out validateFile for CustomRules. 2016-01-25 07:26:31 -08:00
Scott Hoyt f463b9ba40 Filled out implementation details for RegexConfig.setConfig(). 2016-01-25 07:26:31 -08:00
Scott Hoyt f2cab3e296 Added CustomRulesConfig. 2016-01-25 07:26:31 -08:00
Scott Hoyt a266901216 Fixed typo. 2016-01-25 07:26:31 -08:00
Scott Hoyt 0177f09be6 Stub out RegexConfig. 2016-01-25 07:26:31 -08:00
Scott Hoyt 8cc5ba4f32 Stub out CustomRules. 2016-01-25 07:26:31 -08:00
Norio Nomura 5933e31228 Optimize File.allDeclarationsByType
It rebuilds `_allDeclarationsByType` incrementally.
By applying this, the duration of linting Carthage is reduced from:
```
swiftlint lint --config ~/.swiftlint-test.yml  23.05s user 1.85s system 82% cpu 30.338 total
```
to:
```
swiftlint lint --config ~/.swiftlint-test.yml  20.09s user 1.34s system 84% cpu 25.329 total
```
2016-01-25 22:45:22 +09:00
JP Simard 7eca6aa77c release 0.7.0 2016-01-24 14:30:05 -08:00