Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite ForceUnwrappingRule #552

Merged
merged 6 commits into from Mar 10, 2016
Merged

Rewrite ForceUnwrappingRule #552

merged 6 commits into from Mar 10, 2016

Conversation

norio-nomura
Copy link
Collaborator

Fix #546, #547

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.

@norio-nomura
Copy link
Collaborator Author

This PR depends on #542

That returns array of tupple containing "key.kind" and "byteRange" from Structure that containing the byte offset.
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.
@norio-nomura norio-nomura force-pushed the nn-rewrite-force-unwrapping-rule branch from bde39b5 to f62fe10 Compare February 21, 2016 13:36
@norio-nomura
Copy link
Collaborator Author

Rebased

@norio-nomura
Copy link
Collaborator Author

Test failed on SPM.
It seems SPM ignores dependency's version specification. https://travis-ci.org/realm/SwiftLint/jobs/110756338#L280-L281

Cloning https://github.com/jpsim/SourceKitten.git
Using version 0.11.0-test of package SourceKitten

@norio-nomura
Copy link
Collaborator Author

swift-DEVELOPMENT-SNAPSHOT-2016-02-25-a has come without merging apple/swift-package-manager#140 that fix pre-release suffix tag matching bug.
So, I removed tag 0.11.0-test from SourceKitten, restart the job https://travis-ci.org/realm/SwiftLint/jobs/110759979 and test passed.
Sorry for inconvenience. 🙇

@jpsim
Copy link
Collaborator

jpsim commented Mar 10, 2016

Thanks @norio-nomura! This looks good to me.

jpsim added a commit that referenced this pull request Mar 10, 2016
@jpsim jpsim merged commit 0979aa3 into master Mar 10, 2016
@jpsim jpsim deleted the nn-rewrite-force-unwrapping-rule branch March 10, 2016 03:53
@norio-nomura
Copy link
Collaborator Author

Thanks for review and merging! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants