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

object-does-not-match-filename lints prints incorrect filename #296

Closed
maxonfjvipon opened this issue Feb 1, 2025 · 14 comments
Closed

object-does-not-match-filename lints prints incorrect filename #296

maxonfjvipon opened this issue Feb 1, 2025 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@maxonfjvipon
Copy link
Member

If /program/@name is foo.x.main and /program/objects/o[1]/@name is main and /program/metas/meta[head='package']/tail is f, which is:

+package f

[] > main

Then I see in log: Object "main" does not match with filename "".

So the /program/@name is not printed correctly if it does not have the same prefix as +package alias

@maxonfjvipon maxonfjvipon added the bug Something isn't working label Feb 1, 2025
@h1alexbel
Copy link
Contributor

@maxonfjvipon assign me, please

h1alexbel added a commit to h1alexbel/lints that referenced this issue Feb 2, 2025
@h1alexbel
Copy link
Contributor

@maxonfjvipon in this case, I think main (object name) should be equal to main (from program name). However, in the following example (with the same program name: foo.x.main):

+package f

[] > foo

we should report the warning, since foo does not match with main. Am I correct?

@maxonfjvipon
Copy link
Member Author

maxonfjvipon commented Feb 2, 2025

@h1alexbel when the program name is foo.x.main it means that the object main must have parent x, which must have parent foo. That all means that object main must be in package foo.x. That all again means that there must be a file foo/x/main.xmir. But in my example we have object main in package f. So it fails correctly, but it does not print program name correctly

@h1alexbel
Copy link
Contributor

@maxonfjvipon I think we should compare only the filename in this lint, so in foo.x.main, main is the filename. In the reported case we should not fail, since object name main equals to the filename main. WDYT?

@maxonfjvipon
Copy link
Member Author

@h1alexbel this is the original ticket and yes, there's no any word about package.
Then we should decide if this lint should compare

  1. full /program/@name with (package + object name) or just
  2. last part of /program/@name (for example main from foo.x.main) with just object name

@yegor256 WDYT?

@yegor256
Copy link
Member

yegor256 commented Feb 3, 2025

@maxonfjvipon I believe, the @name in the /program must be equal to package + object name

@maxonfjvipon
Copy link
Member Author

@h1alexbel see above, let's fix it

h1alexbel added a commit to h1alexbel/lints that referenced this issue Feb 3, 2025
yegor256 added a commit that referenced this issue Feb 4, 2025
bug(#296): compare `/program/@name` with packaged object path
@h1alexbel
Copy link
Contributor

@yegor256 should we make a new release?

@yegor256
Copy link
Member

yegor256 commented Feb 4, 2025

@rultor release, tag is 0.0.37

@rultor
Copy link
Contributor

rultor commented Feb 4, 2025

@rultor release, tag is 0.0.37

@yegor256 OK, I will release it now. Please check the progress here.

@rultor
Copy link
Contributor

rultor commented Feb 4, 2025

@rultor release, tag is 0.0.37

@yegor256 Done! FYI, the full log is here (took me 16min).

@h1alexbel
Copy link
Contributor

@maxonfjvipon the problem should be fixed, try again with new version, please

@h1alexbel
Copy link
Contributor

@maxonfjvipon still an issue?

@maxonfjvipon
Copy link
Member Author

@h1alexbel no, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants