-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Update CSharpier to 0.30.3 #2912
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with two comments. I'm fine with merging; just wanted to leave some opinions.
Reviewed 93 of 93 files at r1.
Reviewable status: 92 of 93 files reviewed, 5 unresolved discussions (waiting on @pmachapman)
src/SIL.XForge/DataAccess/MemoryRepository.cs
line 171 at r1 (raw file):
public Task<int> DeleteAllAsync(Expression<Func<T, bool>> filter) { T[] entities = Query().Where(filter).ToArray();
Personally I think a method like ToArray()
makes a lot more sense than using a spread operator because it's easier to follow a chain of methods, than syntax that alternates between chaining and whatever the opposite of chaining is (I consider a().b().c()
to b easier to follow than c(b(a()))
).
src/SIL.XForge.Scripture/Services/ParatextService.cs
line 285 at r1 (raw file):
using ScrText scrText = ScrTextCollection.FindById(username, paratextId) ?? throw new Exception(
I'm not sure the x = y() ?? throw new Z()
pattern is a good idea...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 92 of 93 files reviewed, 5 unresolved discussions (waiting on @Github-advanced-security[bot] and @Nateowami)
src/SIL.XForge/DataAccess/MemoryRepository.cs
line 171 at r1 (raw file):
Previously, Nateowami wrote…
Personally I think a method like
ToArray()
makes a lot more sense than using a spread operator because it's easier to follow a chain of methods, than syntax that alternates between chaining and whatever the opposite of chaining is (I considera().b().c()
to b easier to follow thanc(b(a()))
).
Yeah I was initially hostile to it, but since TypeScript uses the similar [...otherArray]
, it has grown on me.
src/SIL.XForge.Scripture/Services/ParatextService.cs
line 285 at r1 (raw file):
Previously, Nateowami wrote…
I'm not sure the
x = y() ?? throw new Z()
pattern is a good idea...
Yeah that was unexpected from dotnet format
.
I believe it is more efficient in the generated MSIL code, as is it ensures that the finally { scrText.Dispose(); }
which the using
does in the background is not executed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dismissed @Github-advanced-security[bot] from 3 discussions.
Reviewable status: 91 of 93 files reviewed, 2 unresolved discussions (waiting on @Nateowami)
This PR:
dotnet format
If have broken these changes into separate commits in case you think collection expressions are a bad idea and I need to revert it (I personally prefer the syntax and use it when updating code or writing new code).
I figure now is the best time for a change like this, as a major update to the C# code base (SF-2900) has been merged.
This change is