Commit Graph

584 Commits

Author SHA1 Message Date
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
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
Ornithologist Coder 96c434e21a Adds xct_specific_matcher opt-in rule 2018-12-24 01:01:11 -08:00
JP Simard a21a8b3344 release 0.29.2 2018-12-23 20:32:25 -08:00
Kim de Vos d62e187b5c Add Legacy Hashing rule (#2496) 2018-12-05 15:43:39 -08:00
JP Simard 0e862ca9c4 Enable vertical whitespace rules in SwiftLint
and fix violations
2018-12-02 14:01:23 -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
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 9d47c3471c Vertical whitespace between cases (#2292) 2018-11-28 08:34:10 -08:00
dirtydanee c4e2a38643 Add "Redundant @objc Attribute" Rule (#2270) 2018-11-27 16:50:53 -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
JP Simard b64ead1a3c release 0.28.2 2018-11-27 10:55:50 -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
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
JP Simard 4955c173a0 release 0.28.1 2018-11-18 15:41:26 -08:00