-
Notifications
You must be signed in to change notification settings - Fork 68
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
Allow annotations in source code to ignore a check #78
Comments
I will let speak the current maintainer @phosphore - but it's pretty cool to see you here 👍 |
Hello @xntrik and thank you for your feedback! You were right about the need for an eslint-like annotation system, so we pushed it on d41c8c3. For now we only introduced the support for a minimal clone of Ignoring Lines or FilesElectronegativity lets you disable individual checks using const res = eval(safeVariable); /* eng-disable DANGEROUS_FUNCTIONS_JS_CHECK */ <webview src="https://doyensec.com/" enableblinkfeatures="DangerousFeature"></webview> <!-- eng-disable BLINK_FEATURES_HTML_CHECK --> Any shell.openExternal(eval(safeVar)); /* eng-disable OPEN_EXTERNAL_JS_CHECK DANGEROUS_FUNCTIONS_JS_CHECK */ If you put an Excluding specific checksSince this would still leave out GlobalChecks, we also introduced in 1497db6 a new command line flag ( Let me know if we're missing some other similar features, we're always open to new ideas on how to improve this tool! |
Awesome! |
Thank you for working on the |
👋 Hi there! We're integrating electronegativity into https://github.com/hashicorp/boundary-ui. Overall this is very helpful! We're now able to selectively annotate lines that have been manually checked so that they no longer alert us every time. We did run into a few potential issues, all of these use the inline disable flag
|
Hello @randallmorey! Nonetheless, since I recently received similar feedback from the user base (#88, #84, #85) I decided to change approach. Global checks can now be disabled using inline annotations (9079add). I will publish a new version including this change (v1.9.0) by this EOW. |
Is your feature request related to a problem? Please describe.
Due to manual review required checks always being directly unaddressable, we can't run electronegativity in CI without ignoring the return code.
Describe the solution you'd like
When running Electronegativity in CI it'd be great to have a means to ignore particular checks through adding an annotation in the source code, similar to eslint's ignore annotation. https://eslint.org/docs/user-guide/configuring.html#disabling-rules-with-inline-comments
Describe alternatives you've considered
Optionally an
exclude
flag to allow excluding a particular check from the runtime (although this would be global for the entire scan, which isn't ideal)The text was updated successfully, but these errors were encountered: