Unity-Technologies / ProjectAuditor

Project Auditor is an experimental static analysis tool for Unity Projects.
Other
795 stars 64 forks source link

First draft of ProjectAuditorSettingsProvider #157

Closed borisbauer-unity closed 1 year ago

borisbauer-unity commented 1 year ago

Description

Added the concept of IProjectAuditorSettingsProviderto the ProjectAuditor, a way to stay flexible with platform specific settings provided to analyzers.

Currently only one instance of the default implementation ProjectAuditorPlatformSettingsProvider is provided to the analyzers. It generates an editable ProjectAuditorSettings asset per platform to store the settings and keep them persistent.

Changes made

Notes

The IProjectAuditorSettingsProvider is not used for other providers so far, only the ProjectAuditorPlatformSettingsProvider as a first functional code using settings via this interface.

TODO: Tests shall be added when we are good with the implementation. The TestFixtureBase uses the provider so it would implicitly fail if the provider is null or doesn't provide settings at all (returns a null setting for a given platform).

Checklist

Before review:

TODO: Updating this when getting from draft to PR.

mtrive commented 1 year ago

I think it would be nice to see how the provider is used by modules/analyzers. Would it be possible to update this PR including k_StreamingAssetsFolderSizeLimitMb in the settings?

borisbauer-unity commented 1 year ago

I think it would be nice to see how the provider is used by modules/analyzers. Would it be possible to update this PR including k_StreamingAssetsFolderSizeLimitMb in the settings?

Oh, right, what I did so far is not in PA code/analyzers. And I updated only interface method calls where needed so far (the analyzers that actually use settings). For consistency I could add the provider to all modules calling their analyzers.

First, I'll add the suggested change.