Commit Graph

32 Commits

Author SHA1 Message Date
Aaron McTavish cb53af5cd6 Fix bool negation false positive for force_unwrap
Resolves #918 `force_unwrapping: false positive when using ! as boolean
operator`.
2017-01-24 07:35:13 +00:00
JP Simard 7522635ad8 update SwiftLintFramework/Rules to follow Swift 3 API Design Guidelines 2017-01-09 19:37:53 -08:00
JP Simard 9e7cdc3282 update SwiftLintFramework/Protocols to follow Swift 3 API Design Guidelines 2017-01-09 19:19:25 -08:00
JP Simard a291bb594a update SwiftLintFramework/Extensions to follow Swift 3 API Design Guidelines 2017-01-09 17:53:07 -08:00
Marcelo Fabri 50535e7e5c Refactor regex functions to accept options
Fixes #1127
2017-01-06 21:04:15 -02:00
Marcelo Fabri 3f6ca7611a Fix violations 2016-12-19 20:08:17 -02: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 13b0cfe623 Fixing inconsistencies 2016-12-08 18:29:57 -02:00
JP Simard 19fad01b29 make all enum members lowercase to comply with Swift 3 API Guidelines 2016-12-01 22:16:21 -08:00
Norio Nomura 84ca11b6aa Merge commit 'b22d1a93c93537acde79a2496031012489fe270d' into swift3.0
* commit 'b22d1a93c93537acde79a2496031012489fe270d':
  Updating CHANGELOG entry
  Updates existing code to respect TrailingCommaRule
  Add configuration to enforce/forbid trailing comma
  Fixing rebase
  Addded TrailingCommaRule
2016-11-30 19:38:31 +09:00
Marcelo Fabri d8fd865491 Updates existing code to respect TrailingCommaRule 2016-11-25 23:52:07 -02: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 ec3f9d0c94 Fix line_length style violations, unused warnings 2016-10-13 22:40:45 +09:00
Norio Nomura 6c0bf50ab3 Fix ForceUnwrappingRule did not recognize force unwraps in return statements using subscript 2016-10-13 00:27:58 +09:00
Norio Nomura 8ccfb89040 Add false negative example from #813 2016-10-13 00:19:37 +09:00
Norio Nomura 8bf15f1dba Migrate to Swift 3.0 2016-10-09 01:09:50 +09:00
dbeard b30a63bde3 Fix force unwrap false positive. Fixes #721 2016-07-12 10:30:43 -07:00
Norio Nomura f62fe10372 Rewrite ForceUnwrappingRule
Add capture previous of "!" for:
- checking whether SyntaxKinds is comment, string, keyword or type identifier
- checking whether character is ")"
- checking whether SyntaxKinds is identifier or not
- SwiftDeclarationKind is one of some "Var*" and declaration containing "="

Add capture next of "!" for:
- checking SyntaxKinds is identifier

By applying this, the duration of linting Carthage 0.14 increase from 300ms to 380ms.
2016-02-21 22:35:56 +09:00
Norio Nomura f80373f43d Add failing false positive examples to ForceUnwrappingRule's description
#546, #547
2016-02-21 22:35:56 +09:00
Norio Nomura 669fbf09d0 Refine ForceUnwrappingRule
Fix #535
The duration of `ForceUnwrappingRule` on linting Carthage 0.14 is reduced from 1415ms to 339ms by Instruments.
2016-02-14 23:07:18 +09:00
Norio Nomura 0b1d54246a Add examples to nonTriggeringExamples of ForceUnwrappingRule 2016-02-14 23:00:37 +09:00
Norio Nomura e09418add7 Add failing test from #535 to ForceUnwrappingRule 2016-02-14 23:00:37 +09:00
JP Simard 144495306b rename rule configurations to expand "Config" to "Configuration" 2016-02-12 10:53:36 -08:00
JP Simard 6befe7e5a4 expand many instances of "config" to "configuration" 2016-02-12 10:53:36 -08:00
JP Simard 3f4b993847 rename ConfigProviderRule to ConfigurationProviderRule 2016-02-12 10:53:36 -08:00
Norio Nomura d365b1c55d Add import Foundation 2016-02-01 13:18:26 +09:00
JP Simard 614c27ab1d optimize ForceUnwrappingRule 2016-01-26 10:49:14 -08:00
JP Simard 01832356ce make ForceUnwrappingRule conform to ConfigProviderRule 2016-01-26 10:49:05 -08:00
JP Simard b3c68474f7 fix indentation in ForceUnwrappingRule 2016-01-26 10:48:40 -08:00
Benjamin Otto fccd2796d1 Changed location for force unwrapping rule violation
- Changed the `Location` of the StyleViolation to point to the `!` that actually does the unwrapping
2016-01-26 10:48:40 -08:00
Benjamin Otto 5d02d70c63 Added a force unwrapping rule
The rule will create a warning for all force unwrappings
2016-01-26 10:48:31 -08:00