-
Notifications
You must be signed in to change notification settings - Fork 362
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
Design Guidelines #1652
Comments
Hi @guwirth, I really like the guidelines. Some minor comments from my side:
The first sentence goes in the right direction. The wording of the 2nd sentence is not clear to me. We obviously reimplement a parser (preprocessor + lexer + the language grammar). So what you probably mean is something like: We don't aim to check syntax/semantic by means of our parser. Parsing errors shouldn't be reported as technical debt in terms of SonarQube. Am I right?
AFAIK we don't have such feature for the external reports (yet). For the external reports we run in the (hardcoded) strict mode. W.r.t. the source code parsing we run in the tolerant mode by default. I like these defaults - it's easy to parse the external reports, so the strict mode makes sense here. Parsing of the source code is hard, so we should be tolerant to [our own] parsing errors. In my opinion it would be wrong to overload the property Minor: I am not relay sure about the word "tolerant" ("strict mode" vs "tolerant mode"). I would prefer something like "relaxed mode" or "continue-on-error mode" or something better. But that's a matter of taste. |
Think parser and compiler are not the same thing. We read tokens, match it against a grammar and create an AST. We do for example no semantic analysis. The sentence should express somehow that our goal is not to implement a C++ syntax or semantic checker. This is what a compiler is already doing. We also don’t like to create syntax and semantic errors and warnings. This is also what compilers are already doing.
Most sensors are using CxxUtils.validateRecovery |
Better?
|
Thinking about this the question is if we need a flag for the source code? For source code it should always be errorRecoveryEnabled=True. Remove the other case. |
yes, thank you. |
@ivangalkin @Bertk @jmecosta
Please review and complete: https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Design-Guidelines
Like to finish this before we continue with #1638 & #1650.
The text was updated successfully, but these errors were encountered: