Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make SwiftLint available as a build tool plugin #4176

Merged
merged 5 commits into from
Oct 5, 2022
Merged

Make SwiftLint available as a build tool plugin #4176

merged 5 commits into from
Oct 5, 2022

Conversation

technocidal
Copy link
Contributor

@technocidal technocidal commented Sep 7, 2022

Motivation

SwiftLint is an important part as a build phase for many projects. Depending on where the project is being build the path where swiftlint is located on a machine can differ. One example is the recent Homebrew path change when Apple introduced Apple Silicon machines. Using SwiftLint as a plugin means that there is no need for an external package manager to install it, less setup during initial project setup and a more portable project overall.

Open Questions

  • Do I need to add additional parameters to the actual swiftlint call?

@SwiftLintBot
Copy link

1 Message
📖 Skipping OSSCheck because SwiftLint hasn't changed compared to 'main'

Generated by 🚫 Danger

@tboogh
Copy link

tboogh commented Sep 9, 2022

Great initiative, a suggestion is that the plugin should look for a configuration file in the project path such as the SwiftGenPlugin does https://github.com/SwiftGen/SwiftGenPlugin/blob/stable/Plugins/SwiftGenPlugin/Plugin.swift

@jpsim
Copy link
Collaborator

jpsim commented Sep 9, 2022

Thanks for the PR! Does the SwiftPM plugin interface allow for any user configuration, like having users specify the path to the config file? If so, supporting that could be nice.

By default, SwiftLint will look at the root of the project for a .swiftlint.yml file and will traverse the directory tree to look for child configurations.

If we add this, there should also be a section in the readme that explains how to configure it for people's projects.

@technocidal
Copy link
Contributor Author

@tboogh @jpsim

Thanks for your feedback!

I'll research the configuration options and will include some version of the configuration file discovery similar to SwiftGen.

Anything in particular I'll need to keep in mind regarding the Readme?

@jpsim
Copy link
Collaborator

jpsim commented Sep 12, 2022

Anything in particular I'll need to keep in mind regarding the Readme?

Basic instructions for how to get it up and running in projects would be helpful. Via Package.swift and Xcode ideally, since I suspect those setup processes to differ a bit.

@technocidal
Copy link
Contributor Author

Great initiative, a suggestion is that the plugin should look for a configuration file in the project path such as the SwiftGenPlugin does https://github.com/SwiftGen/SwiftGenPlugin/blob/stable/Plugins/SwiftGenPlugin/Plugin.swift

@tboogh

There is a small difference between SwiftGen and our implementation. SwiftGen only supports Swift packages while I'd like to support SwiftLint as a Xcode Build Tool Plugin. There are some slight differences in the API.

SwiftLint has it's own child configuration discovery which means that we probably don't need to look for any configuration if we find a .swiftlint.yml at the project root. The API for Xcode plugins only gives you the target which includes a list of files assigned to this target. SwiftLint configuration files are generally not assigned to a target so they don't show up here. Targets are also not required to have their own root directory like Swift packages. That makes a little tricky to figure out where to look for a potential configuration.

@technocidal
Copy link
Contributor Author

Regarding the whole configuration thing: I can't find an obvious way to pass in the path to a configuration file.

This means that we can either add this in this pretty barebones state and explain it really well or wait until the situation improves.

