Commit Graph

26 Commits

Author SHA1 Message Date
Danny Mösch e64e82d80d Get rid of periods finishing rule descriptions 2023-01-10 22:29:13 +01:00
JP Simard 4bd7da32ea
Reduce visibility of rules to be `internal` (#4533)
There's no reason to expose these publicly and this will make it nicer
to move to a new module outside of the core SwiftLint functionality.
2022-11-09 11:01:26 -05:00
JP Simard 1ee5154687
Update SwiftSyntax to `fa7ff05` (#4455)
There's a new SwiftParserDiagnostics module and the rewriter visit
function signatures changed.
2022-10-23 11:56:22 -04:00
Danny Mösch 0fbd03cf2b
Require visitors to exist (#4383) 2022-10-16 18:40:12 +02:00
Danny Mösch f8e5339c69
Introduce `ReasonedRuleViolation` type to associate a reason with a violation position (#4379) 2022-10-16 12:53:38 +02:00
Danny Mösch bd8c9e5bcb
Provide syntax visitor base class allowing for convenient skipping of declaration nodes (#4310) 2022-10-15 19:03:49 +02:00
JP Simard 9aaeff67d0
Add `SyntaxProtocol.isContainedIn(regions:locationConverter:)` helper (#4356) 2022-10-12 19:50:32 +00:00
JP Simard 0282bf1923
Remove optionality in getting syntax tree and source location converter (#4353)
Parsing does not throw errors.
See https://github.com/apple/swift-syntax/pull/912.
2022-10-12 12:50:17 -04:00
JP Simard 2388e49190
Use SwiftSyntax's new SwiftParser (#4216) 2022-10-01 15:05:36 -04:00
JP Simard 837f46479f
Rewrite `toggle_bool` with SwiftSyntax (#4190) 2022-09-08 05:27:44 +00:00
Danny Mösch 449190d324
Verify examples in rules by default and enforce explicit exclusion (#4065)
A rule must conform to ManuallyTestedExamplesRule to skip generation of a test for its examples.
2022-08-09 22:32:09 +02:00
Marcelo Fabri db2721f78e
Require Swift 5.0 in runtime (#3886)
* Require Swift 5.0 in runtime

* Fix violation

* Enable legacy_rule by default

* Update changelog

* Fix changelog after rebase

* More cleanup
2022-03-11 14:01:27 -08:00
Danny Mösch 050473a0e1
Add optional prefer_self_in_static_references rule (#3732) 2021-11-29 18:42:53 +00:00
Marcelo Fabri 551cf2da3c Fix false positive in `toggle_bool` rule 2020-11-08 04:57:59 -08:00
Paul Taykalo 693ee2cae9
Add Isnot Empty extension in the Swift Framework (#3387) 2020-11-07 18:42:55 -05:00
Zev Eisenberg fcf848608e
Add Inline test failure messages (#3040)
* Add Example wrapper in order to display test failures inline when running in Xcode.
* Stop using Swift 5.1-only features so we can compile on Xcode 10.2.
* Wrap strings in Example.
* Add Changelog entry.
* Wrap all examples in Example struct.
* Better and more complete capturing of line numbers.
* Fix broken test.
* Better test traceability.
* Address or disable linting warnings.
* Add documentation comments.
* Disable linter for a few cases.
* Limit mutability and add copy-and-mutate utility functions.
* Limit scope of mutability.
2020-02-02 10:35:37 +02:00
JP Simard 40ade98710
Update SourceKitten to 0.28.0 (#3011) 2020-01-03 16:47:18 -08:00
Max Härtwig 44b04f377d Allow SubstitutionCorrectableRule to return nil instead of a correction to indicate that a suitable correction couldn't be found for a specific case (#2958) 2020-01-02 23:15:40 -08:00
Paul Taykalo ac40778cb3 Use SwiftLintFile wrapper over the File 2019-11-07 15:19:17 +02:00
Max Härtwig 1a5aa05c34 Add missing Foundation import 2019-10-07 09:42:19 +02:00
Max Härtwig b9368cbca6 Fix reference to 2019-10-07 09:27:31 +02:00
Max Härtwig a157957df4 Make `toggle_bool` rule substitution correctable 2019-10-07 01:16:15 +02:00
Timofey Solonin 9a216e96a0 #2471 - Fix false positive toggle_bool (#2479)
* #2471 - Fix false positive toggle_bool by using negative lookbehind on dot and word character

* #2471 - Update changelog
2018-11-24 11:18:27 -08:00
Dalton Claybrook 0c20003179 Improve description strings for Toggle Bool rule 2018-08-30 17:10:58 -04:00
Dalton Claybrook 585b9ab950 Fix incorrect triggering markers 2018-08-30 15:55:52 -04:00
Dalton Claybrook 4ea785c993 Add ToggleBoolRule 2018-08-30 10:22:21 -04:00