Commit Graph

603 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 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
Marcelo Fabri 740e398f91 release 0.33.0 2019-06-02 09:54: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
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
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
Marcelo Fabri a3aa36757b Add unowned_variable_capture opt-in rule
Fixes #2097
2019-04-30 10:12:20 -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
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 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
Matthew Healy eecf27ede8 [nslocalizedstring_require_bundle] Run make sourcery 2019-03-30 00:10:14 +01:00
Cihat Gündüz 7b94984175 Split new rule up into two separate rules 2019-03-27 10:34:40 +01:00
Cihat Gündüz f379fdef77 Define new rule file_content_order with examples & tests 2019-03-27 10:34:40 +01:00
Dalton Claybrook 87dbf8e3d7 Fix Changelog issue, Sourcery version mismatch, and package.resolved issue 2019-03-24 16:22:19 -04:00
Dalton Claybrook 7c2e4dfd19 Add ReduceIntoRule 2019-03-24 16:22:19 -04:00
Marcelo Fabri 9fc1d571ae Merge pull request #2669 from pixyzehn/fix-link-for-redundant-@objc-attribute
Remove @ mark to fix invalid link in Rules.md
2019-03-13 09:41:20 -07:00
Xaver Lohmüller 57af7f0e30 Add ReduceBooleanRule (#2675)
* [reduce_boolean] Implement rule

* [reduce_boolean] Improve reason text

* [reduce_boolean] Fix new violations

* [reduce_boolean] Add CHANGELOG.md entry

* [reduce_boolean] Shorten rule name

* [reduce_boolean] Use regular map instead of compactMap

* [reduce_boolean] Match only possible syntax kinds
2019-03-10 10:54:14 -07:00
Nagasawa Hiroki 8fa2d0bcfc Remove punctuation from anchor 2019-03-09 17:12:22 +00:00
Matthew Healy a75198f9d0 [nsobject_prefer_isequal] Add autogenerated documentation 2019-03-01 21:15:03 +01:00
Matthew Healy 057c72c2a6 [nsobject_prefer_isequal] Run make sourcery 2019-03-01 21:15:03 +01:00
Marcelo Fabri 26c0048cf4 release 0.31.0 2019-02-28 15:01:30 -08:00
Paul Taykalo 1b0ac66334 Update reduce to reduce:into for a bit faster running (#2657) 2019-02-22 09:29:39 -08:00
Marcelo Fabri bf9758679b Support commands using “/* .. */“ 2019-02-09 01:48:36 -08:00
Marcelo Fabri 735c432eaf Skip whitespace only rule identifiers 2019-02-09 01:36:03 -08:00
Marcelo Fabri 19505dbcad Fix excessive superfluous_disable_command violations
Fixes #2623
2019-02-09 01:36:03 -08:00
Ben Staveley-Taylor e29d38cde2 Incorporate review comments
- Rename from Deinit_Required to Required_Deinit
- Adopt ASTRule protocol
2019-02-03 15:02:19 +00:00
Ben Staveley-Taylor bff405d34e Add deinit_required rule
Classes are required to have a deinit method.

This is a style to help debugging memory issues, when it is common to want to set a breakpoint at the point of deallocation. Most classes don't have a deinit, so the developer ends up having to quit, add a deinit and rebuild to proceed. If all classes have a deinit, debugging is much smoother.

Ref: https://github.com/realm/SwiftLint/issues/2620
2019-02-02 14:52:48 +00:00
JP Simard 2638827965 Add SwiftVersion.five and automatically detect it (#2602)
Add `SwiftVersion.five` and automatically detect it when computing `SwiftVersion.current`.
2019-01-27 20:26:30 -08:00
Marcelo Fabri 757b5fb94d Add weak_computed_property rule
Fixes #2596
2019-01-26 02:11:35 -08:00
Marcelo Fabri 6fadf80eae Add deployment_target rule
Fixes #2589
2019-01-24 21:42:11 -08:00
Marcelo Fabri b2d428a4e2 release 0.30.1 2019-01-23 11:08:50 -08:00
Marcelo Fabri ea4e13b9a8 Add nslocalizedstring_key opt-in rule 2019-01-22 23:54:04 -08:00
Marcelo Fabri d40fc8e452 release 0.30.0 2019-01-17 23:28:28 -08:00
Marcelo Fabri 26e531f771 Rename rule to UnusedSetterValueRule 2019-01-17 20:37:31 -08:00
Marcelo Fabri 105f8a8710 Add unused_setter_argument rule 2019-01-17 18:51:47 -08:00
Samuel Susla 90232d542e Add DuplicateImportsRule (#2004) 2019-01-17 15:42:29 -08:00
JP Simard 0328f83db1 release 0.29.4 2019-01-16 14:29:24 -08:00
Marcelo Fabri f8e42d81e0 Add strong_iboutlet opt-in rule
Fixes #2433
2019-01-13 20:53:12 -08:00
Kim de Vos b5c5701e90 Warn when disabling non existing rules (#2504)
* Added violations when trying to disable non valid rule

* Added violations when trying to disable non valid rule

* Add changelog enty for 'superfluous_disable_command' improvement

* Uses all rule identifiers when running nonValidSuperfluousCommandViolations

* Address feedback from jpsim

* Uses all rule identifiers when running nonValidSuperfluousCommandViolations

* Address more feedback from jpsim

* Added customRuleIdentifiers when verifying undefinedSuperfluousCommandViolations

* Catch all invalid disable commands in a region

Not just the first one.

* Rename test
2019-01-13 15:10:44 -08:00
JP Simard 0e01e07326 #2441 - Fix inaccessible custom rules in nested configurations (#2556)
* #2441 - Pass custom rules identifiers to the enableRules function to consider custom rules of a parent of a nested configuration

* #2441 - Add custom rules merge

* #2441 - Fix line length violation

* #2441 - Add nested configutaion mocks with custom rules

* #2441 - Add nested configurations tests for custom rules

* #2441 - Disable function body length check

* #2441 - Update changelog

* Move changelog to appropriate position

* Split up and refactor Configuration.init to avoid being too long

* Add tests to LinuxMain.swift

* Remove redundant protocol conformances

Hashable implies Equatable

* Fix typo in changelog entry and add another fixed issue URL
2019-01-13 15:07:27 -08:00
JP Simard bd0f78a501 release 0.29.3 2019-01-07 16:30:54 -08:00
Marcelo Fabri d863fc9fb7 Add unused_control_flow_label rule
Fixes #2227
2019-01-05 18:59:32 -08:00
Marcelo Fabri c17e269cee Add last_where opt-in rule 2018-12-25 01:34:42 -08:00