Repository navigation
dmsh_entry.py: fix the two lint findings that fail lint-python on main - #2395
Open
SanteeMarcel wants to merge 1 commit into
Open
SanteeMarcel wants to merge 1 commit into
SanteeMarcel wants to merge 1 commit into
Conversation
…h_fetch import that e45694b left unused is gone, and the float-bits walk that ccd834e added skips a missing match that all(bits) already ruled out, so pyright sees the match is not None lint_python.py found two new findings on main, both in dmsh_entry.py: ruff F401 (`dmsh_fetch` imported but unused: its one use, dmsh_fetch.unguard, went with e45694b) and pyright reportOptionalSubscript at kinds' `b[1]` (re.fullmatch returns Optional, and all(bits) does not narrow the list's items). Every pull request's lint-python job failed on them. Now the import is `import dmsh_side` and the generator is `for b in bits if b`, a filter that is always true there. dmsh_entry.py is in dmsh_chain.FILES, so the chain version moves: d24f05cf9d78 → dce4e9cb5054 (dmsh_chain.py --header), and each game's shaders are rebuilt at its next build, with the same MSL. Checked: lint_python.py --against main with the pinned ruff 0.17.2 and pyright 1.1.414 (321 findings, all in the baseline, 0 new); test_nsp_chain, test_dmsh_code_fp, test_shader_rewrites, test_dmsh_layer_out, test_dmsh_abi, test_dmsh_meshstage, test_discard, test_dmsh_geometry, test_dmsh_blend_zero, test_usage. Not run: test_dmsh_fetch, test_dmsh_pairs and test_pso_offline need xcrun (they fail the same way on main on Linux), a shader build, regress.py (no output changes: one import, one filter that is always true)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
lint-pythonfails onmain, and so on every pull request, with two new findings, both indm/gfx/tools/dmsh_entry.py:dmsh_fetch.unguard, was removed in e45694b. The import is nowimport dmsh_side.bitsis a list ofre.fullmatchresults, andall(bits)doesn't narrow its items for pyright. The generator is nowfor b in bits if b. The filter is always true at that point, so the output doesn't change.Shader chain
dmsh_entry.pyis indmsh_chain.FILES, so the chain version moves fromd24f05cf9d78todce4e9cb5054(dmsh_chain.py --header, committed). Each game's shaders rebuild at its next build, and the MSL comes out the same. If you'd rather fold this into your next chain change to avoid a separate rebuild, feel free to close this.Checked
lint_python.py --against mainwith the pinned ruff 0.17.2 and pyright 1.1.414: 321 findings, all in the baseline, 0 newtest_nsp_chain,test_dmsh_code_fp,test_shader_rewrites,test_dmsh_layer_out,test_dmsh_abi,test_dmsh_meshstage,test_discard,test_dmsh_geometry,test_dmsh_blend_zero,test_usageNot run
test_dmsh_fetch,test_dmsh_pairs,test_pso_offline: they needxcrun, and fail the same way on unmodifiedmainon Linuxregress.py: no output changes (one import removed, one always-true filter)