displayName: "SwiftLint",
executable: try context.tool(named: "swiftlint").path,
arguments: [
"--cache-path", "\(context.pluginWorkDirectory)"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this resolve to? Somewhere semi-private where we can write our cache data to without bothering the user? I assume this is necessary for sandboxing reasons and we're not allowed to write to caches directory here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This is a temporary directory inside Derived Data.

From the Swift Package Manager documentation/proposal:

/// The path of a writable directory into which the plugin or the build
/// commands it constructs can write anything it wants. This could include
/// any generated source files that should be processed further, and it
/// could include any caches used by the build tool or the plugin itself.
/// The plugin is in complete control of what is written under this di-
/// rectory, and the contents are preserved between builds.
///
/// A plugin would usually create a separate subdirectory of this directory
/// for each command it creates, and the command would be configured to
/// write its outputs to that directory. The plugin may also create other
/// directories for cache files and other file system content that either
/// it or the command will need.
public let pluginWorkDirectory: PackagePlugin.Path

The initial proposal also includes that explanation as well as hints to future improvements regarding user-defined options for plugins.

@jpsim
Copy link
Collaborator

jpsim commented Sep 16, 2022

Regarding the whole configuration thing: I can't find an obvious way to pass in the path to a configuration file.

Fair enough, SwiftPM/Xcode must not expose any way to configure the build tool, it just has to work by default, which I think in the common case should work fine for SwiftLint. Maybe extensibility will come in the future...

@jpsim jpsim closed this Sep 16, 2022
@jpsim jpsim reopened this Sep 16, 2022
@technocidal
Copy link
Contributor Author

technocidal commented Sep 19, 2022

I feel a little bit bad about this but I'm not confident that the Xcode Plugin integration is ready. I'm unable to get the plug-in to run consistently with my work project which I used as a test bed. There are a couple of issues:

  • Adding and subsequently removing the plug-in from the project results in Xcode still trying to run the plug-in even though it's no longer configured as a build phase. Only a very thorough clean (clearing Derived Data etc.) gets rid of that issue. I'll report this as a radar and will post the link here as well.

  • The plug-in seems to work fine when SwiftLint reports errors but throws a very weird error when only warnings are reported. Something about non-zero exit Code during execution. This is particularly weird as the linting up until that point runs smoothly and reports the appropriate warnings.

Using it as a plug-in for a Swift Package seems to work a lot better so I'll keep that integration around. I'll push these changes later today.

If anyone wants to take a look, feel free! I'm at my wits end to be honest.

@polpielladev
Copy link

polpielladev commented Sep 22, 2022

I feel a little bit bad about this but I'm not confident that the Xcode Plugin integration is ready. I'm unable to get the plug-in to run consistently with my work project which I used as a test bed. There are a couple of issues:

  • Adding and subsequently removing the plug-in from the project results in Xcode still trying to run the plug-in even though it's no longer configured as a build phase. Only a very thorough clean (clearing Derived Data etc.) gets rid of that issue. I'll report this as a radar and will post the link here as well.
  • The plug-in seems to work fine when SwiftLint reports errors but throws a very weird error when only warnings are reported. Something about non-zero exit Code during execution. This is particularly weird as the linting up until that point runs smoothly and reports the appropriate warnings.

Using it as a plug-in for a Swift Package seems to work a lot better so I'll keep that integration around. I'll push these changes later today.

If anyone wants to take a look, feel free! I'm at my wits end to be honest.

Hey @technocidal, we have been able to implement a plugin at work that works quite well for us. It ships with our default .swiftlint.yml (which obviously works in our case but wouldn't be desirable in this case) and is configurable.

On top of that, we scan the target's root directory for a .swiftlint.yml as just running the executable didn't pick up the config file, we had to explicitly declare it. For Xcode targets it's a bit different as we've had to make sure we include .swiftlint.yml as a file reference to the Xcode target.

To make our plugin work we had to pass the --in-process-sourcekit flag that I can't see on this PR, maybe something worth considering? This picks the source kit version that runs in process to comply with the plugin's sandboxing rules.

@polpielladev
Copy link

Also, I am happy to share code (or even add a commit) for how we do the configuration discovery, albeit not very ideal for Xcode projects. It could potentially just be added to the package version for now?

Also, great work on this! I'm so excited to see more and more plugins making it into open source projects 🚀 🎉

@jcabreram
Copy link

@pol-piella Can you please share the code? I'm sure it'll be useful for a lot of us wanting to add SwiftLint as a plugin to our projects. Thanks!

README.md Outdated
You can integrate SwiftLint as a Swift Package Manager Plug-in if you're working with
a Swift Package of any kind.

Add SwiftLint as a package dependency to your `Package.swift`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice to add the example of how to add it as a package dependency for the people who don't know (the version number can be updated once this is released):

    dependencies: [
        .package(
            url: "https://github.com/realm/SwiftLint",
            from: "0.49.1"),
    ]

@weakfl
Copy link

weakfl commented Sep 26, 2022

Not sure what you need @jcabreram, but I'm using SwiftLint as Xcode plugin, see here.

@polpielladev
Copy link

@pol-piella Can you please share the code? I'm sure it'll be useful for a lot of us wanting to add SwiftLint as a plugin to our projects. Thanks!

I think the main change that made it work for us was passing the --in-process-sourcekit to the executable. It's a shame I can't commit to this PR, but could try open a new one adding this flag and link it here?

@polpielladev
Copy link

polpielladev commented Sep 30, 2022

@technocidal @jpsim I have opened a new PR (as I can't push to this one) #4259 preserving all the changes the @technocidal has made and just adding the extra flag that makes Sourcekit run in-process. We have been using this config at work with no issues so far. Also happy to look at any test/CI failures that come up and get this ready to be merged if people are happy with it 🎉

@technocidal
Copy link
Contributor Author

@pol-piella Your PR looks great and thank you for taking this feature over the finish line 🎉

@polpielladev
Copy link

@jpsim I have fixed the CI issues and merge conflicts with the PR now #4259 . Are we happy to merge the changes that @technocidal made and my flag addition? Happy to make any more changes if required 👍

@jcabreram
Copy link

@jpsim You seem to have closed #4259 due to --in-process-sourcekit being deprecated. Any suggestion for moving this forward?

@jpsim
Copy link
Collaborator

jpsim commented Oct 5, 2022

@jpsim You seem to have closed #4259 due to --in-process-sourcekit being deprecated. Any suggestion for moving this forward?

Is this PR still the one you all want to propose to merge? We shouldn't use --in-process-sourcekit because it's deprecated and done nothing. SourceKit is always run in-process now.

There are failing CI jobs here, but I think they were infrastructure errors? I'm re-running the failed jobs now.

@jpsim jpsim merged commit 3fd1573 into realm:main Oct 5, 2022
@jpsim
Copy link
Collaborator

jpsim commented Oct 5, 2022

Merged in 3fd1573. Thanks for your contributions and patience everyone!

@technocidal technocidal deleted the technocidal/swift-package-build-tool-plugin branch October 6, 2022 07:18
vexonius added a commit to vexonius/SwiftLint that referenced this pull request Oct 10, 2022
…ing commits:

commit b938a4e
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Sun Oct 9 21:03:57 2022 -0700

    Convert `number_separator` rule to SwiftSyntax (realm#4333)

commit ca7510a
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Sat Oct 8 01:49:15 2022 -0700

    Migrate `static_operator` rule to SwiftSyntax (realm#4271)

    * Migrate `static_operator` rule to SwiftSyntax

    * PR feedback

commit 04bd091
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Fri Oct 7 23:49:14 2022 -0700

    Migrate `legacy_multiple` rule to SwiftSyntax (realm#4317)

commit 82e916d
Author: Danny Mösch <danny.moesch@icloud.com>
Date:   Sat Oct 8 01:41:08 2022 +0200

    Extend SyntaxProtocol to avoid wrapping (realm#4332)

commit 957208c
Author: Danny Mösch <danny.moesch@icloud.com>
Date:   Sat Oct 8 00:21:16 2022 +0200

    Make `nsobject_prefer_isequal` rule work for nested classes (realm#4329)

commit fe6a930
Author: JP Simard <jp@jpsim.com>
Date:   Fri Oct 7 16:42:22 2022 -0400

    Use os_unfair_lock instead of NSLock on Darwin (realm#4330)

commit 8bcf871
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Fri Oct 7 13:40:23 2022 -0700

    Convert `discouraged_assert` rule to SwiftSyntax (realm#4316)

commit d913c8e
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Fri Oct 7 13:35:13 2022 -0700

    Rewrite `legacy_random` rule with SwiftSyntax (realm#4318)

commit b01e150
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Fri Oct 7 13:33:49 2022 -0700

    Rewrite `prohibited_interface_builder` with SwiftSyntax (realm#4321)

commit 3ac518c
Author: JP Simard <jp@jpsim.com>
Date:   Fri Oct 7 12:50:56 2022 -0400

    Only build `swiftlint` target in Makefile (realm#4327)

    Otherwise this tries to build the SwiftLintTestHelpers module in release
    mode, which fails.

    Also, to build the actual executable CLI, we can't just
    `swift build --target=swiftlint` because that doesn't produce a CLI,
    just the object file for the binary. So we have to `swift run`.

commit 0c06b7f
Author: JP Simard <jp@jpsim.com>
Date:   Fri Oct 7 11:02:01 2022 -0400

    Fix jpsim GitHub URL in changelog

commit 1a76a88
Author: JP Simard <jp@jpsim.com>
Date:   Fri Oct 7 10:33:13 2022 -0400

    Ignore incorrect keypath parser diagnostics (realm#4325)

    Works around swiftlang/swift-syntax#888

commit f341695
Author: JP Simard <jp@jpsim.com>
Date:   Fri Oct 7 10:22:23 2022 -0400

    Update rules_apple to 1.1.2 (realm#4324)

    https://github.com/bazelbuild/rules_apple/releases/tag/1.1.2

commit 9c53c94
Author: JP Simard <jp@jpsim.com>
Date:   Fri Oct 7 10:14:46 2022 -0400

    Update rules_xcodeproj to 0.9 (realm#4323)

    https://github.com/buildbuddy-io/rules_xcodeproj/releases/tag/0.9.0

commit 515587f
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Fri Oct 7 02:11:32 2022 -0700

    Convert `strict_fileprivate` rule to SwiftSyntax (realm#4319)

commit f174a55
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Fri Oct 7 00:56:15 2022 -0700

    Migrate `explicit_enum_raw_value` rule to SwiftSyntax (realm#4281)

    * Migrate `explicit_enum_raw_value` rule to SwiftSyntax

    * Handle nested enums

commit c0a4dd1
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Fri Oct 7 00:55:41 2022 -0700

    Rewrite IdenticalOperandsRule with SwiftSyntax (realm#3894)

    * Rewrite IdenticalOperandsRule with SwiftSyntax

    * Use folding algorithm from swift-format

    * Add workaround for debug builds

    * Update implementation after rebasing

    * Use SwiftOperators

    * Remove focused

commit 1533e72
Author: JP Simard <jp@jpsim.com>
Date:   Thu Oct 6 16:59:24 2022 -0400

    Specify `@SwiftLint` workspace in opt_wrapper.bzl load (realm#4314)

commit 549c71a
Author: JP Simard <jp@jpsim.com>
Date:   Thu Oct 6 16:48:51 2022 -0400

    Introduce LegacyFunctionRuleHelper (realm#4312)

commit 367389a
Author: Keith Smiley <keithbsmiley@gmail.com>
Date:   Thu Oct 6 12:54:41 2022 -0700

    [bazel] For SwiftSyntax to compile with optimizations (realm#4311)

    This avoids potential stack overflows and slowness when just working on
    SwiftLint itself with bazel. These compiles take a lot longer but as
    long as you're not updating swift-syntax that should be a 1 time penalty

commit ef248f6
Author: JP Simard <jp@jpsim.com>
Date:   Thu Oct 6 15:40:18 2022 -0400

    Remove Signal from OSSCheck (realm#4313)

    It's misbehaving for some reason. It'd be good if anyone wanted to look
    into that.

commit a6c90dd
Author: JP Simard <jp@jpsim.com>
Date:   Thu Oct 6 15:16:49 2022 -0400

    Rewrite `legacy_cggeometry_functions` with SwiftSyntax (realm#4309)

commit 2a95f1b
Author: Danny Mösch <danny.moesch@icloud.com>
Date:   Thu Oct 6 19:13:25 2022 +0200

    Add tests for `fileprivate` to `private_outlet` rule (realm#4308)

commit 5ba9d60
Author: JP Simard <jp@jpsim.com>
Date:   Thu Oct 6 12:46:27 2022 -0400

    Rewrite `legacy_nsgeometry_functions` with SwiftSyntax (realm#4307)

commit 8345545
Author: Danny Mösch <danny.moesch@icloud.com>
Date:   Thu Oct 6 18:03:03 2022 +0200

    Make `private_unit_test` rule correctable (realm#4293)

commit d6fd754
Author: JP Simard <jp@jpsim.com>
Date:   Thu Oct 6 01:18:31 2022 -0400

    Rewrite `contains_over_range_nil_comparison` with SwiftSyntax (realm#4225)

    Use SwiftOperators.

commit a8d3813
Author: JP Simard <jp@jpsim.com>
Date:   Thu Oct 6 00:36:04 2022 -0400

    Fix Dockerfile to account for new test modules (realm#4306)

commit 5ae1d98
Author: JP Simard <jp@jpsim.com>
Date:   Thu Oct 6 00:10:04 2022 -0400

    Create new GeneratedTests and IntegrationTests test targets (realm#4304)

    * Move generated rule tests to a dedicated GeneratedTests target
    * Move integration tests to a dedicated IntegrationTests target

    This will improve bazel cacheability by having fewer tests depend on all
    lint inputs, which are only needed by the integration tests.

commit d3fd234
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 23:53:14 2022 -0400

    Fix Dockerfile to account for SwiftLintTestHelpers (realm#4305)

commit 503f8c5
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 23:36:46 2022 -0400

    Move ExtraRulesTests to its own target & directory (realm#4300)

    Also create a SwiftLintTestHelpers test target.

commit 8470b65
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 23:25:54 2022 -0400

    Simplify analyze bazel test (realm#4303)

    By removing SourceAndTestFiles since those files should all be covered
    by LintInputs.

commit 4552fac
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 22:42:09 2022 -0400

    [LegacyConstantRule] Remove unused patterns (realm#4302)

    We now just need these patterns for the mapping of legacy to new.

commit c29e167
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 21:55:48 2022 -0400

    Rewrite `legacy_constant` with SwiftSyntax (realm#4299)

commit cfabd8e
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 21:40:12 2022 -0400

    Organize `Tests/BUILD` with comments (realm#4301)

commit 91d4a42
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 20:51:46 2022 -0400

    Loosen correction location assertions (realm#4297)

    With SwiftSyntax rewriters, the visitors get called with the new nodes
    after previous mutations have been applied, so it's not straightforward
    to translate those back into the original source positions.

    So only check the first locations.

commit 7af26f0
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 20:45:07 2022 -0400

    [CI] Increase TSan test timeout to 1,000 seconds (~16 minutes) (realm#4298)

    We're starting to hit this timeout.

commit c087e79
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Wed Oct 5 16:00:37 2022 -0700

    [oss-check] Add DuckDuckGo and Signal (realm#4275)

commit 54ec0c9
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 18:46:14 2022 -0400

    Rewrite `trailing_semicolon` with SwiftSyntax (realm#4296)

commit 3834e52
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 18:26:57 2022 -0400

    Rewrite `empty_parameters` with SwiftSyntax (realm#4295)

commit 5d9a72b
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 17:32:28 2022 -0400

    Make `allow_private_set` allow `fileprivate(set)` too (realm#4294)

    As was previously the case.

commit af222a5
Author: Danny Mösch <danny.moesch@icloud.com>
Date:   Wed Oct 5 23:00:06 2022 +0200

    Ignore static methods in `private_unit_test` rule (realm#4292)

    Static methods cannot be tests.

commit 54ccc39
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 16:28:56 2022 -0400

    Update SwiftSyntax (realm#4290)

    Just staying up to date here.

    There's no need to frequently update, but given that we just updated to
    trunk, I wanted to make sure we can update without issues.

commit 8b578eb
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 16:11:04 2022 -0400

    Update changelog entry for rules rewritten using SwiftSyntax (realm#4291)

commit 2eb764d
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 15:34:55 2022 -0400

    Update Dockerfile for plugin support (realm#4289)

commit 13c45a5
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 15:31:11 2022 -0400

    Add resolved issues to plugin changelog entry (realm#4288)

commit 3fd1573
Author: Johannes Ebeling <14994778+technocidal@users.noreply.github.com>
Date:   Wed Oct 5 21:28:19 2022 +0200

    Make SwiftLint available as a build tool plugin (realm#4176)

    * ✨ (spm) add build tool plugin definition for swiftlint
    * 📝 (changelog) add changelog item for the plugin
    * 🐛 (cache) define cache path explicitly to avoid issues during build without issues
    * 🎨 minor code cleanup
    * 📝 document usage with Xcode as well as Swift packages

commit 6d75645
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 15:26:14 2022 -0400

    [CI] Disable xcodebuild tests (realm#4287)

    This is failing very often now due to FB11648454.

    Given that we run these tests on macOS via SwiftPM and Bazel as well,
    I'm satisfied with the amount of coverage we have on our tests without
    this.

commit 8eec5e6
Author: Danny Mösch <danny.moesch@icloud.com>
Date:   Wed Oct 5 21:15:25 2022 +0200

    Rewrite `private_unit_test` with SwiftSyntax (realm#4285)

commit 44382ea
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 11:38:11 2022 -0400

    Avoid making SourceKit requests to get parser diagnostics (realm#4286)

    By using SwiftSyntax instead, we avoid the overhead of a SourceKit
    request, which has a significant impact if none of the rules being
    corrected use SourceKit.

commit 41b8834
Author: JP Simard <jp@jpsim.com>
Date:   Wed Oct 5 11:29:01 2022 -0400

    Rewrite `private_outlet` with SwiftSyntax (realm#4228)

commit a40cc70
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Tue Oct 4 21:56:42 2022 -0700

    Migrate `no_extension_access_modifier` to SwiftSyntax (realm#4270)

    * Migrate `no_extension_access_modifier` to SwiftSyntax

    * PR feedback

commit 1cbf3ca
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Tue Oct 4 20:57:22 2022 -0700

    Migrate `anonymous_argument_in_multiline_closure` to SwiftSyntax (realm#4279)

commit 0f97059
Author: JP Simard <jp@jpsim.com>
Date:   Tue Oct 4 14:52:03 2022 -0400

    Add column for SourceKit usage to `rules` command (realm#4284)

commit 129a55f
Author: Vasiliy Kattouf <vasya1404@gmail.com>
Date:   Wed Oct 5 00:45:52 2022 +0600

    Add ability to filter rules for `generate-docs` subcommand (realm#4195)

    Added rules filtering options, like in the `rules` subcommand.

    <img width="880" alt="generate-docs--help" src="https://user-images.githubusercontent.com/7829589/189372666-2f5aba62-57a1-49dc-9155-c60f9e085984.png">

    To achieve reuse with `rules` subcommand:
    - extracted filtering logic into `RulesFilter` (and write tests)
    - extracted filtering command line parameters into `RulesFilterOptions: ParsableArguments`

commit c70510c
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Tue Oct 4 10:03:33 2022 -0700

    Migrate `strong_iboutlet` to SwiftSyntax (realm#4277)

commit 6bfecb8
Author: JP Simard <jp@jpsim.com>
Date:   Tue Oct 4 12:34:24 2022 -0400

    Rewrite `nsobject_prefer_isequal` with SwiftSyntax (realm#4283)

commit db20dbb
Author: JP Simard <jp@jpsim.com>
Date:   Tue Oct 4 11:47:27 2022 -0400

    Replace mutating for-in with `reduce(into:)` (realm#4282)

commit 46649c8
Author: JP Simard <jp@jpsim.com>
Date:   Tue Oct 4 11:20:00 2022 -0400

    Rewrite `explicit_init` with SwiftSyntax (realm#4223)

commit 1662a38
Author: JP Simard <jp@jpsim.com>
Date:   Tue Oct 4 09:28:46 2022 -0400

    Rewrite `ibinspectable_in_extension` with SwiftSyntax (realm#4227)

commit 18ab688
Author: JP Simard <jp@jpsim.com>
Date:   Tue Oct 4 09:14:27 2022 -0400

    Rewrite `contains_over_filter_count` with SwiftSyntax (realm#4226)

commit ab3f070
Author: Danny Mösch <danny.moesch@icloud.com>
Date:   Tue Oct 4 07:39:07 2022 +0200

    Introduce `SeverityBasedRuleConfiguration` to avoid custom `makeViolation`s (realm#4274)

commit e3f1b56
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Mon Oct 3 13:20:43 2022 -0700

    Convert `duplicate_enum_cases` rule to SwiftSyntax (realm#4263)

commit 26ca731
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Mon Oct 3 10:18:56 2022 -0700

    Migrate `deployment_target` rule to SwiftSyntax (realm#4268)

commit 8926596
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Mon Oct 3 10:18:43 2022 -0700

    Migrate `closure_parameter_position` to SwiftSyntax (realm#4264)

commit 647819e
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Mon Oct 3 09:28:29 2022 -0700

    Migrate `switch_case_on_newline` to SwiftSyntax (realm#4269)

commit f37ea8a
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Mon Oct 3 09:28:14 2022 -0700

    Migrate `no_fallthrough_only` rule to SwiftSyntax (realm#4266)

commit ac91f7b
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Mon Oct 3 09:27:29 2022 -0700

    Migrate `private_action` rule to SwiftSyntax (realm#4267)

commit 462f741
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Sun Oct 2 17:29:55 2022 -0700

    Rewrite `redundant_string_enum_value` with SwiftSyntax (realm#4243)

commit 2684158
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Sun Oct 2 17:29:04 2022 -0700

    Rewrite protocol_property_accessors_order with SwiftSyntax (realm#4237)

    * Rewrite protocol_property_accessors_order with SwiftSyntax

    * PR feedback

commit 2388e49
Author: JP Simard <jp@jpsim.com>
Date:   Sat Oct 1 15:05:36 2022 -0400

    Use SwiftSyntax's new SwiftParser (realm#4216)

commit b2caef7
Author: JP Simard <jp@jpsim.com>
Date:   Sat Oct 1 11:29:10 2022 -0400

    Generate Swift Syntax Dashboard in documentation (realm#4260)

    This is a useful overview of where the migration effort stands and what
    rules can be migrated next.

commit 2efd538
Author: Danny Mösch <danny.moesch@icloud.com>
Date:   Fri Sep 30 20:23:05 2022 +0200

    Explain where to get syntax kinds for custom rules from (realm#4246)

commit 0fe3404
Author: Benjamin Kramer <70897305+benjamin-kramer@users.noreply.github.com>
Date:   Thu Sep 29 21:26:51 2022 +0300

    Add configuration `only_enforce_before_trivial_lines` to `vertical_whitespace_closing_braces` rule (realm#3941)

    Vertical whitespace may be important for readability when the line
    with the closing brace is not a trivial one (e.g. `} else if ... {`).
    The configuration allows not enforcing the rule in such cases.

commit da75cdc
Author: Danny Mösch <danny.moesch@icloud.com>
Date:   Thu Sep 29 06:49:35 2022 +0200

    Remove instructions for Atom editor (realm#4255)

    Atom editor will be sunset at the end of the year.

commit 86f6023
Author: JP Simard <jp@jpsim.com>
Date:   Wed Sep 28 23:37:54 2022 -0400

    Update CryptoSwift to 1.6.0 release (realm#4258)

commit afb46dc
Author: JP Simard <jp@jpsim.com>
Date:   Wed Sep 28 23:23:06 2022 -0400

    Remove anyobject_protocol from configuration (realm#4257)

    It's been deprecated and the compiler catches these now.

commit a40488f
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Wed Sep 28 19:57:00 2022 -0700

    Rewrite `inert_defer` rule with SwiftSyntax (realm#4242)

commit d2c638b
Author: JP Simard <jp@jpsim.com>
Date:   Tue Sep 27 21:56:17 2022 -0400

    [bazel] Enable WMO in `release` configuration (realm#4252)

    Enabling WMO can make SwiftLint up to 90% faster in my testing, and
    matches what SwiftPM does when building with `swift buid -c release`.

commit 86a176d
Author: JP Simard <jp@jpsim.com>
Date:   Tue Sep 27 21:39:29 2022 -0400

    [bazel] Fix release config (realm#4253)

commit 73def99
Author: JP Simard <jp@jpsim.com>
Date:   Tue Sep 27 21:34:27 2022 -0400

    [bazel] Define a `release` configuration (realm#4251)

    This will be used to put release configurations, like WMO.

commit fd7afed
Author: JP Simard <jp@jpsim.com>
Date:   Mon Sep 26 10:11:39 2022 -0400

    Update SwiftSyntax & internal parser for Swift 5.7 (realm#4203)

    Require Swift 5.7 to compile

commit c6eec80
Author: Danny Mösch <danny.moesch@icloud.com>
Date:   Sun Sep 25 18:31:24 2022 +0200

    Move method (realm#4238)

commit a4c46f6
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Sun Sep 25 02:55:00 2022 -0700

    Rewrite `no_space_in_method_call` with SwiftSyntax (realm#4236)

commit 734ecea
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Sun Sep 25 02:54:29 2022 -0700

    Rewrite empty_parentheses_with_trailing_closure with SwiftSyntax (realm#4235)

commit 4fb5ebe
Author: JP Simard <jp@jpsim.com>
Date:   Sat Sep 24 15:09:41 2022 -0400

    Docker: Update to Swift 5.7 & Ubuntu Jammy (realm#4241)

    And apply workaround for swiftlang/swift#59961 to
    all commands.

commit bb309de
Author: JP Simard <jp@jpsim.com>
Date:   Sat Sep 24 13:56:41 2022 -0400

    Pin Swift Docker image to 5.6.3-focal (realm#4240)

commit 7be6f86
Author: Danny Mösch <danny.moesch@icloud.com>
Date:   Thu Sep 22 19:27:45 2022 +0200

    Add new `if_let_shadowing` rule (realm#4206)

commit 0db26db
Author: Martin Redington <mildm8nnered@users.noreply.github.com>
Date:   Wed Sep 21 17:29:32 2022 +0100

    Add `test_parent_classes` option to `test_case_accessibility` rule (realm#4214)

commit f8a4276
Author: Marcelo Fabri <me@marcelofabri.com>
Date:   Wed Sep 21 08:29:52 2022 -0700

    Rewrite `generic_type_name` rule with SwiftSyntax (realm#4229)

commit 95ffaed
Author: Danny Mösch <danny.moesch@icloud.com>
Date:   Tue Sep 20 23:24:40 2022 +0200

    Filter out compiler argument not understood by SourceKit in Xcode 14 (realm#4210)

commit 7b1de2f
Author: JP Simard <jp@jpsim.com>
Date:   Tue Sep 20 16:07:24 2022 -0400

    Rewrite `dynamic_inline` with SwiftSyntax (realm#4218)

commit 49665a9
Author: JP Simard <jp@jpsim.com>
Date:   Tue Sep 20 15:56:57 2022 -0400

    Rewrite `fallthrough` with SwiftSyntax (realm#4224)

commit 0ea26ed
Author: Danny Mösch <danny.moesch@icloud.com>
Date:   Tue Sep 20 07:09:05 2022 +0200

    Skip autocorrecting usage of `NSIntersectionRect` (realm#4213)

commit 2efa085
Author: Danny Mösch <danny.moesch@icloud.com>
Date:   Mon Sep 19 23:27:15 2022 +0200

    Make `willMove` a lifecycle method in `type_contents_order` rule (realm#4201)

commit f3d367f
Author: dahlborn <daniel.ahlborn93@web.de>
Date:   Mon Sep 19 22:15:41 2022 +0200

    Add `LibraryContentProvider` to `file_types_order` rule (realm#4209)

commit 345a904
Author: JP Simard <jp@jpsim.com>
Date:   Mon Sep 19 16:12:21 2022 -0400

    Rewrite `empty_enum_arguments` with SwiftSyntax (realm#4221)

commit 0808f25
Author: JP Simard <jp@jpsim.com>
Date:   Mon Sep 19 15:51:21 2022 -0400

    Fix typo in example (realm#4222)

commit 8d500d1
Author: JP Simard <jp@jpsim.com>
Date:   Mon Sep 19 12:39:35 2022 +0200

    Rewrite `empty_collection_literal` with SwiftSyntax (realm#4220)

commit 992cc9a
Author: JP Simard <jp@jpsim.com>
Date:   Mon Sep 19 12:24:22 2022 +0200

    Rewrite `discouraged_object_literal` with SwiftSyntax (realm#4219)

commit 49ace17
Author: Danny Mösch <danny.moesch@icloud.com>
Date:   Wed Sep 14 23:20:51 2022 +0200

    Add Swift 5.6.3 to version test (realm#4207)
@tboogh
Copy link

tboogh commented Oct 11, 2022 via email

@tonyarnold
Copy link
Contributor

Hi folks, before I open an issue: I'm struggling to get the build plugin to find/resolve my .swiftlint.yml - it's ignoring the ones that are in my project root and local package root.

Is there a trick to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants