If SwiftLint is built from this state using the Swift SDK, we'll get a
large self-contained Linux executable that runs without loading SourceKit.
It can do that by disabling any rule that requires SourceKit.
With `SWIFTLINT_DISABLE_SOURCEKIT` set on a normally (dynamically linked)
binary, the behavior is the same. That's different from the previously
reported more serious warnings.
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.
This provides an alternative to getting syntax kinds from SourceKit. The
mappings aren't 100% equivalent, but this should serve as a useful
compatibility layer.
In particular lots of stuff that used to be needed with SourceKit that
we no longer need to keep around.
Identified using Periphery: https://github.com/peripheryapp/periphery
Start with a command that generates a template for a new SwiftSyntax
rule. This tool could remain separate or be merged into the official
binary under a `dev` sub-command at a later point in time.
The current algorithm is like "collect all included files and subtract all excluded files".
Collecting all included and all excluded files relies on the file system. This can become slow
when the patterns used to exclude files resolve to a large number of files.
The new approach only collects all lintable files and checks them against the exclude patterns.
This can be done by in-memory string-regex-match and does therefore not require file system accesses.
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.
* Adds `baseline` and `write_baseline` config file options, so baseline can be used by people who can't pass command line arguments (e.g. plugin users).
* Added PR number
* Fixed change log entry
* Update Source/swiftlint/Helpers/LintOrAnalyzeCommand.swift
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
* updated
---------
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
We can also switch back to an exact SwiftSyntax version now with the
plugins in a separate repository. In fact, using the plugin, no direct
dependency to SwiftSyntax is required whatsoever.