Repository navigation
fix(lint): skip build trees and git-ignored files in check_displayxr_app - #1954
Merged
Merged
Conversation
After a local Gradle build, AGP's externalNativeBuild output (.cxx/) holds the FetchContent'd displayxr-common sources under _deps/, including its tests/. The app linter walked into it and reported false INV-3.1 errors against those test files (cube_handle_vk_android, 2026-10-11). All ten directory walks now share one is_excluded() predicate: the fixed EXCLUDE_DIRS list (extended with .cxx, .externalNativeBuild, .gradle, _deps) plus untracked git-ignored paths from one cached `git ls-files --others --ignored --exclude-standard --directory` per root. Tracked files are never hidden; outside a git work tree (or with no git) the fixed list is the only filter. New hermetic test scripts/tests/test_check_displayxr_app_skip_build_trees.py (wired into lint.yml) covers each build-tree name, a build tree not masking a real error, the vk walker, git-ignored paths, and a tracked file in an ignored dir. Mutation-checked against both halves of the filter. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Symptom
After a local Gradle/CMake build of an Android test app,
scripts/check_displayxr_app.pywalked into AGP's externalNativeBuild output (.cxx/). That output holds the FetchContent'd displayxr-common sources under_deps/, including itstests/. The linter then reported false INV-3.1 errors against displayxr-common's test files. Seen ontest_apps/handle/cube_handle_vk_androidon 2026-10-11 (#1945 work).Fix
iter_source_files, MCP pairing, manual-tracking, views-change, vk discipline, Android, manifests, ...) used the same inlineEXCLUDE_DIRScheck. They now share oneis_excluded(path, root)predicate.EXCLUDE_DIRSgains.cxx,.externalNativeBuild,.gradleand_deps.buildwas already on the list.git ls-files -z --others --ignored --exclude-standard --directorycall per root. Tracked files are never hidden, so a committed source inside an ignored directory is still linted. Outside a git work tree, or with no git, the fixed list is the only filter.Test
scripts/tests/test_check_displayxr_app_skip_build_trees.py, wired intolint.ymlnext to the existing app-linter tests. It covers:src/EXCLUDE_DIRSentries fails 5 cases, and disabling the git-ignore half fails the git case.test_apps/handle/cube_handle_vk_macosandtest_apps/handle/cube_handle_vk_androidis byte-identical tomain. The existing color and vk_frame linter tests still pass.🤖 Generated with Claude Code