Commit Graph

98 Commits

Author SHA1 Message Date
JP Simard c699d3d2fa Disable/re-enable rules from within source code comments. Fixes #4. 2015-08-29 17:09:28 -07:00
JP Simard 26627fa1b2 [TypeNameRule][VariableNameRule] allow private names to start with an underscore 2015-08-28 14:22:32 -07:00
JP Simard 9a65c5bdb8 extra space 2015-08-28 13:17:16 -07:00
JP Simard 57a8abb514 update for Xcode 7 Beta 6 2015-08-27 14:21:17 -07:00
JP Simard 19cc87a404 Configure SwiftLint via a YAML file. Fixes #1 and #3. 2015-08-27 14:21:17 -07:00
JP Simard 29536759d1 update for Xcode 7 Beta 6 2015-08-27 14:20:51 -07:00
JP Simard e95625ee79 update for swift 2 2015-08-27 14:20:51 -07:00
JP Simard 4c91500e7b Release 0.1.2 2015-08-24 13:19:25 -07:00
Keith Smiley 3f9786a22d Lint parentheses around switch statements 2015-08-24 11:24:51 -07:00
JP Simard e7b7bf349a fix style violation (failing test) 2015-08-23 22:17:02 -07:00
JP Simard 9e417aeab9 Merge pull request #91 from keith/ks-test-only-active-rule
Only validate examples produce their own violations
2015-08-23 22:13:27 -07:00
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
Keith Smiley fdd814c64f Only validate examples produce their own violations
When adding new general rules, examples from other rules could violate
your new rule. Since we're already testing rules practically through the
integration tests we should only validate that examples produce the
expected violation types.
2015-08-11 15:37:09 -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 edcfe8575d Merge remote-tracking branch 'upstream/master' into rule/operator-whitespace 2015-06-17 01:26:40 +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 35ca4dc4b4 [CLI] fixed violations 2015-06-11 21:10:59 -07:00
JP Simard 0f28deeac6 [CLI] Support linting from standard input 2015-06-11 21:03:40 -07: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
Lars Lockefeer 9c143a85da Made lint: private 2015-05-29 14:01:44 +02:00
Lars Lockefeer bbd13d6679 Simplified filesToLintAtPath:, moved it inside struct 2015-05-29 14:01:01 +02:00
Lars Lockefeer 6c4dec8038 Resolved linting issues in LintCommand.swift 2015-05-29 07:55:59 +02:00
Lars Lockefeer 4d6e21d5a4 Merge remote-tracking branch 'upstream/master'
Conflicts:
	Source/swiftlint/LintCommand.swift
2015-05-29 07:54:41 +02:00
Lars Lockefeer baa5a30e97 Use absolutePathRepresentation: from SourceKittenFramework rather than stringByAppendingPathComponent 2015-05-29 07:37:35 +02:00
Lars Lockefeer 21516ce3ac Fixed typing errors / syntax issues 2015-05-29 07:31:18 +02:00
JP Simard 704e6009b1 [IntegrationTests] Added testSwiftLintLints(). Yo dawg. 2015-05-28 17:37:12 -07:00
JP Simard f8ea553a0e [Tests] Split LinterTests into 3 files 2015-05-28 16:49:30 -07:00
JP Simard 88c6e777f4 [Location] NSString.lineAndCharacterForByteOffset(_:) now works. Fixes #62. 2015-05-28 16:19:19 -07:00
JP Simard 7890e1c3be removed TODOs from LinterTests (created GH issues) 2015-05-28 15:15:51 -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
Lars Lockefeer c005a94998 Added a command line option to specify a path to lint
Usage example: `swiftlint lint --path
Source/swiftlint/LintCommand.swift`
2015-05-27 23:07:40 +02:00
Andrea Mazzini 2a635c0882 Merge conflict 2015-05-26 23:10:45 +02:00
Andrea Mazzini 989685723d Enable commentDoesntViolate 2015-05-26 23:03:50 +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