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

Improve warning message for unrecognized target parameters #964

Merged
merged 2 commits into from
Feb 15, 2022

Conversation

cmnrd
Copy link
Collaborator

@cmnrd cmnrd commented Feb 14, 2022

Currently, this is printed if a target parameter is not recognized:

 Unrecognized target parameter: ros. Recognized parameters are: BUILD, BUILD_TYPE, CLOCK_SYNC, CLOCK_SYNC_OPTIONS, CMAKE_INCLUDE, CMAKE, COMPILER, DOCKER, EXTERNAL_RUNTIME_PATH, FAST, FILES, FLAGS, COORDINATION, COORDINATION_OPTIONS, KEEPALIVE, LOGGING, NO_COMPILE, NO_RUNTIME_VALIDATION, PROTOBUFS, ROS2, RUNTIME_VERSION, SINGLE_FILE_PROJECT, THREADS, TIMEOUT, TRACING, EXPORT_DEPENDENCY_GAPH, EXPORT_TO_YAML, RUST_INCLUDE, CARGO_FEATURES, CARGO_DEPENDENCIES.

With this change, the actual parameter names are printed in alphabetical order:

Unrecognized target parameter: ros. Recognized parameters are: build build-type cargo-dependencies cargo-features clock-sync clock-sync-options cmake cmake-include compiler coordination coordination-options docker export-dependency-graph export-to-yaml external-runtime-path fast files flags keepalive logging no-compile no-runtime-validation protobufs ros2 runtime-version rust-include single-file-project threads timeout tracing

Currently this is printed:

```
 Unrecognized target parameter: ros. Recognized parameters are: BUILD, BUILD_TYPE, CLOCK_SYNC, CLOCK_SYNC_OPTIONS, CMAKE_INCLUDE, CMAKE, COMPILER, DOCKER, EXTERNAL_RUNTIME_PATH, FAST, FILES, FLAGS, COORDINATION, COORDINATION_OPTIONS, KEEPALIVE, LOGGING, NO_COMPILE, NO_RUNTIME_VALIDATION, PROTOBUFS, ROS2, RUNTIME_VERSION, SINGLE_FILE_PROJECT, THREADS, TIMEOUT, TRACING, EXPORT_DEPENDENCY_GAPH, EXPORT_TO_YAML, RUST_INCLUDE, CARGO_FEATURES, CARGO_DEPENDENCIES.
```

With this change, the actual parameter names are printed in alphabetical order:

```
Unrecognized target parameter: ros. Recognized parameters are: build build-type cargo-dependencies cargo-features clock-sync clock-sync-options cmake cmake-include compiler coordination coordination-options docker export-dependency-graph export-to-yaml external-runtime-path fast files flags keepalive logging no-compile no-runtime-validation protobufs ros2 runtime-version rust-include single-file-project threads timeout tracing
```
@cmnrd cmnrd requested review from edwardalee and lhstrh February 14, 2022 13:07
Copy link
Collaborator

@edwardalee edwardalee 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 to me! Thanks for doing this.

Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

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

Definitely an improvement! I would separate the items using comma's, however.

org.lflang/src/org/lflang/validation/LFValidator.java Outdated Show resolved Hide resolved
Co-authored-by: Marten Lohstroh <marten@berkeley.edu>
@cmnrd cmnrd merged commit eb3b598 into master Feb 15, 2022
@cmnrd cmnrd deleted the validator-target-params branch February 15, 2022 10:22
@lhstrh lhstrh added the enhancement Enhancement of existing feature label Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants