Commit Graph

70 Commits

Author SHA1 Message Date
Keith Smiley 65f6715915 Improve trailing newline performance
This sidesteps the previous method of reversing the entire string from
every file by only checking the minimum number of trailing characters
for each file.
2015-08-14 20:30:40 -07:00
JP Simard 90dfe362a2 [OperatorFunctionWhitespaceRule] refactored rule. Fixes #60. 2015-06-17 10:37:52 -07:00
akirahrkw 752d970bc9 fix:
remove <String.Index> because Range infers
use trailing closure syntax
2015-06-17 17:54:39 +08:00
akirahrkw a2e0f2a06d remove parameter(showExample) to use default value 2015-06-17 02:16:35 +08:00
akirahrkw 4d0b34012e cleanup: remove unused variable 2015-06-17 02:11:44 +08:00
akirahrkw 10b9ce7fb9 Revert "remove unused variable"
This reverts commit f799880259.
2015-06-17 02:07:07 +08:00
akirahrkw f799880259 remove unused variable 2015-06-17 01:48:04 +08:00
akirahrkw 32edb24ce8 fix to follow issue #60 rule 2015-06-17 01:25:43 +08:00
akirahrkw 56e2ffb95b add OperatorFunctionWhitespaceRule
#60 https://github.com/realm/SwiftLint/issues/60
2015-06-17 01:24:47 +08:00
JP Simard 3bb6e7c6a8 [ReturnArrowWhitespaceRule] small post-merge tweaks 2015-06-03 11:16:16 -07:00
akirahrkw fe4ef11939 change for ReturnArrowWhitespaceRule
1: uses default showExamples value (true)
2: uses default commentDoesntViolate value (true)
2015-06-04 01:47:58 +08:00
akirahrkw 87c7c5cd5d add ReturnArrowWhitespaceRule
This rule checks whether you have 1 space before return arrow and return type

Good: func abc() -> Int {}
Bad:  func abc()->Int {}
2015-06-03 16:26:21 +08:00
JP Simard 7fc587cc94 Release 0.1.1 2015-05-29 09:15:49 -07:00
JP Simard 704e6009b1 [IntegrationTests] Added testSwiftLintLints(). Yo dawg. 2015-05-28 17:37:12 -07:00
JP Simard 88c6e777f4 [Location] NSString.lineAndCharacterForByteOffset(_:) now works. Fixes #62. 2015-05-28 16:19:19 -07:00
JP Simard 30ef86b144 [ControlStatementRule] Fixed a few false positives 2015-05-28 14:49:25 -07:00
JP Simard 26075a2d4f Trailing newline & file length violations are now displayed in Xcode: fixes #43 2015-05-28 12:11:13 -07:00
Andrea Mazzini 2a635c0882 Merge conflict 2015-05-26 23:10:45 +02:00
Andrea Mazzini 8a6c5e7f5d Remove unused examples 2015-05-26 22:58:45 +02:00
Andrea Mazzini 86f5f85458 Split regex for specific keywords. 2015-05-26 22:54:11 +02:00
Andrea Mazzini 383bd3de43 Add ControlStatementRule 2015-05-26 22:04:19 +02:00
Nikolaj Schumacher d8e0047ed2 Add caching of Structure and SyntaxMap.
There is no need to read them individually for every rule.
This cuts execution time by more than 50%.
2015-05-26 17:24:08 +02:00
JP Simard 8c94cc6221 renamed Linter.explainableRules to Linter.ruleExamples 2015-05-25 15:41:27 -07:00
JP Simard 5402b8214e more minor changes to rules command 2015-05-25 15:37:38 -07:00
JP Simard a68a886d3f minor tweaks 2015-05-25 15:23:21 -07:00
Chris Eidhof e7a4e9f651 Rename examples from correct/failure to non-triggering and triggering 2015-05-25 14:46:14 -07:00
Chris Eidhof 3a763db4e8 Forgot file 2015-05-25 14:46:14 -07:00
Chris Eidhof d1f5e6033c More simplification 2015-05-25 14:46:14 -07:00
Chris Eidhof d84348d2d7 Remove unnecessary self 2015-05-25 14:46:14 -07:00
Chris Eidhof 7200bf1d2f Rename command, clean up files 2015-05-25 14:46:14 -07:00
Chris Eidhof 31e4a3ec50 Moved nesting rule into example 2015-05-25 14:46:14 -07:00
Chris Eidhof 20fd31672a List of all the rules 2015-05-25 14:46:13 -07:00
Chris Eidhof 89ea957b05 Changed RuleExample to be a struct 2015-05-25 14:46:13 -07:00
Chris Eidhof 1456f067c0 Only show examples when it makes sense 2015-05-25 14:46:00 -07:00
Chris Eidhof ee5555f8a6 Whitespace rule examples 2015-05-25 14:45:28 -07:00
Chris Eidhof 7cdcc24f70 Added the TodoRule 2015-05-25 14:45:28 -07:00
Chris Eidhof 5d4fdc4a84 Explain command showing the rules 2015-05-25 14:45:28 -07:00
Chris Eidhof ee4aadbcf9 Move examples into the code 2015-05-25 14:45:28 -07:00
Patrick A Wallace 7e61ce5df6 Removed reference to self to fit with Github code style. 2015-05-23 19:04:23 +01:00
Patrick A Wallace 723adf2bd0 Changed to return an error status code if serious violations found, for Xcode compatibility. 2015-05-23 00:15:27 +01:00
JP Simard e2df0546d3 Split Rule into Rule and ParameterizedRule protocols (fixes #21) 2015-05-20 18:27:16 +02:00
JP Simard fc625656ae [ASTRule] Made several rules conform to ASTRule 2015-05-19 15:36:07 +02:00
Aaron Daub aac1a3282f When calling .validateFile make sure to call it on an instance of Rule 2015-05-19 07:53:32 +02:00
Aaron Daub 15a100153d Have the Rule protocol define its members as non-static so that we can pass around instances of Rule 2015-05-19 07:44:11 +02:00
JP Simard 43032d86c2 Only report the highest severity violation for function and type body rules 2015-05-18 06:47:12 +02:00
JP Simard 79ad26ece0 shorter lines 2015-05-18 06:29:32 +02:00
JP Simard 1bbeb35473 moved all style violation calls to Linter 2015-05-18 06:24:56 +02:00
JP Simard 1678bd00cf NestingRule 2015-05-18 06:17:05 +02:00
JP Simard 8753bece31 VariableNameRule 2015-05-18 06:06:49 +02:00
JP Simard 4f4afbef32 TypeNameRule 2015-05-18 06:03:03 +02:00