Commit Graph

1615 Commits

Author SHA1 Message Date
JP Simard 50f16d6907
Fixup 2018-11-28 10:40:04 -08:00
JP Simard d1df7af294
Deserialize syntax tree using byte tree 2018-11-28 10:39:44 -08:00
JP Simard 02113220d1
Migrate FallthroughRule to SwiftSyntax [skip ci] 2018-11-28 10:39:15 -08:00
Cihat Gündüz cf034c9dfb Multiline Brackets (#2302)
* Add new multiline_literal_brackets rule with examples

* Implement rule

* Add changelog entry

* Fix CHANGELOG and rule name

* Fix tests + Update stuff after rebasing

* Add more examples & fix whitespace issue

* Address feedback from @ornithocoder

* Add multiline rules for arguments and parameters

* Fix false positives in rule multiline_parameters_brackets

* Fix false positive for trailing closures in multiline_arguments_brackets

* Add nested examples to rule multiline_arguments_brackets

* Fix more false positives in multiline_arguments_brackets rule

* Use guard where appropriate instead of if

* Update generated artifacts after rebase

* Add CHANGELOG entry for all three new rules

* Move changelog entries to new version

* Fix changelog entries position

* Move new rules to correct subfolder

* Update Rules.md file contents

* Fixup changelog

* Refactor rules
2018-11-28 10:30:36 -08:00
Cihat Gündüz 38b0114951 Fix false positives on explicit_type_interface rule (#2426) 2018-11-28 09:08:03 -08:00
Cihat Gündüz 9d47c3471c Vertical whitespace between cases (#2292) 2018-11-28 08:34:10 -08:00
Marcelo Fabri 85b61e7fcc Fix false positive in nimble_operator rule
Fixes #2489
2018-11-27 21:08:28 -08:00
dirtydanee c4e2a38643 Add "Redundant @objc Attribute" Rule (#2270) 2018-11-27 16:50:53 -08:00
JP Simard 60afab8085
Style nits 2018-11-27 15:27:52 -08:00
Cihat Gündüz 7ac9efab0e Fix false positive on file_name rule with specific patterns (#2418)
* Add false positive failing test to file_name rule

* Fix false positive in file_name rule

* Add changelog entry

* Use correct name in changelog
2018-11-27 10:50:25 -08:00
Dominic Freeston e962440815 Fix false positives for `explicit_init` when passing init as closure in multiline call (#2478)
* Ignore calls with `(` before .init

* Update rules documentation

* Update CHANGELOG.md

* Change multi-line string to single-line with explicit newlines
2018-11-26 17:44:11 -08:00
Timofey Solonin 9a216e96a0 #2471 - Fix false positive toggle_bool (#2479)
* #2471 - Fix false positive toggle_bool by using negative lookbehind on dot and word character

* #2471 - Update changelog
2018-11-24 11:18:27 -08:00
Norio Nomura ea171fbbf2
Add `SWIFTLINT_DISABLE_SOURCEKIT` environment variable (#2473)
This can be used for avoid "Test::Unit::AssertionFailedError" error in `libxpc.dylib` on calling `sourcekitd_send_request_sync` in sandbox environment.
2018-11-21 17:03:42 -08:00
Marcelo Fabri cf0c7b7b21 Use default Equatable and Hashable implementations 2018-11-19 09:51:12 -08:00
JP Simard 5901d3075f
Require Swift 4.2 (#2466)
This bumps the minimum version required to build SwiftLint to 4.2. The primary motivating factor to drop support for Swift 4.0-4.1.x is that SwiftLint now uses CryptoSwift, which requires 4.2.

* Add changelog entry

* Remove --allow-warnings flag from CocoaPods commands

* Update CryptoSwift to 0.13.0

* Migrate to Swift 4.2

* Remove CircleCI tests for Swift < 4.2

* Update English and Chinese README

Korean README doesn't yet have a version table like this.

* Update gems

* Add changelog entry for fixed compiler warnings

* Update CocoaPods to 1.6.0.beta.2

To work around https://github.com/CocoaPods/CocoaPods/issues/7708
2018-11-18 17:32:25 -08:00
JP Simard 09cb3bae2d
Remove unused Foundation import (#2463) 2018-11-13 22:28:28 -08:00
Marcelo Fabri 83a2ca4be7
Merge pull request #2419 from yhkaplan/random
New Rule - Legacy Random
2018-10-13 22:58:50 -07:00
Joshua Kaplan 44b57ded29 Offset already proven to be not nil 2018-10-14 13:28:29 +09:00
Joshua Kaplan 1adb275050 Set is more efficient 2018-10-14 13:27:45 +09:00
Joshua Kaplan d40cfc0c90 Refactor rule to be AST rule 2018-10-06 16:03:37 +09:00
Joshua Kaplan 8b12806e9e Correct rule kind from 'lint' to 'idiomatic' 2018-10-06 12:04:28 +09:00
Joshua Kaplan 6eda1396d8 Rename random rule to legacy random rule 2018-10-06 12:02:21 +09:00
Marcelo Fabri 2c59827850
Merge pull request #2407 from marcelofabri/enable-static-operator
Enable static_operator opt-in rule in SwiftLint
2018-10-02 14:40:18 -07:00
Timofey Solonin e9d2552888 #2423 - Fix EmptyCountRule for binary, octal and hexadecimal integer literals 2018-10-02 19:47:52 +03:00
Timofey Solonin 22be71e677 #2422 - Replace ruleDescription change with a StyleViolation reason field in CompilerProtocolInitRule 2018-10-01 18:28:52 +03:00
Timofey Solonin 5bf50c8920 #2422 - Specify which compiler protocol initialization rule was violated 2018-10-01 12:32:43 +03:00
Joshua Kaplan 3d6030dfc0 Change rule implementation to use regex 2018-09-30 14:54:20 +09:00
yhkaplan 9acf8ba9a0 Delete unneeded todo 2018-09-27 23:55:59 +09:00
yhkaplan 1cedd0ccc6 Add Foundation import explicitly to get build working on Linux 2018-09-27 23:55:07 +09:00
Joshua Kaplan 71b6def313 Add random rule 2018-09-27 00:21:36 +09:00
Marcelo Fabri 1f121b1ef7 Enable static_operator opt-in rule in SwiftLint 2018-09-16 20:33:28 -07:00
Marcelo Fabri bf85625ed8
Merge pull request #2396 from marcelofabri/static_operator
Add static_operator opt-in rule
2018-09-14 10:44:28 -07:00
Marcelo Fabri b92b236a5e Add static_operator opt-in rule
Fixes #2395
2018-09-11 09:34:10 -07:00
Marcelo Fabri dfb447490e Enable collection_alignment on SwiftLint 2018-09-11 09:31:54 -07:00
Dalton Claybrook b20424426c Add updates based on PR feedback 2018-09-10 23:45:56 -04:00
Dalton Claybrook 9f74749473 Add shared non-triggering examples to the tests 2018-09-10 23:45:56 -04:00
Dalton Claybrook 74f7c1481d Update collection alignment rule name 2018-09-10 23:45:56 -04:00
Dalton Claybrook dfa92dc07d Add bridge to NSString to fix linux issue 2018-09-10 23:45:56 -04:00
Dalton Claybrook 81746c6507 Make collection alignment rule opt-in 2018-09-10 23:45:56 -04:00
Dalton Claybrook 4e27bf9f87 Collection alignment rule is no longer an automatic testable 2018-09-10 23:45:56 -04:00
Dalton Claybrook a71bb4dd48 Add more triggering and non-triggering examples 2018-09-10 23:45:56 -04:00
Dalton Claybrook 0597df5b8c Add support for colon alignment 2018-09-10 23:45:56 -04:00
Dalton Claybrook 31995f916f Clean up collection alignment rule to mimic other alignment rules 2018-09-10 23:45:56 -04:00
Dalton Claybrook d8a043f84b Create CollectionAlignmentConfiguration 2018-09-10 23:45:56 -04:00
Dalton Claybrook 45b0881f1d Add Collection Alignment rule and implement basic left-alignment case 2018-09-10 23:45:56 -04:00
Marcelo Fabri c9f315a798
Merge pull request #2372 from marcelofabri/identical_operands
Add identical_operands opt-in rule
2018-09-09 20:47:49 -07:00
JP Simard 53d8a3aba9
Add UnusedPrivateDeclarationRule (#2385)
* Add UnusedPrivateDeclarationRule

* Temporarily disable UnusedPrivateDeclarationRule tests on Xcode 10

So we can merge UnusedPrivateDeclarationRule without having to wait
for CircleCI to update its Xcode 10 version.
2018-09-05 21:59:45 -07:00
JP Simard 8d734366fb
Remove unused private declarations (#2386) 2018-09-03 16:45:02 -07:00
Marcelo Fabri fad73d36f4 Use File.syntaxMap instead of making a request (#2384) 2018-09-03 10:39:11 -07:00
JP Simard e460c5ef9c
Add Unused Import analyzer rule (#2381) 2018-09-02 14:45:02 -07:00