Commit Graph

2324 Commits

Author SHA1 Message Date
Cihat Gündüz 85a6a77791 [number_separator] Allow year integer literals to be written without separator 2019-02-14 21:19:15 +01:00
Cihat Gündüz efee4ed582 [number_separator] Add false positives to default non-triggering examples 2019-02-14 21:19:15 +01:00
Cihat Gündüz 74d40f2845 [unused_closure_parameter] Check if self is a keyword to prevent potential issues
This was suggested by @[marcelofabri](/marcelofabri) here:
https://github.com/realm/SwiftLint/pull/2639#discussion_r256048671
2019-02-14 18:49:13 +01:00
Cihat Gündüz fe146a3e40 [unused_closure_parameter] Make an exception for the self keyword and handle like identifier
Rationale: This makes the usage of the Delegated pattern usable without violating this rule.
See here for more details: https://github.com/dreymonde/Delegated
2019-02-14 18:49:13 +01:00
Cihat Gündüz 315f3a30a4 [unused_closure_parameter] Add false positive to non-triggering examples 2019-02-14 18:49:13 +01:00
Marcelo Fabri 0bc7d41958 Merge pull request #2641 from realm/cg-explicit_type_interface-fix
Fixes false positives on `explicit_type_interface` with type reference assignments
2019-02-14 09:18:55 -08:00
Almaz Ibragimov ee21684e93 Fixed where keyword detection method and CHANGELOG 2019-02-14 04:47:24 +03:00
Almaz Ibragimov 72a18e4aec Fix false positives on no_grouping_extension rule when using where clause 2019-02-14 03:05:46 +03:00
Cihat Gündüz 70f686591d [explicit_type_interface] Simplified type assignment regex 2019-02-12 18:50:24 +01:00
Cihat Gündüz 04ce4f8c49 [explicit_type_interface] Make sure type reference assignments are detected with allow_redundancy 2019-02-12 14:44:26 +01: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
Marcelo Fabri d20f9f8337 Merge pull request #2626 from realm/mf-not-configured-rule
Warn if a configured rule is not enabled
2019-02-09 01:35:01 -08:00
Marcelo Fabri 34616f7fd0 Minor changes to LetVarWhitespaceRule.swift 2019-02-03 15:01:35 -08:00
Marcelo Fabri 82440d361d Merge pull request #2629 from Igor-Palaguta/let_var_whitespace-With-Warning
Let var whitespace with warning
2019-02-03 14:53:31 -08:00
Marcelo Fabri 7ecfce34c7 Warn if a configured rule is not enabled.
Fixes #1350
2019-02-03 14:43:00 -08:00
Marcelo Fabri cc1418502d Merge pull request #2622 from Igor-Palaguta/TriggerBooleanNimbleOperators
Trigger boolean nimble operators
2019-02-03 14:39:59 -08:00
Igor Palaguta 279f52c6ff Add #error 2019-02-04 00:35:26 +02:00
Ben Staveley-Taylor 56f9aca477 Change rule kind from Style to Lint 2019-02-03 20:39:07 +00:00
Igor Palaguta 7078a5057b ignore warning directives 2019-02-03 20:22:45 +02:00
Ben Staveley-Taylor b8b83d025b Code formatting tidy-up 2019-02-03 15:15:53 +00: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
Igor Palaguta 3043c081d3 fix line length warning 2019-02-01 01:58:44 +02:00
Igor Palaguta c616f1e846 fix variable name 2019-02-01 01:52:34 +02:00
Igor Palaguta 939468e1fe trigget beTrue and beFalse 2019-02-01 01:51:33 +02:00
Maru d8a91501a6 Remove unmeaning comment in colon rule (#2610) 2019-01-29 08:30:09 -08:00
JP Simard 7b447ab5b1 Fix lower_acl_than_parent when linting with Swift 5 (#2609) 2019-01-28 12:49:23 -08:00
JP Simard e5396af9e6 Fix lint issues from #2593 2019-01-28 10:53:01 -08:00
dirtydanee 6493c6f8b5 Make redundant_objc_attribute rule autocorrectable. (#2593)
* Moved the violation point from the variables offset to the `@objc` attribute startIndex. I think it kinda makes sense, since the violations warns against the redundant attribute, there is nothing to fix on the variable itself.
* Searching for ranges of violations initially, and converting later only to `StyleViolation`-s
* Making the rule conforming to `CorrectableRule`. Kinda straightforward, the only extra is that I am counting the attribute's trailing whitespace and newline characters and removing with the attribute. I am doing so since I would like to keep the format of the code.
2019-01-28 10:16:11 -08:00
Marcelo Fabri e4ba455cf0 Merge pull request #2599 from realm/mf-migrate-correctable-rules
Migrate CorrectableRules to use new protocols
2019-01-27 21:42:07 -08:00
JP Simard 9cec649ab6 Add tests that fail with Swift 5 (#2604)
These are tests that pass with Swift 4.2.x but fail with Swift 5.0
from Xcode 10.2 beta 1.
2019-01-27 20:54:03 -08: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
JP Simard 18ad2473d0 Remove unnecessary backticks (#2601)
These were once required but now that we only support Swift 4.2 or later, they're unnecessary.
2019-01-27 20:19:49 -08:00
JP Simard f08c3e4239 Use firstIndex(where:) instead of index(where:) (#2600)
to silence a Swift 5 warning. This is compatible with Swift 4.2.
2019-01-27 20:19:16 -08:00
Marcelo Fabri b3c399b025 Migrate EmptyParametersRule 2019-01-27 19:05:31 -08:00
Marcelo Fabri c1002d7fc6 Migrate EmptyEnumArgumentsRule 2019-01-27 19:02:57 -08:00
Marcelo Fabri 225780ad32 Migrate CommaRule 2019-01-27 19:00:53 -08:00
Marcelo Fabri dbe920da69 Migrate EmptyParenthesesWithTrailingClosureRule 2019-01-27 18:59:38 -08:00
Marcelo Fabri 19df08ff93 Convert ClosingBraceRule 2019-01-27 18:57:25 -08:00
Marcelo Fabri 03632b24f1 Migrate TrailingSemicolonRule 2019-01-27 18:53:05 -08:00
Marcelo Fabri 6642180212 Migrate RedundantOptionalInitializationRule 2019-01-27 18:50:29 -08:00
Marcelo Fabri 08570c1dd1 Migrate RedundantVoidReturnRule 2019-01-27 18:48:33 -08:00
Marcelo Fabri 708f763215 Migrate RedundantTypeAnnotationRule 2019-01-27 18:46:55 -08:00
Marcelo Fabri b0a6ec22e0 Migrate RedundantNilCoalescingRule 2019-01-27 18:45:55 -08:00
Marcelo Fabri b49ecf7b9a Migrate JoinedDefaultParameterRule 2019-01-27 18:43:45 -08:00
Marcelo Fabri d9df6976d5 Migrate ExplicitInitRule 2019-01-27 18:42:34 -08:00
Marcelo Fabri d52eb0c64b Migrate ImplicitReturnRule 2019-01-27 18:40:56 -08:00
Marcelo Fabri 7c5c742d36 Migrate ProtocolPropertyAccessorsOrderRule 2019-01-27 18:39:08 -08:00