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

[hl] add -D hl_w_null_compare #11640

Merged
merged 2 commits into from Apr 25, 2024

Conversation

yuxiaomao
Copy link
Contributor

@yuxiaomao yuxiaomao commented Apr 22, 2024

I'm trying to add a new flag -D hl_w_null_compare which will gives a warning where we have done null comparison instead of implicitly convert to 0. It can help existing hl code check theirs comparison before moving to the newer version. Related commits:

This code works correctly during the build, however, when running inside VSCode and open the file from the "PROBLEMS" section after build, the warning disappear after a small delay (probably some rebuild on the specific file happens). It does not impact all files, at least not std files.
@kLabz du you have any idea on how to prevent the warning been removed?

@kLabz
Copy link
Contributor

kLabz commented Apr 23, 2024

Other than disabling diagnostics, probably no way atm since the warning comes from generator so won't happen in diagnostics :/

@yuxiaomao
Copy link
Contributor Author

Thanks for pointing out the diagnostics feature! I did not know it before. My PR is only a tool for upgrading new haxe version, disable temporary diagnostics is totally acceptable. So for now I have this:
"haxe.enableDiagnostics": false in settings.json
-D hl_w_null_compare in build.hxml

I'll check with the dev team to see if this fit theirs need

@yuxiaomao yuxiaomao marked this pull request as ready for review April 23, 2024 08:52
@yuxiaomao
Copy link
Contributor Author

No one says no, so I'll merge it!

@yuxiaomao yuxiaomao merged commit 0f4f6b5 into HaxeFoundation:development Apr 25, 2024
50 checks passed
@yuxiaomao yuxiaomao deleted the dev-hl-w-null-compare branch April 25, 2024 07:10
@kLabz
Copy link
Contributor

kLabz commented Apr 25, 2024

Not sure we'll want to keep it as is for long, since warnings in generators should be avoided as much as possible :/

@yuxiaomao
Copy link
Contributor Author

I think it's an interesting tools for other hl project pass to haxe 5.0 - It can be a warning before generator but I don't think other target are concerned in this specific case?
Note: This commit can be revert safely.

@skial skial mentioned this pull request Apr 29, 2024
1 task
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

Successfully merging this pull request may close these issues.

None yet

2 participants