Commit Graph

934 Commits

Author SHA1 Message Date
JP Simard 1864d77f37
Fix testDetectSwiftVersion() test when running with Swift 5.6 2022-01-30 13:35:13 -05:00
JP Simard 31872aaa3f
Re-add 'weak_delegate' rule as opt-in
After feedback from users: https://github.com/realm/SwiftLint/pull/3809#issuecomment-1018859093
2022-01-21 16:57:13 -05:00
JP Simard 341ec2a907
Remove 'weak_delegate' rule (#3809)
This was very prone to false positives and not worth keeping.

The identifier will stick around for a release to ease the migration.
2022-01-21 17:56:59 +00:00
Sergei aff3536bb8
Fix the regex for expiring-todos. (#3803)
- Make "middle part" `.*` not so greedy with `?`.
- Use `(?!` negative look-ahead to improve matching.
- Added corresponding unit tests.

Co-authored-by: Sergei Shirokov <sshirokov@malwarebytes.com>
2022-01-21 17:42:17 +00:00
Andrés Cecilia Luque af59581b66
Fix specifying the cachePath from command line (#3797) 2022-01-21 08:01:48 -08:00
Danny Mösch 050473a0e1
Add optional prefer_self_in_static_references rule (#3732) 2021-11-29 18:42:53 +00:00
JP Simard 5a98458d94
Add more Swift versions to testDetectSwiftVersion() 2021-11-01 11:39:34 -04:00
Marcelo Fabri 4052c43f16 Make rule more generic and rename it 2021-09-29 10:28:39 -07:00
Marcelo Fabri cfa3dff7fe Fix unrelated test 2021-09-29 10:28:39 -07:00
Marcelo Fabri 2674d367f9 Fix violation 2021-09-29 10:28:39 -07:00
Marcelo Fabri 68bfc13941 Add add_target_in_variable_declaration_closure rule 2021-09-29 10:28:39 -07:00
Ben Fox 00799cc782
Fixes MissingDocRuleConfiguration (#3713)
* add configuration for missing_docs

* fix MissingDocsRuleConfiguration

* add to changelog

* fix up Config default values and update tests

* use XCTAssertTrue and XCTAssertFalse

* fix line length violation

* finish up unit tests

* rever Package.resolved
2021-09-13 15:23:55 -04:00
JP Simard 888619912f
Run CI with Xcode 12.5.1 & Swift 5.4 (#3710)
And require Swift 5.4 or Xcode 12.5 or later to build SwiftLint.
2021-09-10 08:32:02 -07:00
JP Simard 986d98c475
Fix tests on Swift 5.5 / Xcode 13 (#3709) 2021-09-09 21:11:22 +00:00
Ben Fox 1f44d56357
add configuration for missing_docs (#3701)
* `excludes_extensions` defaults to `true` to skip reporting violations
  for extensions with missing documentation comments.
* `excludes_inherited_types` defaults to `true` to skip reporting
  violations for inherited declarations, like subclass overrides.
2021-09-01 21:42:47 +00:00
Kane Cheshire 4a293632c2 Named rule correctly for Sourcery to work properly 2021-08-24 00:19:35 -07:00
Marcelo Fabri 50b6992852 Fix issues with explicit_type_interface on Swift 5.4
Fixes #3615
2021-08-16 02:23:28 -07:00
Marcelo Fabri 9939c536d5
Add anonymous_argument_in_multiline_closure opt-in rule (#3659)
* Add anonymous_argument_in_multiline_closure opt-in rule

* Restrict match to the closure

* Fixes
2021-06-17 17:03:19 -07:00
Steven Grosmark 300bf77967
Improve `file_length` warnings when excluding comments (#3654)
* Improve `file_length` warnings when excluding comments

* Update changelog

* Update Source/SwiftLintFramework/Rules/Metrics/FileLengthRule.swift

Co-authored-by: Yegor Chsherbatykh <ego1309@yandex.ru>

Co-authored-by: Steven Grosmark <steven.grosmark@ww.com>
Co-authored-by: Yegor Chsherbatykh <ego1309@yandex.ru>
2021-06-17 11:11:17 -07:00
Kane Cheshire 91b125b001 Ran sourcery + tidied up 2021-05-24 12:05:29 -07:00
Kane Cheshire d7aeea39d9 Adding examples/tests 2021-05-24 12:05:29 -07:00
Kane Cheshire 538764278b Adding new DisallowNoneCase rule 2021-05-24 12:05:29 -07:00
raduciobanu002 07c8e52fc8
"Colon Spacing" rule name update (#3583)
* * Changed rule name from "Colon" to "Colon Spacing"
* Updated tests

* Update CHANGELOG.md

Co-authored-by: Seth Friedman <sethfri@gmail.com>
2021-05-20 23:46:54 -04:00
Steven 625cd180ae
Fix `type_contents_order` initializer detection (#3622) 2021-05-10 09:56:21 -04:00
Marcelo Fabri a10158c475
Add duplicated_key_in_dictionary_literal rule (#3613) 2021-04-28 17:25:08 -07:00
JP Simard 058869f446
Require Swift 5.3 or higher to build (#3553)
* Require Swift 5.3 or higher to build

* Remove Swift Version Support tables from readmes

These weren't exactly accurate because SwiftLint should still work with
older Swift versions long after we update the minimum version of Swift
needed to _build_ the tool. So I doubt this table was very helpful to
anyone.
2021-03-04 18:07:04 +00:00
JP Simard e47fb60c7a
Regenerate Sourcery output 2021-03-03 15:41:50 -05:00
László Kustra 87d4accb39
Add "Capture non-constant variable" rule 2021-03-02 16:11:33 -05:00
Otavio Cordeiro 24122e1325
Rename Rule to BalancedXCTestLifecycleRule 2021-03-01 01:29:16 +01:00
Otavio Cordeiro bd4dcd5b23
Add required_xctest_tearddown opt-in rule 2021-02-28 23:48:05 +01:00
JP Simard fed8644e01
Remove duplicate disable commands 2021-02-26 12:09:40 -05:00
JP Simard 3e04acd97d
Revert "Revert "Fix issue that prevented the inclusion of a configuration file from a parent folder (#3491)""
This reverts commit b66f7c7992.
2021-02-26 11:44:10 -05:00
JP Simard 9182eda98c
Disable file & type body length rules in ConfigurationTests 2021-02-26 10:37:47 -05:00
JP Simard 5b1d737683
Merge pull request #3538 from realm/feature/fix-custom-rules-merging
Multiple fixes for custom rules
2021-02-25 16:14:50 -05:00
JP Simard b66f7c7992
Revert "Fix issue that prevented the inclusion of a configuration file from a parent folder (#3491)"
This reverts commit 2f6fd1e95f.
2021-02-25 14:49:10 -05:00
Frederick Pietschmann 0dfb04b25a Add 2 new tests for custom rules when in only_rules mode 2021-02-25 19:22:57 +01:00
Frederick Pietschmann 520d224719 Revert "Revert "Merge pull request #3473 from realm/feature/3472-fix-custom-rules-merging" (#3503)"
This reverts commit 6a38b15657.
2021-02-25 19:22:57 +01:00
Frederick Pietschmann 2f6fd1e95f
Fix issue that prevented the inclusion of a configuration file from a parent folder (#3491)
* Add (currently failing) test for #3485

* [#3485] Add missing rootDir adjustment for included / excluded paths

* Add changelog entry

* Adjust tests for relative included / excluded paths
2021-02-23 18:19:19 -05:00
JP Simard 402e76b33d
Add a few more possible upcoming versions to testDetectSwiftVersion
To give us more lead time before we need to update this again.
2021-02-23 16:27:27 -05:00
JP Simard eca9ea4bb8
Adding Legacy ObjC Type Rule #2758 (#3531) 2021-02-23 12:08:01 -08:00
Otavio Cordeiro 46777539ad
Add opt-in rule private_passthrough_subject (#3504) 2021-02-08 10:43:27 -08:00
DwayneCoussement f66c51b9f2
Update tests to support Swift 5.3.3 (#3509) 2021-02-02 07:18:31 -08:00
Otavio Cordeiro 59eb887cfa
Add opt-in rule discouraged_assert (#3506)
Co-authored-by: Keith Smiley <keithbsmiley@gmail.com>
2021-01-29 09:30:57 -08:00
JP Simard 6a38b15657
Revert "Merge pull request #3473 from realm/feature/3472-fix-custom-rules-merging" (#3503)
This reverts commit 537e53f6b3, reversing
changes made to ba49f7d309.
2021-01-22 10:31:05 -08:00
Frederick Pietschmann 22d25da7fc Add newline at end of yml test file 2021-01-15 00:14:50 +01:00
Frederick Pietschmann 2d17045b11 [#3477] Fix bug that prevented the reconfiguration of a custom rule in a child config 2021-01-14 23:35:21 +01:00
Frederick Pietschmann 5bffc77af6 Fix custom_rules merging when a configuration is based on only_rules 2021-01-14 23:35:21 +01:00
Frederick Pietschmann 0a0e3f50eb Add 5.3.2 to testDetectSwiftVersion() 2020-12-20 15:56:14 +01:00
JP Simard ab6aeed5b1
Replace non_private_xctest_member with test_case_accessibility (#3464)
in `.swiftlint.yml`.
2020-12-11 09:05:02 -08:00
JP Simard f8bc10aaaa
Merge pull request #3460 from realm/dont-log-a-warning-if-no-configuration-files-were-explicitly-specified
Don't log a warning if no configuration files were explicitly specified
2020-12-11 10:02:41 -05:00