SwiftLint icon indicating copy to clipboard operation
SwiftLint copied to clipboard

[WIP] Custom rule AST matching/querying

Open aaroncrespo opened this issue 4 years ago • 1 comments

JP and Keith both expressed some interest so I figured I would submit early as I work to resolve some of the TODO's and FIXME's and get the ball rolling

The goal with this change is to write a rule similar to a regex rule but structured.

We had a time when we wanted to match log(.w, "Could not ...\(logContent)" but not log(.w, scrubbed: "Could not ...\(logContent)".

You can imagine that since anything and any whitespace could occur within the interpolation writing a regex for this is not straight forward.

aaroncrespo avatar Oct 11 '21 20:10 aaroncrespo

1 Warning
:warning: Please include a CHANGELOG entry to credit yourself!
You can find it at CHANGELOG.md.
12 Messages
:book: Linting Aerial with this PR took 0.73s vs 0.73s on master (0% slower)
:book: Linting Alamofire with this PR took 0.97s vs 0.97s on master (0% slower)
:book: Linting Firefox with this PR took 3.51s vs 3.5s on master (0% slower)
:book: Linting Kickstarter with this PR took 5.83s vs 5.81s on master (0% slower)
:book: Linting Moya with this PR took 0.5s vs 0.51s on master (1% faster)
:book: Linting Nimble with this PR took 0.4s vs 0.4s on master (0% slower)
:book: Linting Quick with this PR took 0.18s vs 0.19s on master (5% faster)
:book: Linting Realm with this PR took 2.1s vs 2.09s on master (0% slower)
:book: Linting SourceKitten with this PR took 0.33s vs 0.33s on master (0% slower)
:book: Linting Sourcery with this PR took 1.94s vs 1.95s on master (0% faster)
:book: Linting Swift with this PR took 3.1s vs 3.1s on master (0% slower)
:book: Linting WordPress with this PR took 6.43s vs 6.43s on master (0% slower)

Here's an example of your CHANGELOG entry:

* [WIP] Custom rule AST matching/querying.  
  [aaroncrespo](https://github.com/aaroncrespo)
  [#issue_number](https://github.com/realm/SwiftLint/issues/issue_number)

note: There are two invisible spaces after the entry's text.

Generated by :no_entry_sign: Danger

SwiftLintBot avatar Oct 11 '21 21:10 SwiftLintBot