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

False Negative mandatory-version Warning #207

Open
volodya-lombrozo opened this issue Jan 9, 2025 · 8 comments
Open

False Negative mandatory-version Warning #207

volodya-lombrozo opened this issue Jan 9, 2025 · 8 comments

Comments

@volodya-lombrozo
Copy link
Member

I'm getting the following warning when I check my xmir:

XMIR is incorrect: [[mandatory-version WARNING]:0 The +version meta is mandatory, but is absent

but I have the version:

<program xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         dob="2023-03-19T00:00:00"
         ms="0"
         name="j$MethodByte"
         revision="1234567"
         time="2025-01-09T08:43:15.990916Z"
         version="1.2.3">
...

There is how I check the xmir:

final Collection < Defect > defects = new Program(new StrictXmir(this.doc)).defects()
    .stream()
    .collect(Collectors.toList());
if (!defects.isEmpty()) {
    throw new IllegalStateException(
        String.format(
            "XMIR is incorrect: %s, %n%s%n",
            defects,
            this.doc
        )
    );
}

Full xmir:
MethodByte.xmir.txt

Please, fix the check.

@volodya-lombrozo
Copy link
Member Author

Blocks: objectionary/jeo-maven-plugin#946

@volodya-lombrozo
Copy link
Member Author

@yegor256 Could you have a look, please?

@yegor256
Copy link
Member

yegor256 commented Jan 9, 2025

@volodya-lombrozo this warning is not about /xmir/@version, but about meta that is supposed to be in the <metas>:

<xmir>
  <metas>
    <meta>
      <head>+version</head>
      <tail>0.0.0</tail>
    </meta>
  </metas>
</xmir>

@volodya-lombrozo
Copy link
Member Author

@yegor256 I believe it should be mentioned in the error message, otherwise even if I close this ticket, somebody else will rise it again very soon. What do you think?

@h1alexbel
Copy link
Contributor

@yegor256 @volodya-lombrozo besides the error messages, we also have motive-s that explain lints and provide examples. I believe we should make them accessible, and link them to produced error messages. WDYT?

@volodya-lombrozo
Copy link
Member Author

@h1alexbel Would be nice

@volodya-lombrozo
Copy link
Member Author

@volodya-lombrozo this warning is not about /xmir/@version, but about meta that is supposed to be in the <metas>:

<xmir>
  <metas>
    <meta>
      <head>+version</head>
      <tail>0.0.0</tail>
    </meta>
  </metas>
</xmir>

@yegor256 I'm getting this for you code example:

cvc-pattern-valid: Value '+version' is not facet-valid with respect to pattern '[a-z]+[a-z0-9]*' for type '#AnonType_headmeta'.
  cvc-type.3.1.3: The value '+version' of element 'head' is not valid.

This is one more prove that highlights the fact that we need proper accessible documentation with examples.

@yegor256
Copy link
Member

@volodya-lombrozo it's a typo, should be:

<xmir>
  <metas>
    <meta>
      <head>version</head>
      <tail>0.0.0</tail>
    </meta>
  </metas>
</xmir>

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

No branches or pull requests

3 participants