Commit Graph

2205 Commits

Author SHA1 Message Date
Ornithologist Coder 8e4e68fe13 Removes tests SwiftLint already takes care of 2018-12-24 01:01:11 -08:00
Ornithologist Coder 3c30d6f519 Renames variables 2018-12-24 01:01:11 -08:00
Ornithologist Coder 22a21c8fe1 Renames variable 2018-12-24 01:01:11 -08:00
Ornithologist Coder 4b391d188d Moves validation to guard statement 2018-12-24 01:01:11 -08:00
Ornithologist Coder e497f63fe0 Adds additional tests for the reasons 2018-12-24 01:01:11 -08:00
Ornithologist Coder 6d60d03fca Moves tests to its own file 2018-12-24 01:01:11 -08:00
Ornithologist Coder 8bf9e7fb29 Adds additional examples 2018-12-24 01:01:11 -08:00
Ornithologist Coder ba31336cb3 Uses AST instead of regular expressions 2018-12-24 01:01:11 -08:00
Ornithologist Coder a9a2927814 Simplifies the regular expressions
but... removes the validation when the call has a message.
2018-12-24 01:01:11 -08:00
Ornithologist Coder b760ef2362 Adds more examples 2018-12-24 01:01:11 -08:00
Ornithologist Coder 74bb9150fd Improves regular expressions 2018-12-24 01:01:11 -08:00
Ornithologist Coder 96c434e21a Adds xct_specific_matcher opt-in rule 2018-12-24 01:01:11 -08:00
Marcelo Fabri 4fa417e06f Add configuration to discouraged_object_literal
Fixes #2439
2018-12-23 23:00:08 -08:00
JP Simard a21a8b3344 release 0.29.2 2018-12-23 20:32:25 -08:00
Timofey Solonin 735567dcb4 Make modifier_order rule autocorrectable (#2521)
* #2353 - Move violating modifiers search to a private function

* #2353 - Add offset and length to the ModifierDescription

* #2353 - Make modifier_oder rule correctable

* #2353 - Add modifier_oder rule correction tests

* #2353 - Upadte the changelog

* #2353 - Add missing Foundation import

* #2353 - Fix linux tests

* Small edits to ModifierOrderRule and changelog entry
2018-12-23 19:53:38 -08:00
JP Simard e6ff3521c8 Run analyze on CI with --strict (#2524)
and whitelist two intentional violations
2018-12-23 18:22:41 -08:00
JP Simard ce8ea70492 Stringify swiftlint_version (#2523)
to treat any specified value that doesn't match the version string
to fail the lint.
2018-12-23 16:29:42 -08:00
Maksym Grebenets 46aed849d6 Support glob patterns without the star (#2508)
Enables use of '[abc]', '?' and '[a-z]' glob syntax without the need to use '*' in the pattern.
2018-12-23 16:02:42 -08:00
Kim de Vos 5da6028054 Convert rule examples to multiline string literals (#2506) 2018-12-23 15:11:03 -08:00
JP Simard 2d0d56985f Clean up CryptoSwift references (#2522)
* Clean up CryptoSwift references

* Add a changelog entry

* Remove unused import
2018-12-20 10:59:49 -08:00
Kim de Vos 3f081b2a70 Allow private objc classes in private_unit_test (#2505) 2018-12-06 09:15:22 -08:00
Kim de Vos d62e187b5c Add Legacy Hashing rule (#2496) 2018-12-05 15:43:39 -08:00
dirtydanee 58a54db21b Fix non accessible declarations under @objcMembers (#2501)
* Fix non accessible declarations under @objcMembers

* Refactor to avoid false optionality

* fixup changelog
2018-12-04 22:47:07 -08:00
Niil Öhlin cdbf50e753 Improve performance for unused_import and unused_private_declaration 2018-12-02 21:48:40 -08:00
JP Simard 0e862ca9c4 Enable vertical whitespace rules in SwiftLint
and fix violations
2018-12-02 14:01:23 -08:00
JP Simard 7afd7ccaf8 Rename cleanedKeysDict() to removingViolationMarkers() 2018-12-02 13:52:41 -08:00
Cihat Gündüz 89c88517e1 Vertical whitespace opening & closing braces (#2291)
* Add VerticalWhitespaceOpening/ClosingBraces rules with description

* Implement validate, correct & add rules to lists

* Fix minor issues & update docs

* Fix copy & paste issue

* Improve autocorrection + Cleanup triggering examples

* Update changelog with new rule entries

* Add more validation examples

* [CHANGELOG.md] Mark new rules as opt-in

* Point to exact location of violation + update tests

* Make rules severity configurable

* Fix issues after rebasing

* Fix issue with CHANGELOG.md

* Add more violating examples, improve pattern to catch more cases

* Move changelog entries to new version

* Fix issues after rebase

* Move Changelog entry to current master

* Fix failing tests

* Fixes after refactoring

* Fix changelog entry position

* Make range unicode-safe (as suggested by @jpsim)

* Share duplicate Dictionary extension code
2018-12-02 13:41:50 -08:00
JP Simard c3d23ea771 release 0.29.1 2018-11-29 14:28:21 -08:00
Kim de Vos bf97e08fa7 Exit immediately when linting with a version other than swift_version if defined (#2491) 2018-11-29 12:40:29 -08:00
JP Simard a855ac27b0 Fix false positives and invalid corrections with unused import rule (#2492)
* Fix wrong correction when removing testable imports with UnusedImportRule

* Fix false positive with UnusedImportRule when importing Foundation when there are attributes in that file requiring Foundation.

* Update rules documentation

* Add changelog entries
2018-11-29 10:55:26 -08:00
Timofey Solonin efa68177b2 #2435 - Make modifier_order rule rely on an explicit set of rules (#2458)
* #2435 - Adjust modifier_order rule to require explicit modifier order specified to conclude a violation

* #2435 - Move modifier order rule examples to a separate file

* #2435 - Add modifier interference tests

* #2435 - Fix whitespaces

* Minor edits

* Add changelog entry
2018-11-28 15:10:49 -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
JP Simard 8fc75e393b release 0.29.0 2018-11-27 13:31:15 -08:00
JP Simard a944808c8b Default column to 1 in XcodeReporter output (#2488) 2018-11-27 13:00:01 -08:00
Dani Vela b58c4e35bb Add markdown reporter (#2486) 2018-11-27 12:31:12 -08:00
JP Simard b64ead1a3c release 0.28.2 2018-11-27 10:55:50 -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
JP Simard d1109da326 Parallelize iterating over subpaths (#2475)
This has a very small performance improvement on multi-core machines
2018-11-21 22:38:05 -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
JP Simard db2fbad7fd Use CommonCrypto if available to compute MD5 hash (#2474)
It's significantly faster than CryptoSwift: 3% vs 19% of cached lint time for Lyft's iOS codebase.

### Before (CryptoSwift)

![CryptoSwift](https://user-images.githubusercontent.com/474794/48873531-3f2a7780-eda3-11e8-9cd9-c0ef796b061b.png)

### After (CommonCrypto)

![CommonCrypto](https://user-images.githubusercontent.com/474794/48873539-481b4900-eda3-11e8-8605-4fd009da3eb1.png)
2018-11-21 16:19:10 -08:00
Marcelo Fabri fb9d8df8a3 Add back MARK 2018-11-20 10:32:20 -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