Skip to content

fix(lint): skip build trees and git-ignored files in check_displayxr_app - #1954

Merged
dfattal merged 1 commit into
mainfrom
fix/lint-skip-build-trees
Oct 11, 2026
Merged

dfattal merged 1 commit into
mainfrom
fix/lint-skip-build-trees

Conversation

@dfattal

@dfattal dfattal commented Oct 11, 2026

Copy link
Copy Markdown
Collaborator

Symptom

After a local Gradle/CMake build of an Android test app, scripts/check_displayxr_app.py walked into AGP's externalNativeBuild output (.cxx/). That output holds the FetchContent'd displayxr-common sources under _deps/, including its tests/. The linter then reported false INV-3.1 errors against displayxr-common's test files. Seen on test_apps/handle/cube_handle_vk_android on 2026-10-11 (#1945 work).

Fix

  • All ten directory walks in the script (iter_source_files, MCP pairing, manual-tracking, views-change, vk discipline, Android, manifests, ...) used the same inline EXCLUDE_DIRS check. They now share one is_excluded(path, root) predicate.
  • EXCLUDE_DIRS gains .cxx, .externalNativeBuild, .gradle and _deps. build was already on the list.
  • The predicate also skips untracked git-ignored paths: one cached git ls-files -z --others --ignored --exclude-standard --directory call 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

  • New hermetic test scripts/tests/test_check_displayxr_app_skip_build_trees.py, wired into lint.yml next to the existing app-linter tests. It covers:
    • a control case where the offending source does trip INV-3.1 in src/
    • each build-tree name being ignored
    • a build tree that cannot mask a real app error
    • the separate vk-discipline walker
    • the fallback when the root is not in a git repo
    • git-ignored files being skipped
    • a tracked file in an ignored directory still being linted
  • Mutation-checked: removing the new EXCLUDE_DIRS entries fails 5 cases, and disabling the git-ignore half fails the git case.
  • Lint output for test_apps/handle/cube_handle_vk_macos and test_apps/handle/cube_handle_vk_android is byte-identical to main. The existing color and vk_frame linter tests still pass.

🤖 Generated with Claude Code

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>
@dfattal
dfattal requested a review from a team as a code owner October 11, 2026 18:05
@dfattal
dfattal merged commit 9431efc into main Oct 11, 2026
36 checks passed
@dfattal
dfattal deleted the fix/lint-skip-build-trees branch October 11, 2026 19:42
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.

1 participant