You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experimenting with it here and noticed that a "stock" configuration of the plugin won't work if you have a remote configuration. The reason is the same as why nested configurations don't work, as per this issue.
# Output of `danger pr`, with `switlint.verbose = true`
Using config file: .swiftlint.yml
Swiftlint will be run from /Users/gio/Developer/a8c/WordPress-iOS-Shared
Swiftlint will exclude the following paths: []
Swiftlint includes the following paths: []
linting with options: {:config=>".swiftlint.yml", :reporter=>"json", :quiet=>true, :pwd=>"/Users/gio/Developer/a8c/WordPress-iOS-Shared", :force_exclude=>true}
Swiftlint will lint the following files:
Received from Swiftlint: {}
The workaround is the same as for the nested configuration, use the all_files flag.
require'git_diff_parser'# The plugin looks into the .swiftlint.yml config to know in which folders to# look for files to lint. Our config only has the URL of the remote config,# though, so no file to lint would be found. This option makes the plugin lint# all the files, and is "the same as [if] you were running `swiftlint` on the# root folder".# See# https://github.com/ashfurrow/danger-ruby-swiftlint/tree/a8d6b3a6e82994f500411ad7acc2039d2d7409c7#usageswiftlint.lint_all_files=true# Despite using we want inline comments only in the files that changed in the# PR, instead of a long wall of text with each of the files in the repo failing# to lint. This extra code makes it possible.# See# https://github.com/ashfurrow/danger-ruby-swiftlint/tree/a8d6b3a6e82994f500411ad7acc2039d2d7409c7#usagediff=GitDiffParser::Patches.parse(github.pr_diff)dir="#{Dir.pwd}/"swiftlint.lint_files(inline_mode: true){ |violation|
diff_filename=violation['file'].gsub(dir,'')file_patch=diff.find_patch_by_file(diff_filename)file_patch != nil && file_patch.changed_lines.any?{ |line| line.number == violation['line']}}
I don't think any action is required right now, but just wanted to give the team a heads up. 👌
Maybe when the SwiftLint feature ships a README update could help. In the meantime, this issue should do.
The text was updated successfully, but these errors were encountered:
@mokagio Huge props for opening this issue up 👏 No doubt it will help others. Agreed about next steps and waiting for the readme update. Hope you're well!
I noticed this PR in the SwiftLint repo, which adds support for parent, child, and remote configurations.
I'm experimenting with it here and noticed that a "stock" configuration of the plugin won't work if you have a remote configuration. The reason is the same as why nested configurations don't work, as per this issue.
To be specific, this config file
will result in this output by the plugin.
The workaround is the same as for the nested configuration, use the
all_files
flag.I've been able to use it successfully here, with this
Dangerfile
I don't think any action is required right now, but just wanted to give the team a heads up. 👌
Maybe when the SwiftLint feature ships a
README
update could help. In the meantime, this issue should do.The text was updated successfully, but these errors were encountered: