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

Exclude LC0052 and LC0053 on procedure which implements an interface #572

Merged
merged 1 commit into from
Mar 30, 2024

Conversation

Arthurvdv
Copy link
Collaborator

No description provided.

@Arthurvdv Arthurvdv merged commit 91b0979 into prerelease Mar 30, 2024
@Arthurvdv Arthurvdv linked an issue Mar 30, 2024 that may be closed by this pull request
public MethodSymbolAnalyzer(CompilationAnalysisContext compilationAnalysisContext)
{
NavAppManifest manifest = ManifestHelper.GetManifest(compilationAnalysisContext.Compilation);

if (manifest.InternalsVisibleTo != null && manifest.InternalsVisibleTo.Any())
{
Copy link
Contributor

Choose a reason for hiding this comment

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

I am surprised to see the curly brackets getting removed though (and all the non-redundant whitespace) 😮
It is good practice to have curly brackets in C# even if there is only a single statement.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As a novice level C# developer I though I was improving readability of the code by removing the curly brackets.

I thought if it is a one liner, the code is cleaner to have it without curly braces. Even maybe put it in one nice and short line. After all, C# compiler allows it, who am I to disagree with that? Boy, was I wrong 😯

https://www.armannotes.com/2020/11/23/why-you-should-always-use-curly-braces-for-single-statement-blocks-in-csharp/

@rvanbekkum, I genuinely appreciate you feedback on this. I've learned why you should always use curly braces for single statement blocks in C#. I'll revert these changes with a new PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I suspect it wouldn't be as much of a problem with C# if it would always apply a formatter automatically like what happens for AL code. 🙂

Arthurvdv added a commit that referenced this pull request Apr 3, 2024
…OnRule0052

Exclude LC0052 and LC0053 on procedure which implements an interface #572
@Arthurvdv Arthurvdv deleted the Rule0053And0053InterfacesOnCodeunit branch April 6, 2024 18:57
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.

LC0052 interfaces
2 participants