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 was just about to request something like this also, we are integrating periphery into a codebase with thousands of LOC and it's not feasible to fix the warnings without having a baseline ignore. You might be able to make use of a short ruby script to perform an automated insert of baseline ignores.
Does not handle parameters, and doesn't do indentation correctly
# takes as input lines of warnings from periphery formatted for Xcode
# exclude parameter based warnings (cannot be handled)
File.open('warnings.txt').grep_v(/Parameter/).sort.reverse.each do |line|
# extract location
file=line[/(.*?):(.*?):(.*?)/, 1]
line_num=line[/(.*?):(.*?):(.*?)/, 2]
# insert a baseline ignore on the line above
`sed -i '' '#{line_num}s/^/ \\/\\/ periphery:ignore - baseline ignores\\n/' "#{file}"`
end
I have been working on a very similar feature for SwiftLint, which is not in a shipping version yet, but has been merged to main - you can see more details here: realm/SwiftLint#5475
I have an implementation of this feature for Periphery as well, that I'm just working out a few kinks on.
It would be nice to create a baseline feature when legacy warnings are too numbered.
The text was updated successfully, but these errors were encountered: