Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Baseline #710

Open
aiKrice opened this issue Jan 28, 2024 · 2 comments
Open

Create a Baseline #710

aiKrice opened this issue Jan 28, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@aiKrice
Copy link

aiKrice commented Jan 28, 2024

It would be nice to create a baseline feature when legacy warnings are too numbered.

@amleszk
Copy link

amleszk commented Feb 14, 2024

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

@ileitch ileitch added the enhancement New feature or request label Apr 29, 2024
@mildm8nnered
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants