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
JP Simard
4ae7f2fca9
use verifyRule to test FileLengthRule
2016-01-24 13:18:19 -08:00
JP Simard
e0e0ec4e68
use verifyRule to test LineLengthRule
2016-01-24 13:15:31 -08:00
JP Simard
a9f681955b
use verifyRule to test TypeBodyLengthRule
2016-01-24 13:06:50 -08:00
JP Simard
2b286b67b7
refactor testTypeNames to use verifyRule
2016-01-24 12:44:17 -08:00
JP Simard
485c23fe7b
make measureComplexity a bit more functional
2016-01-24 12:34:32 -08:00
JP Simard
34441da963
stylistic edits for CyclomaticComplexityRule
2016-01-24 12:34:32 -08:00
Denis Lebedev
2d4be3aca8
Cleanup rule code
2016-01-24 12:34:32 -08:00
Denis Lebedev
dbb7938f54
Add POC of complexity rule
2016-01-24 12:34:32 -08:00
Scott Hoyt
75f2068299
Switch to if/early return for VariableNameRule.
2016-01-23 17:53:27 -08:00
Scott Hoyt
44ff8effc9
Reset VariableNameRule to if check on return as opposed to guard.
2016-01-23 17:42:13 -08:00
Scott Hoyt
b145bf1212
Reset VariableNameRule to instantiating Location at the call site.
2016-01-23 17:42:13 -08:00
Scott Hoyt
610782220c
Make ConfigurationError marginally more useful by not squashing it in Configuration.rulesFromDict.
2016-01-23 17:42:13 -08:00
Scott Hoyt
e2265cf9a7
Removed ViolationSeverity extension. Moved into a private function of SeverityConfig.
2016-01-23 17:42:13 -08:00
Scott Hoyt
95a7352760
Remove unnecessary Swift namespace for min and max calls.
2016-01-23 17:42:13 -08:00
Scott Hoyt
9f20fc2232
Switch SeverityConfig.setConfig to guard for better semantics.
2016-01-23 17:42:13 -08:00
Scott Hoyt
42a6e9fde4
Use guard in NameConfig.setConfig for better semantics.
2016-01-23 17:42:13 -08:00
Scott Hoyt
6132d5d282
Provide default implementation for RuleConfig.isEqualTo when it is Equatable.
2016-01-23 17:42:13 -08:00
Scott Hoyt
123d06e585
Switch VariableNameRule to use a guard for early exit if name is excluded.
2016-01-23 17:42:13 -08:00
Scott Hoyt
284d4e1cca
Extracted ViolationSeverity initialization via unnormalized String to extension.
2016-01-23 17:42:13 -08:00
Scott Hoyt
885b47d8e7
Extract severity function to ConfigProviderRule extension for better encapsulation.
2016-01-23 17:42:13 -08:00
Scott Hoyt
943ed306a3
Modified names for brevity.
2016-01-23 17:42:13 -08:00
Scott Hoyt
f722bcf360
All Rules (with the exception of MissingDocs) now provide some severity configuration.
2016-01-23 17:42:13 -08:00