Commit Graph

141 Commits

Author SHA1 Message Date
Norio Nomura 5b63b6bfa7 Fix #294 2015-12-27 14:52:22 +09:00
JP Simard 8d529f1804 Fix multibyte handling in many rules 2015-12-24 20:59:15 -05:00
JP Simard 4c770d52c9 fix superfluousOrMissingParameterDocumentation regression
where commentParameters.count > labelsAndParams.count
2015-12-23 23:45:03 -05:00
JP Simard d50a78e85c don't require documentation for unlabelled parameters 2015-12-23 23:26:49 -05:00
JP Simard e8a8f4042e eagerly match parameters in ValidDocsRule 2015-12-23 23:26:19 -05:00
Norio Nomura abf1968d06 Change guard condition to fails earlier
This commit reduces the duration of linting KeychainAccess from:
```
swiftlint lint  5.37s user 0.14s system 93% cpu 5.889 total
```
to:
```
swiftlint lint  3.74s user 0.13s system 91% cpu 4.238 total
```

the duration of linting Carthage is reduced from:
```
swiftlint lint  33.48s user 1.86s system 82% cpu 42.645 total
```
to:
```
swiftlint lint  29.61s user 1.81s system 79% cpu 39.377 total
```
2015-12-23 20:23:38 +09:00
JP Simard b21ae55a3b small fixes after #283 2015-12-22 23:34:56 -05:00
JP Simard c898b25ba3 Merge pull request #283 from brianpartridge/bp/auto-correct-colon-rule
Add autocorrect for ColonRule.
2015-12-22 23:30:09 -05:00
Brian Partridge f8c1771a32 Review feedback. 2015-12-21 18:31:46 -05:00
Brian Partridge 9508fb1165 Add autocorrect for ColonRule. 2015-12-21 08:22:44 -05:00
Yasuhiro Inami 05efe54d28 Add ClosingBraceRule. 2015-12-19 15:59:32 +09:00
Yasuhiro Inami afcc64bb63 Change to private let. 2015-12-19 13:21:40 +09:00
Yasuhiro Inami d5908b04fb Add File.ruleEnabledViolatingRanges() 2015-12-19 13:19:02 +09:00
Yasuhiro Inami a6d46992db Improve & add autocorrect test for OpeningBraceRule. 2015-12-19 13:19:02 +09:00
Yasuhiro Inami 39857ecda8 Improve autocorrect for OpeningBraceRule. 2015-12-19 13:19:02 +09:00
Diogo Guimaraes 90a98dcea4 Fix return validation 2015-12-18 14:18:51 +00:00
JP Simard 03b81b86a5 mark trailingNewlineCount() as private 2015-12-05 21:09:43 -08:00
JP Simard d7cd1418c7 fix nsrangeToIndexRange to use NSString indexing rather than grapheme clusters 2015-12-05 21:09:43 -08:00
JP Simard 7a12c49560 Don't correct if a rule is disabled locally 2015-12-05 21:09:43 -08:00
JP Simard 5be62adfd4 report corrections 2015-12-05 21:09:43 -08:00
JP Simard f30b0791db autocorrect trailing semicolon violations 2015-12-05 21:09:43 -08:00
JP Simard e953a3a57b autocorrect trailing newline violations 2015-12-05 21:09:43 -08:00
JP Simard cea94ce255 autocorrect trailing whitespace violations 2015-12-05 21:09:43 -08:00
JP Simard 008f85f3ac Fix issues with multi-byte characters. Fixes #234. 2015-12-03 14:49:44 -08:00
JP Simard 6c64b10917 [ValidDocsRule] skip comments with batched parameters 2015-11-30 01:05:33 -08:00
JP Simard 810039bcb3 [ValidDocsRule] trigger a violation when there's superfluous parameter docs 2015-11-29 21:58:21 -08:00
JP Simard 41b75cef97 [ValidDocsRule] simplify multiple checks 2015-11-29 21:58:21 -08:00
JP Simard 0f6cb2f404 [ValidDocsRule] check for missing or superfluous "throws" documentation 2015-11-29 21:58:21 -08:00
JP Simard 00c4de4050 [ValidDocsRule] check for missing or superfluous "return" documentation 2015-11-29 21:58:21 -08:00
JP Simard 3f12970342 [ValidDocsRule] improve variable naming 2015-11-29 21:58:21 -08:00
JP Simard eb6e52ee1a [ValidDocsRule] skip :nodoc: & make parameter name detection more flexible
by allowing the use of either the parameter name or its label
2015-11-29 21:58:21 -08:00
JP Simard 9cc9e64374 add Valid Docs rule 2015-11-29 21:58:16 -08:00
JP Simard 96a4e6cc2f remove init() from Rule. 2015-11-29 21:43:53 -08:00
Marcelo Fabri 63216c56cb Refactoring LegacyConstructorRule 2015-11-29 21:40:08 -02:00
Marcelo Fabri 1fec14180f Adding LegacyConstructorRule 2015-11-29 01:46:06 -02:00
Marcelo Fabri 1bc53b50fe Fixing typo 2015-11-28 01:12:14 -02:00
Marcelo Fabri 815f19632b Variable name violation should be ignored if the entire name is in capitals 2015-11-28 00:16:56 -02:00
JP Simard 9be89a686e fix inappropriate uses of flatMap where we should be using map 2015-11-27 17:32:21 -08:00
JP Simard 9276ec178d fix statement position rule false positives. fixes #237. 2015-11-26 11:23:25 -08:00
JP Simard 80a1068a58 minor syntax fix in ControlStatementRule 2015-11-20 21:56:42 -08:00
JP Simard 68ec42d3cb minor refactor of NestingRule 2015-11-20 21:46:45 -08:00
JP Simard 173c0058ca Merge pull request #217 from crimsonwoods/fix_issue_213_wrong_line_number_is_detected
Fix an issue: wrong line number and/or index is reported
2015-11-17 19:44:57 -08:00
crimsonwoods 4806e31f23 Rename lineAndCharacterForByteOffset to lineAndCharacterForCharacterOffset.
According to a change 247f02eff4,
method name should be changed.
2015-11-18 12:05:08 +09:00
JP Simard 73896ee04c add force try rule 2015-11-17 16:51:37 -08:00
JP Simard ecb2a8bee5 refactor variable name rules 2015-11-17 16:13:06 -08:00
JP Simard c31f33b49e check isEmpty rather than test count against zero 2015-11-17 13:17:24 -08:00
JP Simard d269bde1fa allow trailing semicolons in comments 2015-11-17 11:41:02 -08:00
JP Simard 0a2b9e8a54 add trailing semicolon rule 2015-11-17 10:46:26 -08:00
JP Simard a45043bbaf use verifyRule to test Trailing Newline rule 2015-11-17 10:44:30 -08:00
JP Simard 66a8b4441d minor improvements to the variable name family of rules 2015-11-17 10:30:53 -08:00