Skip to content

Add --parent-config option to lint command - #6868

Draft
LizunovSergey wants to merge 1 commit into
realm:mainfrom
LizunovSergey:fix/5421-parent-config-option
Draft

Add --parent-config option to lint command#6868
LizunovSergey wants to merge 1 commit into
realm:mainfrom
LizunovSergey:fix/5421-parent-config-option

Conversation

@LizunovSergey

Copy link
Copy Markdown

Summary

  • add a --parent-config option to the lint command
  • prepend the parent configuration to explicitly supplied --config files
  • use the default .swiftlint.yml as the child when no --config is supplied
  • add regression coverage for both configuration paths
  • document the enhancement in the changelog

Why

Some workflows download a shared parent configuration to a temporary location,
so its path cannot be written into the project's configuration file ahead of
time. The new option allows that parent to be supplied at invocation time while
preserving the existing parent-to-child merge order.

Testing

  • xcrun swift test --filter LintOrAnalyzeOptionsTests
  • verified swiftlint lint --help exposes --parent-config
  • smoke-tested parent precedence with both an explicit child config and the
    default .swiftlint.yml
  • linted all changed Swift files with the locally built SwiftLint binary

Closes #5421

@SwiftLintBot

Copy link
Copy Markdown
20 Messages
📖 Building this branch resulted in a binary size of 28460.62 KiB vs 28460.45 KiB when built on main (0% larger).
📖 Linting Aerial with this PR took 0.62 s vs 0.63 s on main (1% 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.97 s vs 5.95 s on main (0% slower).
📖 Linting Brigade with this PR took 16.95 s vs 17.0 s on main (0% faster).
📖 Linting DuckDuckGo with this PR took 27.22 s vs 27.04 s on main (0% slower).
📖 Linting Firefox with this PR took 10.82 s vs 10.81 s on main (0% slower).
📖 Linting Kickstarter with this PR took 6.83 s vs 6.82 s on main (0% slower).
📖 Linting Moya with this PR took 0.36 s vs 0.35 s on main (2% slower).
📖 Linting NetNewsWire with this PR took 2.35 s vs 2.35 s on main (0% slower).
📖 Linting Nimble with this PR took 0.53 s vs 0.53 s on main (0% slower).
📖 Linting PocketCasts with this PR took 6.95 s vs 6.92 s on main (0% slower).
📖 Linting Quick with this PR took 0.33 s vs 0.33 s on main (0% slower).
📖 Linting Realm with this PR took 2.88 s vs 2.89 s on main (0% faster).
📖 Linting Sourcery with this PR took 1.52 s vs 1.57 s on main (3% faster).
📖 Linting Swift with this PR took 4.27 s vs 4.28 s on main (0% faster).
📖 Linting SwiftLintPerformanceTests with this PR took 0.17 s vs 0.16 s on main (6% slower).
📖 Linting VLC with this PR took 1.22 s vs 1.22 s on main (0% slower).
📖 Linting Wire with this PR took 15.5 s vs 15.5 s on main (0% slower).
📖 Linting WordPress with this PR took 9.65 s vs 9.7 s on main (0% faster).

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.

Allow parent config as an argument

3 participants