-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
wmllint: asserts if [unit_type]'s advances_to is before the id #4102
Comments
wmllint should really use wmlparser3 or something so it doesn't depend on order of lines. |
I'm wondering if it's a tool to fix, or a tool to just leave as-is. |
I did something similar which I use to validate the ageless preprocessed WML https://github.com/ProditorMagnus/WML_tree_tools/blob/master/py_files/find_patterns.py |
@stevecotton I don't know about wmllint specifically, but in general, time spent on writing lint tools is time well spent. We can make the effort incrementally too, port the wmllint checks to wmlparser3 one by one... |
In general it's difficult to use a proper parser for a tool like wmllint that for example should upgrade old syntax or check macro usage where a parser would perhaps error out or not give you the needed info because macros are already expanded. Using comments as directives as is done now will likely also be very difficult to support. Certainly some checks like this one would benefit from a proper parser though... |
I think it's possible. The parser would need to remember a line number for every syntax element, and the line number that every comment appeared on, but it's not like we have to invent the wheel. Agree with your remark about old syntax / macro usage. |
This was supposed to be a part of the fix for #4102, but for some reason it never got committed.
The code checking the
[unit_type]
data asserts if it meets theadvances_to
before theid
:wesnoth/data/tools/wmllint
Lines 1520 to 1521 in 23ab654
Ageless Era's preprocessed.cfg has all the keys of
[unit_type]
sorted in to alphabetic order, so this triggers on it.The text was updated successfully, but these errors were encountered: