Commit Graph

77 Commits

Author SHA1 Message Date
Michael Welles c9ff0aa07f Changes from PR feedback. Long comments following code in a line will now trigger, configuration will now fail if invalud value types are set for options 2017-02-06 15:33:44 -05:00
Michael Welles cd843e7fcd Added "ignores_comments" and "ignores_function_declarations" as boolean options to LineLengthRule 2017-01-30 17:51:56 -05:00
JP Simard 29cdc86185 add some convenience members to SourceKit dictionaries 2017-01-22 11:00:57 -08:00
rakaramos 23a0d53424 Merge branch 'master' of github.com:realm/SwiftLint 2017-01-10 10:12:28 -02:00
JP Simard a291bb594a update SwiftLintFramework/Extensions to follow Swift 3 API Design Guidelines 2017-01-09 17:53:07 -08:00
rakaramos 147bfd6d5b Use range parameter if exists 2017-01-09 13:14:21 -02:00
Rafael Machado 14ea8a22d5 Add range to avoid whole file lookup 2017-01-07 16:28:04 -02:00
Marcelo Fabri 50535e7e5c Refactor regex functions to accept options
Fixes #1127
2017-01-06 21:04:15 -02:00
JP Simard da555b8a3b minor spacing fixes 2016-12-30 18:21:11 -08:00
Marcelo Fabri c6ac9b919c Add redundant_void_return rule
Fixes #1066
2016-12-26 01:01:04 -02:00
Marcelo Fabri 608a2725c8 Add class_delegate_protocol rule
Fixes #1039
2016-12-23 02:37:44 -02:00
Marcelo Fabri b18c98084c Fix existing violations 2016-12-22 11:57:06 -02:00
Marcelo Fabri 23a0b03fe8 Fixing violations 2016-12-19 21:20:58 -02:00
Marcelo Fabri 3f6ca7611a Fix violations 2016-12-19 20:08:17 -02:00
JP Simard 8b49cd36b5 Merge pull request #967 from marcelofabri/void-return-rule
Void return rule
2016-12-13 12:04:01 -08:00
JP Simard 3f7c010be8 fix specifying multiple rule identifiers in comment commands 2016-12-13 08:55:05 -08:00
Marcelo Fabri 7af7eb8fbe Handling curried declarations 2016-12-13 11:57:43 -02:00
JP Simard 31814c36c4 set result of two methods to _ to avoid warnings on Linux
also filed https://github.com/apple/swift-corelibs-foundation/pull/740
and https://github.com/apple/swift-corelibs-foundation/pull/741

to fix upstream
2016-12-11 14:04:49 -08:00
JP Simard 0faf567931 use bridge() rather than explict or implicit casts
this is a step in aligning the code to compile on both Darwin and
Linux
2016-12-11 13:47:44 -08:00
Marcelo Fabri 0afe9a8b19 Enabling more rules in SwiftLint itself 2016-12-10 19:12:40 -02:00
Marcelo Fabri 13b0cfe623 Fixing inconsistencies 2016-12-08 18:29:57 -02:00
JP Simard a57526d639 omit 'self.' references when not ambiguous 2016-12-08 01:25:54 -08:00
JP Simard 19fad01b29 make all enum members lowercase to comply with Swift 3 API Guidelines 2016-12-01 22:16:21 -08:00
JP Simard 39e1001629 make lots of Swift 3 related changes
many of which are to help with otherwise very long compile times
2016-12-01 00:34:29 -08:00
Norio Nomura 7c12a63e8f Merge commit '58eb0f69c4055bb2cb89b3df278eca6ce0fb1c34' into swift3.0
* commit '58eb0f69c4055bb2cb89b3df278eca6ce0fb1c34':
  generally clean up usage of swiftlint comment commands
  update README to reflect the ability to specify multiple rules in commands
  add changelog entry
  allow specifying multiple rule identifiers in comment commands

# Conflicts:
#	Source/SwiftLintFramework/Extensions/NSRegularExpression+SwiftLint.swift
#	Source/SwiftLintFramework/Models/Command.swift
#	Source/SwiftLintFramework/Rules/LegacyNSGeometryFunctionsRule.swift
#	Tests/SwiftLintFrameworkTests/ConfigurationTests.swift
#	Tests/SwiftLintFrameworkTests/IntegrationTests.swift
2016-11-30 18:42:40 +09:00
JP Simard e93eee31e7 generally clean up usage of swiftlint comment commands
used within the codebase itself.
2016-11-25 13:10:38 -08:00
JP Simard 639a18181c allow specifying multiple rule identifiers in comment commands 2016-11-25 12:56:48 -08:00
Norio Nomura 40828dff03 Merge branch 'master' into swift3.0
* master: (41 commits)
  Fix formatting in CHANGELOG.md
  release 0.13.0
  Update CHANGELOG.md
  Fix check for trailing whitespace to return early
  Fix checks for some inline comments
  Replace check for comments to use SyntaxKind
  Add configuration for trailing_whitespace to ignore comments
  Unwanted space removed
  - Lint issues fixed
  Updated HTML Reporter
  PR feedback
  Add check on autocorrect for disabled range
  Use `utf8.count` instead of `utf16.count` to byte range
  Re-write `ExplicitInitRule` to `ASTRule`
  added ExplicitInitRule
  Updated CHANGELOG
  HTML Reporter added
  HTML Reporter added
  Adds information about SwiftLint plugin for AppCode into README.md
  added reasons why a new rule should be opt in
  ...

# Conflicts:
#	Source/SwiftLintFramework/Extensions/File+SwiftLint.swift
#	Source/SwiftLintFramework/Extensions/Structure+SwiftLint.swift
#	Source/SwiftLintFramework/Rules/ColonRule.swift
#	Source/SwiftLintFramework/Rules/CommaRule.swift
#	Source/SwiftLintFramework/Rules/LegacyCGGeometryFunctionsRule.swift
#	Source/SwiftLintFramework/Rules/LegacyConstantRule.swift
#	Source/SwiftLintFramework/Rules/LegacyConstructorRule.swift
#	Source/SwiftLintFramework/Rules/LegacyNSGeometryFunctionsRule.swift
#	Source/SwiftLintFramework/Rules/LineLengthRule.swift
#	Source/SwiftLintFramework/Rules/OperatorFunctionWhitespaceRule.swift
#	Source/SwiftLintFramework/Rules/ReturnArrowWhitespaceRule.swift
#	Source/SwiftLintFramework/Rules/RuleConfigurations/StatementPositionConfiguration.swift
#	Source/SwiftLintFramework/Rules/StatementPositionRule.swift
#	Source/SwiftLintFramework/Rules/TrailingWhitespaceRule.swift
#	Tests/SwiftLintFramework/RuleConfigurationTests.swift
2016-11-04 21:40:56 +09:00
Norio Nomura 3ff76e7ce8 Update SourceKitten 2016-11-04 20:24:21 +09:00
Norio Nomura 21e3439bfa Merge pull request #766 from masters3d/no-autocorrect-disabled-rules
Added disable rule test to autocorrect
2016-10-29 14:09:11 +09:00
Norio Nomura 8bf15f1dba Migrate to Swift 3.0 2016-10-09 01:09:50 +09:00
J Cheyo Jimenez 8bed233282 added closure-spacing-rule 2016-09-03 21:10:33 -07:00
J Cheyo Jimenez 48a085cfc1 Added disable rule test to autocorrect 2016-08-30 15:41:17 -07:00
J Cheyo Jimenez 651351e3bd fix for verticalspace regex bug 2016-08-28 21:43:42 -07:00
JP Simard c66c5c8df0 formatting fixes
found running `swiftlint autocorrect --format`
2016-05-29 14:58:28 -07:00
Norio Nomura 3ae3bfef71 Add early returns by checking File.sourcekitdFailed 2016-04-13 18:40:25 +09:00
Norio Nomura d92b2d6037 Use Request.sendMayThrow() in SourceKittenFramework
For gaining advantage of using `sourcekitd_set_notification_handler()`,
we need to vacate main thread to `dispatch_main()`.
2016-04-13 18:40:25 +09:00
Neil Gall 1b4cf0c574 Do not overwrite files whose contents have not changed 2016-03-02 14:23:33 +00:00
Norio Nomura 704e7bde1d Add SyntaxMap.tokensIn(_:)
That returns array of SyntaxTokens intersecting with byte range.
2016-02-19 17:30:54 +09:00
Norio Nomura be8f2ce63d Remove surplus map calls in rangesAndTokensMatching(_:) 2016-02-17 11:11:47 +09:00
JP Simard 1866edae77 adjust access control levels for many APIs in SwiftLintFramework
this is done in an effort to stabilize the API for SwiftLint 1.0.
2016-02-10 17:26:06 -08:00
JP Simard 7d0afb190b rename matchAndTokensPattern to rangesAndTokensMatching
also align regex pattern comments & fix indentation
2016-02-10 15:42:07 -08:00
Norio Nomura 83c008507b Improve performance of ColonRule
The duration of `ColonRule` on linting Carthage 0.13 is reduced from 1673ms to 515ms by Instruments.
2016-02-10 15:16:21 -08:00
Scott Hoyt d17f5b9d92 Modified access level of matchPattern(_, excludingSyntaxKinds:, excludingPattern:) 2016-02-02 17:15:00 -08:00
Scott Hoyt 2a623e926e Eliminated unneeded local variable. 2016-02-02 17:15:00 -08:00
Scott Hoyt ebaa6ec871 Increase performance by early return if matches isEmpty. 2016-02-02 17:15:00 -08:00
Scott Hoyt 0ee04c3fa3 Added exclusion pattern for matching patterns in a file. Added Array and NSRange extensions to support. Used this in OpeningBraceRule. 2016-02-02 17:15:00 -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 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
Scott Hoyt 0a4602b3e6 Refactored matchPattern to expose a method for supplying pre-initialized regex. 2016-01-25 07:26:31 -08:00