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

[ENHANCEMENT] option to not exit with a non-zero exit code on specific error levels #358

Open
DetachHead opened this issue Nov 25, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@DetachHead
Copy link
Contributor

Is your enhancement request related to a problem? Please describe.
i would like to have robotcode report hints/information in vscode, without having them fail in my CI. with other tools eg. typescript, diagnostics that are reported as hint or information do not cause the CLI to fail, as they are only intended to be information rather than a problem that needs to be fixed

Describe the solution you'd like
an option to only fail on certain error levels and above. something like:

[tool.robotcode-analyze]
fail_on = "warning"

this would mean that only diagnostics reported as a warning or above (error) will cause a non-zero exit code

@DetachHead DetachHead added the enhancement New feature or request label Nov 25, 2024
@d-biehl
Copy link
Member

d-biehl commented Dec 8, 2024

I am not sure....

In my opinion, there should be no errors, warnings, or other issues in your CI pipeline when checking for code quality. If there are warnings, hints, or informational messages, they should be addressed by either fixing the underlying issue or explicitly modifying the diagnostics at the source code level using a directive like # robotcode ignore[WhateverCode]. Additionally, always include a comment explaining why the message is being ignored to maintain clarity and accountability. For cases where specific warnings, hints, or informational messages are deemed acceptable, you can also configure the command line to ignore them. This ensures consistency between local development and CI results.

How do you call robotcode in your CI? Is it maybe possible to make a bitwise comparsion on the result code? As you may know the return code is a bitwise combination of the following values:

  • 0: SUCCESS - No issues detected.
  • 1: ERRORS - Critical issues found.
  • 2: WARNINGS - Non-critical issues detected.
  • 4: INFORMATIONS - General information messages.
  • 8: HINTS - Suggestions or improvements.

@DetachHead
Copy link
Contributor Author

In my opinion, there should be no errors, warnings, or other issues in your CI pipeline when checking for code quality. If there are warnings, hints, or informational messages, they should be addressed by either fixing the underlying issue or explicitly modifying the diagnostics at the source code level using a directive like # robotcode ignore[WhateverCode]. Additionally, always include a comment explaining why the message is being ignored to maintain clarity and accountability. For cases where specific warnings, hints, or informational messages are deemed acceptable, you can also configure the command line to ignore them. This ensures consistency between local development and CI results.

i totally agree with this. in fact its a relief that someone else feels the same way as i do. i hate how most other tools will pass by default when warnings are reported.

however in my opinion there are still use cases to have certain diagnostic categories not fail in CI eg. "information" and "hint", which often aren't always used to report a problem that has to be fixed but rather to present some information to the user in their IDE (eg. something is deprecated but you don't want all existing usages in old code to cause CI to fail). for this reason i believe the current behavior in robotcode to fail on all diagnostic severities is a good default, but it ideally would be configurable such that users can deviate from this functionality if desired

How do you call robotcode in your CI? Is it maybe possible to make a bitwise comparsion on the result code? As you may know the return code is a bitwise combination of the following values

i just run robotcode analyze code. i'd rather not have to add complexity to our CI by doing this, so instead i will probably just completely disable the hint diagnostics, since i don't consider those rules very important for our project which is why i kept them as hints in the first place

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants