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

Fix (some) build warnings #1314

Merged
merged 13 commits into from
Aug 11, 2022
Merged

Fix (some) build warnings #1314

merged 13 commits into from
Aug 11, 2022

Conversation

nachmore
Copy link
Contributor

@nachmore nachmore commented Aug 8, 2022

Primarily fixing a bunch of:

  1. CS1572
  2. CS1573
  3. CS0168
  4. CS8073
  5. CA2200
  6. VSTHRD110
  7. VSTHRD200
  8. VSTHRD105
  9. SYSLIB0013
  10. CS8524

Not a comprehensive fix, but removes a large number of warnings.

CS1572
CS1573
CS0168
CS8073
CA2200
VSTHRD110
VSTHRD200
VSTHRD105
SYSLIB0013
CS8524
While it reflects reality it may prevent some launches on systems that
are happily using Flow without hitting specific APIs.
@nachmore
Copy link
Contributor Author

nachmore commented Aug 8, 2022

Before: 400 warnings
After: 161 warnings

@nachmore nachmore changed the title Fix (some) warnings Fix (some) build warnings Aug 8, 2022
Copy link
Member

@taooceros taooceros left a comment

Choose a reason for hiding this comment

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

It's a non-trivial refactor. Thank you so much for taking time to do it!

.editorconfig Show resolved Hide resolved
@@ -127,7 +127,7 @@ public void CreateUninstallerEntry()

using (var portabilityUpdater = NewUpdateManager())
{
portabilityUpdater.CreateUninstallerRegistryEntry();
_ = portabilityUpdater.CreateUninstallerRegistryEntry();
Copy link
Member

Choose a reason for hiding this comment

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

I think we should make CreateUninstallerEntry either async Task or async void. I am curious what this method is doing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

async void needs to be avoided, in fact I want to clean up some of those in the next step if I get a chance.

For this one, it just so happens that Squirrel's function is async, but we're not bothering to call it asynchronously. In fact, nothing in IPortable.cs seems to be async.

I'm happy to create a follow up task for this, but changing the signature of the interface seems like a more invasive task than just removing the warning from the existing flow.

Copy link
Member

Choose a reason for hiding this comment

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

if we didn't await the task, any exception thrown won't be caught. I wonder whether that may create some issue (previously I have been deeply hurt by this suppression).

Flow.Launcher.Core/Plugin/PluginsLoader.cs Show resolved Hide resolved
Flow.Launcher/HotkeyControl.xaml.cs Outdated Show resolved Hide resolved
Plugins/Flow.Launcher.Plugin.Shell/Main.cs Outdated Show resolved Hide resolved
@taooceros
Copy link
Member

@nachmore One of the build test has failed. Would you please take a look on what's causing that?

@nachmore
Copy link
Contributor Author

nachmore commented Aug 8, 2022

I'm looking at this now - it's due to a change in behaviour handling null in json. So much for "just replace X with Y" 😜

See comment inline re:JSON null
@nachmore
Copy link
Contributor Author

nachmore commented Aug 9, 2022

Looking at build mismatch...

@nachmore
Copy link
Contributor Author

nachmore commented Aug 9, 2022

I'm going to pause the warnings elimination work as this PR is large enough already. So when folks have time, can you please review these changes, I'll address comments and then continue in a separate PR. Thanks!

Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs Outdated Show resolved Hide resolved
Flow.Launcher.Core/Plugin/PluginsLoader.cs Outdated Show resolved Hide resolved
Flow.Launcher.Plugin/AllowedLanguage.cs Outdated Show resolved Hide resolved
Flow.Launcher/Helper/SingleInstance.cs Outdated Show resolved Hide resolved
Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs Outdated Show resolved Hide resolved
@@ -540,7 +539,7 @@ internal string LogoUriFromManifest(AppxPackageHelper.IAppxManifestApplication a
if (logoKeyFromVersion.ContainsKey(Package.Version))
{
var key = logoKeyFromVersion[Package.Version];
app.GetStringValue(key, out string logoUri);
_ = app.GetStringValue(key, out string logoUri);
Copy link
Member

Choose a reason for hiding this comment

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

same as above

@nachmore
Copy link
Contributor Author

Down to 118.

Could I please get a review of these changes? I created follow up tasks for some of the fundamental comments that were uncovered during this PR (but not directly related to these changes).

@taooceros
Copy link
Member

Down to 118.

Could I please get a review of these changes? I created follow up tasks for some of the fundamental comments that were uncovered during this PR (but not directly related to these changes).

Sure, just give me sometime.

Copy link
Member

@taooceros taooceros left a comment

Choose a reason for hiding this comment

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

Thank you so much for making such a huge change. There's a small pieces that worth taking a look before merging. After addressing them, I think we shall be able to merge.

Let's wrap this with Task.Run and make the method Async

Main.StartProcess(Process.Start, info);

Flow.Launcher/HotkeyControl.xaml.cs Outdated Show resolved Hide resolved
Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs Outdated Show resolved Hide resolved
@nachmore
Copy link
Contributor Author

Sure, just give me sometime.

Sorry if it sounded like I was rushing you - I am blown away by the speed of CRs in this project, it's incredible! Thank you for the super quick support...

@taooceros
Copy link
Member

Sure, just give me sometime.

Sorry if it sounded like I was rushing you - I am blown away by the speed of CRs in this project, it's incredible! Thank you for the super quick support...

Na you are good. It's always easier for me to review than you writing the code, and it will be super nice to hear feedback quickly when contributing.
Let's finish the remaining trivial stuff and merge this one.

@taooceros
Copy link
Member

Thank you so much for making such a huge change. There's a small pieces that worth taking a look before merging. After addressing them, I think we shall be able to merge.

Let's wrap this with Task.Run and make the method Async

Main.StartProcess(Process.Start, info);

I think this may not be useful and we are ready to merge.

@taooceros taooceros merged commit af7efd8 into Flow-Launcher:dev Aug 11, 2022
@jjw24 jjw24 added the bug Something isn't working label Aug 11, 2022
@jjw24 jjw24 added this to the 1.10.0 milestone Aug 11, 2022
@nachmore nachmore deleted the warnings branch August 11, 2022 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants