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

chore: handle include globs #553

Merged
merged 6 commits into from
May 15, 2024
Merged

Conversation

dnedrow
Copy link
Contributor

@dnedrow dnedrow commented Jan 4, 2024

This update introduces a mechanism that handles the globs specified in the source_files configuration.

  • It adds new functionality to include source files matching the specified glob patterns and allows the configuration of these source files. Files not matching a glob defined in source_files are excluded.
  • Additionally, it refactors the ignored file code in the profdata_coverage_file class to streamline the condition checks.

At it's most basic, the file is checked to see if it's ignore and, if it isn't and there are source_files defined, tested to see if it should be included in the scan.

This update introduces a mechanism that handles the globs specified in the source_files configuration.

* It adds a new functionality to include source files matching the specified glob patterns and allows the configuration of these source files.

*Additionally, it refactors the ignored file code in the profdata_coverage_file class to streamline the condition checks.

At it's most basic, the file is checked to see if it's ignore and, if it isn't and there are source_files defined, tested to see if it should be included in the scan.
end
return true if path.end_with?("isn't covered.")
return true if path.include?("/Xcode.*\.app\/Contents\/Developer\/Platforms")
return true if path.include?("/SourcePackages/checkouts")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add these two new paths here? If the user adds something to the include list, will that override this ignore?
Ignoring upstream dependencies should probably be up to the developer adding them to the ignore list and not a default here since many different dependency managers exist and will do this in different ways in different folders.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point. I debated with myself over this. I have no problem removing them.

No, ignore overrides source-files. My thought being that it's probably more desirable to be able to define the source-file glob(s) in the config and then winnow out anything that you want ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jarrodlombardo-EventBase I did update this to remove the exclusion of /SourcePackages/checkouts, though I left the platform exclusion in place. I can't imagine a scenario in which someone would want to slather something Platforms.

I can remove that as well if you really want, but I think the expected behavior that most people would assume is that SDK files are not slathered.

* Removing these paths based on comments.

It does make more sense to allow the individual user to define these in the config.
Copy link
Contributor

@jarrodlombardo-EventBase jarrodlombardo-EventBase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm.

@dnedrow dnedrow marked this pull request as ready for review January 4, 2024 20:39
@dnedrow dnedrow marked this pull request as draft January 4, 2024 21:38
David Nedrow added 2 commits January 4, 2024 17:06
* Use 'source_files_list' instead of 'source_files'
* Remove unnecessary console output
* The README has also been updated with additional usage notes.
* Minor spelling update
@dnedrow dnedrow marked this pull request as ready for review March 20, 2024 20:47
@dnedrow
Copy link
Contributor Author

dnedrow commented May 10, 2024

@jarrodlombardo-EventBase can you merge this PR? I don't have the mojo.

@dnedrow
Copy link
Contributor Author

dnedrow commented May 13, 2024

@ksuther Can you merge this PR, pretty please?

@ksuther ksuther merged commit aaab26c into SlatherOrg:master May 15, 2024
@jarrodlombardo-EventBase
Copy link
Contributor

@jarrodlombardo-EventBase can you merge this PR? I don't have the mojo.

I also don't have those permissions. Thankfully Kent took care of it. :)

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.

3 participants