* Add `RegexConfiguration.ExecutionMode`
To help migrate custom rules to SwiftSyntax. Not wired up yet, just the
configuration parsing and defaults. Will wire it up in the next PR.
The diff looks big, but it's 500+ lines of tests, with ~45 lines of
actually new code.
* Docs
* Address PR feedback
- Add `default` case to ExecutionMode enum instead of using optional
- Change configuration key from `mode` to `execution_mode` for consistency
- Move default execution mode logic to runtime instead of configuration time
- Refactor test functions to use throws instead of do-catch
The protocol will be used to tag rules that may or may not require
SourceKit depending on its configuration. I only expect this to be used
for custom rules as utility to help transition to a fully SwiftSyntax
based approach.
Ideally, SwiftLintCore would some day only contain components
that are needed to define rules. Consequently, it would be the
only bundle required to import for (external) rule development.
The MIT license doesn't require that all files be prepended with this
licensing or copyright information. Realm confirmed that they're ok with this
change. This will enable some companies to contribute to SwiftLint and the
date & authorship information will remain accessible via git source control.
This has never worked for two reasons:
1. We've used dictionaries to represent cache descriptions, which
don't guarantee stable ordering of keys across invocations.
This is true both on Darwin and Linux, but in practice ordering
varies significantly more on Linux.
2. Storing a `TimeInterval` value in a `[String: Any]` dictionary
and retrieving it again will not be dynamically castable to
`Double` or `TimeInterval` but will be castable to `Int`.