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

"Did you mean...?" (make config errors more helpful) #1269

Merged
merged 4 commits into from
Apr 28, 2021

Conversation

pcarruscag
Copy link
Member

Proposed Changes

suggest an alternative for unrecognized options
list the enum alternatives when an invalid one is used

@@ -2862,34 +2860,61 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){
if (!option_name.compare("RELAXATION_FACTOR_ADJFLOW"))
newString.append("Option RELAXATION_FACTOR_ADJFLOW is now RELAXATION_FACTOR_ADJOINT, "
"and it also applies to discrete adjoint problems.\n\n");
if (!option_name.compare("WRT_MESH_QUALITY"))
else if (!option_name.compare("WRT_MESH_QUALITY"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't this prevent multiple warnings from being printed? Not sure if that's the point (or Im misunderstanding).

Copy link
Member Author

Choose a reason for hiding this comment

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

No, those checks for deprecated options were already mutually exclusive.
You get multiple messages from the outer loop over all options in the config, and so you will also get multiple "did you mean?"s if you misspell more than one option.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh I missed the outer loop. Thanks.

Copy link
Contributor

@WallyMaier WallyMaier left a comment

Choose a reason for hiding this comment

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

This looks good to me! Thanks for updating, should be way more user friendly now.

@pcarruscag pcarruscag merged commit 8d469a7 into develop Apr 28, 2021
@pcarruscag pcarruscag deleted the feature_did_you_mean branch April 28, 2021 17:57
}
if (Kind_SU2 == SU2_COMPONENT::SU2_CFD) {
SU2_MPI::Error(string("SU2_CFD: Config option DIRECT_DIFF= YES requires AD or complex support!\n") +
string("Please use SU2_CFD_DIRECTDIFF (configuration/compilation is done using the preconfigure.py script)."),
Copy link
Contributor

Choose a reason for hiding this comment

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

please make this meson.py in #1272

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants