Skip to content

Make global indentation available to rules#6797

Open
GandaLF2006 wants to merge 1 commit into
realm:mainfrom
GandaLF2006:gandalf2006/global_indentation
Open

Make global indentation available to rules#6797
GandaLF2006 wants to merge 1 commit into
realm:mainfrom
GandaLF2006:gandalf2006/global_indentation

Conversation

@GandaLF2006

Copy link
Copy Markdown
Contributor

Summary

Rules can now read the global indentation setting from .swiftlint.yml via CurrentRule.configuration?.indentation inside their validate body.

Changes

  • Moved IndentationStyle from SwiftLintFramework to SwiftLintCore so it is visible to rules without a circular module dependency.
  • Add GlobalConfiguration to SwiftLintCore as the carrier for global settings exposed to rules (currently indentation).
  • Add CurrentRule.configuration (task-local), populated by the linter around each rule's execution.
  • Bridge ConfigurationGlobalConfiguration via Configuration.globalConfiguration.

Breaking

Configuration.IndentationStyle has moved to SwiftLintCore.IndentationStyle.

Test Plan

  • Added GlobalConfigurationTests covering the bridge, end-to-end delivery, and isolation between lints.

@SwiftLintBot

Copy link
Copy Markdown
19 Messages
📖 Building this branch resulted in a binary size of 28202.66 KiB vs 28200.24 KiB when built on main (0% larger).
📖 Linting Aerial with this PR took 0.63 s vs 0.67 s on main (5% faster).
📖 Linting Alamofire with this PR took 0.91 s vs 0.91 s on main (0% slower).
📖 Linting Brave with this PR took 5.96 s vs 5.93 s on main (0% slower).
📖 Linting DuckDuckGo with this PR took 25.43 s vs 25.28 s on main (0% slower).
📖 Linting Firefox with this PR took 10.24 s vs 10.27 s on main (0% faster).
📖 Linting Kickstarter with this PR took 7.38 s vs 7.32 s on main (0% slower).
📖 Linting Moya with this PR took 0.37 s vs 0.37 s on main (0% slower).
📖 Linting NetNewsWire with this PR took 2.34 s vs 2.35 s on main (0% faster).
📖 Linting Nimble with this PR took 0.54 s vs 0.53 s on main (1% slower).
📖 Linting PocketCasts with this PR took 6.87 s vs 6.86 s on main (0% slower).
📖 Linting Quick with this PR took 0.33 s vs 0.36 s on main (8% faster).
📖 Linting Realm with this PR took 2.45 s vs 2.43 s on main (0% slower).
📖 Linting Sourcery with this PR took 1.47 s vs 1.5 s on main (2% faster).
📖 Linting Swift with this PR took 4.2 s vs 4.19 s on main (0% slower).
📖 Linting SwiftLintPerformanceTests with this PR took 0.16 s vs 0.16 s on main (0% slower).
📖 Linting VLC with this PR took 1.08 s vs 1.08 s on main (0% slower).
📖 Linting Wire with this PR took 15.05 s vs 15.05 s on main (0% slower).
📖 Linting WordPress with this PR took 9.72 s vs 9.69 s on main (0% slower).

Generated by 🚫 Danger

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.

2 participants