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

Validation options should be checked even if generateValidation is set to false #38

Open
alexander-yevsyukov opened this issue Mar 9, 2021 · 0 comments

Comments

@alexander-yevsyukov
Copy link
Collaborator

alexander-yevsyukov commented Mar 9, 2021

Before version 2.0.0-SNAPSHOT.2 we used to have integration test data declared like shown below:

// A message with a value that has a malformed range.
message IllegalRanges {
    double value = 1 [(range) = "{0.6..4.2}"];
}

// A malformed range expression, the range is not closed (as in the right edge is omitted).
message UpToInfinity {

    int32 value = 1 [(range) = "[0.."];
}

// A malformed range expression, the range is unopened (as in the left edge is omitted).
message Unopened {
    int32 value = 1 [(range) = "..2)"];
}

message MinorCitizen {

    // Malformed range - the value the field is `int32` - whole number,
    // while the value of the left range edge is a floating point number.
    int32 age = 1 [(range) = "(0..18.01)"];
}

message Constitution {
    // This should break the compilation because `repeated` is missing.
    string amendments = 1 [(distinct) = true];
}

message Constitution {
    // This should break the compilation because `repeated` is missing.
    string amendments = 1 [(distinct) = true];
}

It was under the smoke-tests/validation sub-project. This project had generation of validation code turned off.
Because of this tests pass. Turning validation on via the following code...

modelCompiler {
    generateValidation = true
}

... rightfully breaks the compilation.

The problem is that it should break the compilation even if generation of the validation code is turned off, because we do not want to keep a malformed code. Delaying the discovery of compilation errors to a later date, when validation is wanted, is a bad idea.

@alexander-yevsyukov alexander-yevsyukov added the bug Something isn't working label Mar 9, 2021
@alexander-yevsyukov alexander-yevsyukov transferred this issue from SpineEventEngine/base Sep 21, 2022
@armiol armiol moved this to 📋 Backlog in v2.0 Jun 9, 2023
@alexander-yevsyukov alexander-yevsyukov removed the bug Something isn't working label Dec 9, 2024
@alexander-yevsyukov alexander-yevsyukov moved this to 📋 Backlog in v2.2 Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant