Commit Graph

2426 Commits

Author SHA1 Message Date
JP Simard ffd0804746 release 0.33.1 2019-07-08 08:54:53 -07:00
JP Simard 3a0c2b0c05 Migrate LinterCache to use Codable models (#2799)
* Migrate LinterCache to use Codable models

improving performance and type safety

* Fix Linux

* Avoid creating a Decoder if it won't be used

For example if the file doesn't exist or can't be read.

* Use corelibs plist coder if available

It's available in the Swift 5.1 branch: https://github.com/apple/swift-corelibs-foundation/pull/1849

* Remove unused error case
2019-07-07 00:35:10 -07:00
Colton Schlosser 18e90be780 Split cache into one file per configuration (#2796)
* Split cache into one file per configuration

* Only write cache files with changes

* Avoid converting from Data -> String -> Data when saving cache files

* Move empty check to for where

* Split cache changelog entry

* Reword changelog entry to better reflect impact
2019-07-06 11:50:20 -07:00
Marcelo Fabri 94c6009fc4 Fix false positive in function_default_parameter_at_end
Fixes #2788
2019-07-04 22:25:52 -07:00
Marcelo Fabri 0652b323f5 Use new source.request.compiler_version request 2019-07-04 10:59:43 -07:00
Marcelo Fabri 596bf8dbc8 Detect parameter attribute in vertical_parameter_alignment
Fixes #2792
2019-07-04 10:42:11 -07:00
JP Simard 7f4b736ea3 Synthesize Equatable implementations where possible (#2790) 2019-07-01 17:22:18 -04:00
Marcelo Fabri 740e398f91 release 0.33.0 2019-06-02 09:54:05 -07:00
Marcelo Fabri 0ee12bd096 Catch != 0 in legacy_multiple rule (#2778) 2019-06-02 09:52:05 -07:00
Marcelo Fabri 6be5bf74c3 Add legacy_multiple opt-in rule (#2771)
Fixes #2612.
2019-06-01 22:49:23 -07:00
Marcelo Fabri 90cb1349c0 Add duplicate_enum_cases rule (#2777)
Fixes #2676
2019-06-01 20:32:55 -07:00
Marcelo Fabri 862913f0c0 Don't trigger no_fallthrough_only if next case is @unknown (#2770)
* Don't trigger no_fallthrough_only if next case is @unknown

Fixes #2696
2019-05-25 21:53:23 -07:00
JP Simard a55178e681 Use isDisjoint(with:) instead of intersection().isEmpty 2019-05-20 10:19:37 -07:00
Dalton Claybrook a371419ce4 Fix issue where force-unwrapping self does not trigger a violation of the force_unwrapping rule (#2764)
* Fix issue where force-unwrapping self does not trigger a rule violation

* Update changelog
2019-05-20 10:17:32 -07:00
JP Simard c216ccc1e5 Remove WeakComputedProperyRule (#2761)
* Remove WeakComputedProperyRule

Addresses https://github.com/realm/SwiftLint/issues/2712

* fixup! Remove WeakComputedProperyRule
2019-05-16 02:19:01 -07:00
Cihat Gündüz d01ed712f9 Merge pull request #2754 from samrayner/samrayner/file-types-order-extensions
#2749 Fix file_types_order in extension-only files
2019-05-14 12:44:04 +02:00
Sam Rayner 7b82250995 #2749 Fix file_types_order in extension-only files
Prevents extensions being flagged as in the wrong order when a file only contains extensions and nothing else (enums, classes, structs). In this case it's not intuitive that the longest extension be considered the "main" one so the file can be considered as having no "main" type.
2019-05-13 13:59:16 +01:00
Kevin Randrup d7439410e9 Introduce " - " delimiter to allow rules to be commented (#2721)
* Introduce " - " delimiter to allow rules to be commented
Ex. swiftlint:disable:next force_try - Explanation here

* Fix changelog formatting
2019-05-12 21:40:12 -07:00
Alvar Hansen af72c06be4 Skip module import if cursor info is missing module info (#2746) 2019-05-06 08:57:01 -07:00
Marcelo Fabri a3aa36757b Add unowned_variable_capture opt-in rule
Fixes #2097
2019-04-30 10:12:20 -07:00
Frederick Pietschmann 3b9917f89d Add nested type handling specification to file_name rule (#2718)
* Add nestedTypeSeparator to FileNameConfiguration

* Add tests for nested_type_separator configurability of file_name rule

* Add changelog entry

* Fix changelog position after rebase
2019-04-30 08:12:43 -07:00
Javier Soto 49c288eb3f Fixed typo in nslocalizedstring_require_bundle rule description 2019-04-29 17:06:28 -07:00
Marcelo Fabri d14d79d2c4 Don’t trigger redundant_void_return when using subscripts 2019-04-29 09:47:00 -07:00
JP Simard 6534946fe3 release 0.32.0 2019-04-28 21:30:19 -07:00
Marcelo Fabri 3a36212b94 Swift 5 support (#2720)
* Update project to compile with Xcode 10.2

* Fix explicit_acl with Swift 5

* Update macOS VM image

* Fix ConfigurationTests on Swift 5

* Update Podspec

* Workaround SR-10486 to fix validation tests

* Fix testDetectSwiftVersion on Swift 5

* Update specs repo when validating CocoaPods spec

* Fix redundant_set_access_control tests

* Manually update Package.resolved

* Use .upToNextMinor

* [Azure Pipelines] Add `sw_vers`

* Relax expecting conditions for crashing output in `testSimulateHomebrewTest()`

Because TSAN makes `swiflint` to produce additional output on crashing.

* Add CHANGELOG entry

* Ignore extensions in explicit ACL rules

* Work around SR-10486 for Sourcery
2019-04-28 21:10:06 -07:00
Dalton Claybrook d0ce8b6ac8 Fix false positive in UnusedCaptureListRule (#2726) 2019-04-23 11:51:44 -07:00
JP Simard 230bedcd05 Bump ReduceIntoRule's minimum Swift version to Swift 4 2019-04-19 17:38:04 -04:00
Marcelo Fabri ad2733391a Merge pull request #2666 from daltonclaybrook/dc-reduce-into-rule
Add reduce_into opt-in rule
2019-04-15 14:52:04 -07:00
Dalton Claybrook 59990129f9 PR feedback updates 2019-04-15 07:34:57 -04:00
Dalton Claybrook 665920aa0b Fix line length violation + updated changelog 2019-04-14 18:55:43 -04:00
Dalton Claybrook 41c8da2769 Cleanup 2019-04-14 18:46:34 -04:00
Dalton Claybrook 0a0a60b9da Rule is now passing tests 2019-04-14 18:34:47 -04:00
Dalton Claybrook d8f671c315 WIP - create unused capture list rule 2019-04-13 23:12:25 -04:00
Frederick Pietschmann 43e18458de Update file headers for new sourcery version 2019-04-12 17:13:27 +02:00
Frederick Pietschmann 81abf9f3f2 Let "disable all" command override "superfluous_disable_command" rule 2019-04-12 16:27:43 +02:00
Marcelo Fabri bc8f9d69a0 Merge pull request #2710 from realm/marcelo/acl-swift-5
Fix false positives on `explicit_acl` and `explicit_top_level_acl`
2019-04-09 11:32:17 -07:00
Marcelo Fabri 537dec1d37 Fix false positives on explicit_acl and explicit_top_level_acl
Fixes #2705
2019-04-09 10:59:46 -07:00
Marcelo Fabri 51d47d492c contains_over_first_not_nil rule now also checks for firstIndex(where:)
Fixes #2678
2019-04-09 10:53:42 -07:00
Keith Smiley dd39c438e1 Return false for isFile for empty strings
As of Swift 5, corelibs-foundation crashes if you pass an empty string
to `fileExists` https://github.com/apple/swift-corelibs-foundation/blob/cae5eaca63cd57f64a93b4d5de87a4ffc04466d5/Foundation/FileManager.swift#L2033
2019-04-02 18:15:40 -07:00
Marcelo Fabri 1d7b37be1d Merge pull request #2701 from r-plus/bugfix-2700
fix: false positive on sorted_first_last with firstIndex(of:), firstIndex(where:), lastIndex(of:) and lastIndex(where:) method
2019-04-02 09:54:01 -07:00
Dalton Claybrook 696cdf801c Add triggering examples with parentheses to the number separator rule tests 2019-04-02 09:02:49 -04:00
r-plus 72dc428b2f Add some non-triggering examples to SortedFirstLastRule 2019-04-02 10:40:43 +09:00
r-plus c7a1cc1d54 fix: false positive on sorted_first_last with firstIndex(of:) and lastIndex(of:) method
Fixes #2700
2019-04-01 15:03:46 +09:00
Matthew Healy f54e7406d9 [nslocalizedstring_require_bundle] Implement NSLocalizedStringRequireBundleRule 2019-03-30 00:17:43 +01:00
Matthew Healy eecf27ede8 [nslocalizedstring_require_bundle] Run make sourcery 2019-03-30 00:10:14 +01:00
Matthew Healy 74b51c5d38 [nslocalizedstring_require_bundle] Add NSLocalizedStringRequireBundleRule description 2019-03-30 00:10:14 +01:00
Dalton Claybrook ce2d1c973b Update variable name to be more specific which negates the need for a comment 2019-03-27 07:51:39 -04:00
Dalton Claybrook a5d4fb1c14 Add comment explaining the fix 2019-03-27 07:51:39 -04:00
Dalton Claybrook 10711bb92b Fix issue where using parentheses around a number could result in a false-positive on number_separator 2019-03-27 07:51:39 -04:00
Cihat Gündüz dc22d93c30 Merge pull request #2296 from Dschee/file-content-order
File Types Order & Type Contents Order
2019-03-27 12:32:37 +01:00