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

#441 - Fix exit code 1 if Harmony patching failled #455

Conversation

TonEnfer
Copy link
Contributor

@TonEnfer TonEnfer commented Mar 6, 2024

#441 - Fix exit code 1 if Harmony patching failled - use LogWarning instead LogError

Additionally, the code style has been changed - filescoped namespace, explicit modifiers for better code readability

Context

Checklist

Use LogWarning instead LogError
Change codestyle - filescoped namespace, explicit modifiers for better code readability
Copy link
Contributor

@delatrie delatrie left a comment

Choose a reason for hiding this comment

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

Hi, @TonEnfer! Thank you again for your contribution.

The log level change is solid.
I have mixed feelings about the code style changes, though.

  • File-scope namespaces - awesome! All new language features of C# up through version 10 are welcome.
  • Explicit private modifiers - I personally don't see much value in them, but ok, let's use them.

What bothers me are underscore prefixes. I see some value in prefixing class variables as that helps distinguish between local/class variables (although I'm not a big fan of it either). But I don't particularly like prefixing private functions and camel-casing them for the following considerations:

  • If I call a function from inside the class, I don't care much about whether it is private. From the outside, private functions aren't visible at all, aren't shown by IntelliSense (or other autocompletion tools), and yield the compiler error when called. Prefixes don't help us here in any way. They are more like hacks from the JavaScript world, where you have no visibility modifiers.
  • Tying a function's name to its visibility forces you to make more changes when you change the visibility (unlike class variables, functions' visibility changes more often).
  • We follow Pascal Casing for all functions in the code base (it's pretty standard in the .NET world)

If you have any thoughts about why we should add prefixes to functions, I would gladly read them. Otherwise, please revert the corresponding changes.

Allure.XUnit/AllureXunitPatcher.cs Outdated Show resolved Hide resolved
@TonEnfer TonEnfer requested a review from delatrie March 28, 2024 06:33
@delatrie delatrie added bug type:bug Something isn't working and removed bug labels Mar 28, 2024
Copy link
Contributor

@delatrie delatrie left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@delatrie delatrie merged commit 00a9268 into allure-framework:main Mar 28, 2024
5 of 6 checks passed
@delatrie delatrie linked an issue Apr 1, 2024 that may be closed by this pull request
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:xunit type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allure-xunit: exit code 1 if Harmony patching fails
2 participants