Commit Graph

2752 Commits

Author SHA1 Message Date
Otavio Cordeiro 3fbc482a2e Add MARKs
to trigger a new build.
2021-02-28 23:48:06 +01:00
Otavio Cordeiro cdd877c289 Add examples for static setUp and tearDown 2021-02-28 23:48:06 +01:00
Otavio Cordeiro bd4dcd5b23 Add required_xctest_tearddown opt-in rule 2021-02-28 23:48:05 +01: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 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 721b077608 Add SWIFTLINT_LOG_MODULE_USAGE environment variable for UnusedImportRule
That's because it can currently be difficult to know why a module is
referenced in a file.

To use, run SwiftLint with the environment variable set to the module
whose references you want to log to `stderr`:

    SWIFTLINT_LOG_MODULE_USAGE=MyModule swiftlint analyze ...
2021-02-25 14:53:07 -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 235f598ac7 Fix custom rules bug when using 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
JP Simard 8326624491 Make discarded_notification_center_observer opt-in (#3537)
It's very common for this rule to produce false positives, and there's
no easy way to address them.

See these issues:
  * https://github.com/realm/SwiftLint/issues/1398
  * https://github.com/realm/SwiftLint/issues/3498
2021-02-25 09:06:00 -08:00
Artem Garmash 4266ea9d60 Add Bool violation reporting in redundant_type_annotation (#3438)
* Add Bool violation detection

* Update Changelog

* Fix issues found by the rule
2021-02-24 14:29:08 -08:00
Bradley Walters 5eb00b79cc Update CodeClimateReporter to produce relative paths (#3499)
GitLab and the CodeClimate spec both expect these paths to be relative.

https://docs.gitlab.com/ee/user/project/merge_requests/code_quality.html#implementing-a-custom-tool
https://github.com/codeclimate/platform/blob/690633cb2a08839a5bfa350ed925ddb6de55bbdc/spec/analyzers/SPEC.md#locations
2021-02-24 14:16:18 -08: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
Thomas Goyne 8f216b8398 Support Swift Playground control comments in the comment spacing rule
Swift Playgrounds use `//:` to mark prose sections and `//:#` for embedded
content like images and localized prose, so those shouldn't violate the
space-after-comment rule.
2021-02-23 17:33:20 -05:00
JP Simard eca9ea4bb8 Adding Legacy ObjC Type Rule #2758 (#3531) 2021-02-23 12:08:01 -08:00
JP Simard cfd67b9534 Make strong-iboutlet rule correctable (#3530)
* Make strong-iboutlet rule correctable

* fixup! Make strong-iboutlet rule correctable

Co-authored-by: Max Haertwig <dev@maxhaertwig.com>
2021-02-23 11:37:23 -08:00
JP Simard 6b51c3ebc5 [UnusedDeclarationRule] Fix false positives with result builders (#3528) 2021-02-23 07:59:37 -08:00
JP Simard 60242fd599 [UnusedDeclarationRule] Allow configuration related USRs to skip (#3525)
For example you might have custom source tooling that does something
with types conforming to a procotol even if that type is never
explicitly referenced by other code.
2021-02-17 12:25:23 -08:00
Otavio Cordeiro 46777539ad Add opt-in rule private_passthrough_subject (#3504) 2021-02-08 10:43:27 -08:00
Otavio Cordeiro 7ea9b733ff Allow multi-line parameters rule to always break lines (#3494) 2021-02-02 13:27:29 -08:00
JP Simard bbf1ad4a18 [ExplicitSelfRule] Fix violation location and misplaced corrections (#3507) 2021-01-29 10:59:28 -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 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 56e4f175ac Fix if statement formatting 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 256288ab88 Separate custom rules merging & filtering to avoid misleading warnings 2021-01-14 23:35:21 +01:00
Yurii Kotov 6dba929b4f Fix typos in configuration options for file_name rule 2020-12-16 19:56:50 +02:00
JP Simard d53fc2664d release 0.42.0 2020-12-14 15:26:56 -05:00
JP Simard ebca5238a7 Fix false positives on unused_declaration for outlets with accessors 2020-12-11 10:07:22 -05: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
JP Simard 01b1001a81 fixup! Don't log a warning if no configuration files were explicitly specified 2020-12-11 10:02:16 -05:00
JP Simard cb3eed544c Add FileGraphInitializationResult to make error handling more explicit 2020-12-11 09:27:51 -05:00
JP Simard 12cea6b9c7 fixup! Don't log a warning if no configuration files were explicitly specified 2020-12-10 09:39:49 -05:00
JP Simard ab700a3262 Re-add warning message if the config file was implicit and misconfigured
Thanks fredpi!
2020-12-10 09:37:09 -05:00
JP Simard d75b9c45df Remove unused error case 2020-12-09 17:18:21 -05:00
JP Simard 35d75809c9 Fix typo 2020-12-09 17:16:50 -05:00
JP Simard 2b50902d1a Revert most changes, just don't log a warning 2020-12-09 17:14:04 -05:00
JP Simard d010569f1d Extract out error string generation 2020-12-09 16:26:10 -05:00
Keith Smiley 800030ad11 Remove NonPrivateXCTestMembersRule (#3459)
* Remove NonPrivateXCTestMembersRule

I accidentally implemented this rule twice. So TestCaseAccessibilityRule
did the same thing but with a bit more behavior. This change deletes
NonPrivateXCTestMembersRule but also ports over the autocorrection from
it to TestCaseAccessibilityRule.
2020-12-09 13:16:40 -08:00
JP Simard 82e5870a16 Don't log a warning if no configuration files were explicitly specified
And none was found at the default location of `.swiftlint.yml`.
2020-12-09 16:16:04 -05:00
Keith Smiley 22ee449971 Fix @IBInspectable unused declarations with get/set (#3458) 2020-12-07 11:07:16 -08:00
richard.turton 103cf7504a Fixed whitespace violations 2020-12-04 17:01:47 +00:00
richard.turton 62298de662 Add exception for UIApplicationDelegateAdaptor 2020-12-04 16:45:51 +00:00
Keith Smiley 03f13e5bb7 Remove @IBOutlet and @IBInspectable from UnusedDeclarationRule (#3432)
The original implementation wasn't tested so it regressed.

https://github.com/realm/SwiftLint/pull/3184
2020-12-03 11:00:53 -08:00
JP Simard f0f0086aca Merge pull request #3443 from realm/remove-info.plist-files
Remove Info.plist files
2020-11-23 10:47:36 -05:00
Frederick Pietschmann 495d742f65 Fix issues originating from new set semantics 2020-11-21 00:05:42 +01:00
Frederick Pietschmann 4c5a3f0577 Add remote, parent & child configuration features 2020-11-20 23:08:37 +01:00
JP Simard e143a18e5c Remove Info.plist files
These are no longer needed now that we removed the Xcode project.
2020-11-20 15:01:09 -05:00
Dalton Claybrook ba5e6d2e1c Fix false positives in inclusive_language rule (#3439)
* Add support for allowed terms in inclusive language rule

* Update changelog

* Move changelog entry to Enhancements section

Co-authored-by: JP Simard <jp@jpsim.com>
2020-11-20 14:12:24 -05:00