fix: Update SwiftLint configuration to include Tests directory and lint only modified Swift files#426
Merged
fix: Update SwiftLint configuration to include Tests directory and lint only modified Swift files#426
Conversation
Log/tmp/danger/8E6C60EA-699B-4D3E-A459-C583735478BE/_tmp_dangerfile.swift:60:65: error: argument 'directory' must precede argument 'configFile'
SwiftLint.lint(inline: false, configFile: ".swiftlint.yml", directory: nil)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
directory: nil,
�[31mERROR: Dangerfile eval failed at Dangerfile.swift
�[0;0m�[31mERROR: Could not get the results JSON file at /tmp/danger/8E6C60EA-699B-4D3E-A459-C583735478BE/danger-response.json
�[0;0m |
There was a problem hiding this comment.
Pull request overview
This PR aims to update the SwiftLint configuration to include the Tests directory and modify the Dangerfile to lint only modified Swift files. However, the implementation has a critical bug where the filtered files are not actually used.
Key changes:
- Added "Tests" directory to SwiftLint's included paths in
.swiftlint.yml - Added logic to filter modified and created Swift files in Source/ and Tests/ directories
- Added conditional check to run SwiftLint only when relevant Swift files are changed
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.swiftlint.yml |
Adds "Tests" directory to the included paths for SwiftLint scanning |
Dangerfile.swift |
Adds file filtering logic and conditional execution for SwiftLint, though the filtered files are not actually used by the lint call |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Log/tmp/danger/753E92BD-1FD1-49BC-9447-F348B25E2FC3/_tmp_dangerfile.swift:60:19: error: incorrect argument labels in call (have 'lintableFiles:inline:configFile:directory:', expected 'inline:directory:configFile:strict:quiet:lintAllFiles:swiftlintPath:')
SwiftLint.lint(lintableFiles: changedSwiftFiles, inline: false, configFile: ".swiftlint.yml", directory: nil)
^~~~~~~~~~~~~~ ~~~~~~ ~~~~~~~~~
inline directory strict
/tmp/danger/753E92BD-1FD1-49BC-9447-F348B25E2FC3/_tmp_dangerfile.swift:60:35: error: cannot convert value of type '[File]' (aka 'Array<String>') to expected argument type 'Bool'
SwiftLint.lint(lintableFiles: changedSwiftFiles, inline: false, configFile: ".swiftlint.yml", directory: nil)
^
�[31mERROR: Dangerfile eval failed at Dangerfile.swift
�[0;0m�[31mERROR: Could not get the results JSON file at /tmp/danger/753E92BD-1FD1-49BC-9447-F348B25E2FC3/danger-response.json
�[0;0m |
Log/tmp/danger/BDC7CCE9-CD06-45C1-8BAA-009FD9EBEAE9/_tmp_dangerfile.swift:60:19: error: incorrect argument labels in call (have 'lintableFiles:inline:configFile:directory:', expected 'inline:directory:configFile:strict:quiet:lintAllFiles:swiftlintPath:')
SwiftLint.lint(lintableFiles: changedSwiftFiles, inline: false, configFile: ".swiftlint.yml", directory: nil)
^~~~~~~~~~~~~~ ~~~~~~ ~~~~~~~~~
inline directory strict
/tmp/danger/BDC7CCE9-CD06-45C1-8BAA-009FD9EBEAE9/_tmp_dangerfile.swift:60:35: error: cannot convert value of type '[File]' (aka 'Array<String>') to expected argument type 'Bool'
SwiftLint.lint(lintableFiles: changedSwiftFiles, inline: false, configFile: ".swiftlint.yml", directory: nil)
^
�[31mERROR: Dangerfile eval failed at Dangerfile.swift
�[0;0m�[31mERROR: Could not get the results JSON file at /tmp/danger/BDC7CCE9-CD06-45C1-8BAA-009FD9EBEAE9/danger-response.json
�[0;0m |
ced8547 to
12de7f5
Compare
Log/tmp/danger/35DD2E1B-0B87-49EC-BF1F-2AE1A00D3521/_tmp_dangerfile.swift:60:65: error: argument 'directory' must precede argument 'configFile'
SwiftLint.lint(inline: false, configFile: ".swiftlint.yml", directory: nil)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
directory: nil,
�[31mERROR: Dangerfile eval failed at Dangerfile.swift
�[0;0m�[31mERROR: Could not get the results JSON file at /tmp/danger/35DD2E1B-0B87-49EC-BF1F-2AE1A00D3521/danger-response.json
�[0;0m |
12de7f5 to
5b97b52
Compare
SwiftLint found issues
Generated by 🚫 Danger Swift against 5b97b52 |
SwiftLint found issues
Generated by 🚫 Danger Swift against 882bc31 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.