Commit Graph
20 Commits
Author SHA1 Message Date
Danny MöschandGitHub 2578cb3862 Use SwiftSyntax version 601.0.0 (#6003) 2025-04-03 21:27:57 +02:00
Danny MöschandGitHub b14272d4f2 Rewrite type_contents_order rule with SwiftSyntax (#6002) 2025-03-17 20:15:02 +01:00
Martin RedingtonandGitHub ed10aec5f8 Enable implicit_return and fix all violations (#5658) 2024-07-10 12:15:19 +01:00
Danny MöschandGitHub c810459e6a Enforce mandatory trailing comma and fix all violations (#5640) 2024-06-28 05:36:50 +00:00
Danny MöschandGitHub 914fa02e4e Use SwiftSyntax version 600.0.0-prerelease-2024-03-11 (#5527)
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.
2024-06-22 11:14:14 +02:00
Danny MöschandGitHub 72069bf5c0 Ignore ACL restricted to value setting in extension_access_modifier rule (#5625) 2024-06-22 10:34:10 +02:00
Danny MöschandGitHub dfe19ac7fc Respect comments before opening braces in opening_brace rule (#5582) 2024-05-15 23:06:59 +02:00
Danny MöschandGitHub c730047176 Enable superfluous_else rule (#5412) 2024-03-03 16:30:44 +01:00
Danny MöschandGitHub 8b98d859a3 Make superfluous_else rule auto-correctable (#5411) 2024-01-07 18:55:42 +01:00
Kishikawa KatsumiandGitHub 0d54c2a10d Rewrite opening_brace rule with SwiftSyntax (#5164) 2023-12-02 12:21:50 +01:00
Danny MöschandGitHub eab0af851c Rewrite identifier_name rule with SwiftSyntax (#5354) 2023-11-19 12:47:41 +01:00
JP SimardandGitHub 907294929b Remove workaround for SR-11170 (#5280)
The original issue was closed a year ago and this doesn't appear to be
needed anymore.

I compiled in Debug mode and ran the tests in Xcode to verify.
2023-10-16 09:39:10 -04:00
Danny MöschandGitHub 075017cba5 Merge modifier extensions into one (#5234) 2023-09-24 23:50:10 +02:00
Danny MöschandGitHub 35a78815d1 Update SwiftSyntax (#5198) 2023-09-14 22:49:55 +02:00
Danny MöschandGitHub b281a8d33a Update SwiftSyntax (#5168) 2023-08-30 22:57:10 +02:00
Danny MöschandGitHub 9f927e9d9b Add new non_overridable_class_declaration rule (#5160) 2023-08-28 13:34:09 -04:00
Martin RedingtonandGitHub 0693d547b0 Add new unneeded_synthesized_initializer rule (#4812) 2023-06-21 22:15:02 +02:00
JP SimardandGitHub 1e73835e83 Remove dead code (#5004)
Identified with the upcoming improved dead code detection.
2023-05-12 14:20:31 -04:00
Danny MöschandGitHub 6a2e973de3 Add new redundant_self_in_closure rule (#4911) 2023-05-05 21:14:14 +02:00
JP Simard 86d60400c1 Move core SwiftLint functionality to new SwiftLintCore module
Over the years, SwiftLintFramework had become a fairly massive monolith,
containing over 400 source files with both core infrastructure and
rules.

Architecturally, the rules should rely on the core infrastructure but
not the other way around. There are two exceptions to this:
`custom_rules` and `superfluous_disable_command` which need special
integration with the linter infrastructure.

Now the time has come to formalize this architecture and one way to do
that is to move the core SwiftLint functionality out of
SwiftLintFramework and into a new SwiftLintCore module that the rules
can depend on.

Beyond enforcing architectural patterns, this also has the advantage of
speeding up incremental compilation by skipping rebuilding the core
functionality when iterating on rules.

Because the core functionality is always useful when building rules, I'm
opting to import SwiftLintCore in SwiftLintFramework as `@_exported` so
that it's implicitly available to all files in SwiftLintFramework
without needing to import it directly.

In a follow-up I'll also split the built-in rules and the extra rules
into their own modules. More modularization is possible from there, but
not planned.

The bulk of this PR just moves files from `Source/SwiftLintFramework/*`
to `Source/SwiftLintCore/*`. There are some other changes that can't be
split up into their own PRs:

* Change jazzy to document the SwiftLintCore module instead of
  SwiftLintFramework.
* Change imports in unit tests to reflect where code was moved to.
* Update `sourcery` make rule to reflect where code was moved to.
* Create a new `coreRules` array and register those rules with the
  registry. This allows the `custom_rules` and
  `superfluous_disable_command` rule implementations to remain internal
  to the SwiftLintCore module, preventing more implementation details
  from leaking across architectural layers.
* Move `RuleRegistry.registerAllRulesOnce()` out of the type declaration
  and up one level so it can access rules defined downstream from
  SwiftLintCore.
2023-04-26 21:10:19 -04:00