Repository navigation
lint: discover projects instead of listing them - #50
Merged
Merged
Conversation
scripts/lint.ps1 kept the project layout in hand-maintained lists - the compile-database paths, a file glob per project, the databases loaded for cache keys, the .clang-tidy configs and the vendored header trees - and build.ps1's fix target kept another copy. The lists had drifted: - services was missing from the databases loaded for cache keys, so its files were never dependency-scanned and were re-linted on every run; - the V8 fingerprint pointed at dependencies\v8\include, which no longer exists, so a V8 header change never invalidated the cache; - fix did not cover the tests. Everything is now derived from the projects themselves: - every .vcxproj under src\ and tests\ is a project, linted on Win32 when it has a Win32 configuration and otherwise on the platform it has; a stale or missing database regenerates each platform that needs it; - the files linted and their commands come from each project's own compile database, a shared source going to the project that holds it (the same 119 files as before); - project headers are anything inside a project directory; every include directory outside one (V8, D2MOO, the vcpkg install) is fingerprinted into the environment token, as is every .clang-tidy and vcpkg.json; - build.ps1 fix runs lint.ps1 -Fix over the same file set. The dependency scan also attributed each rule to the first .cpp path it named, so a unit whose main file is a header was never cached. Rules are now matched against the files that were scanned. Co-Authored-By: Claude Opus 5.5 (1M context) <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.
scripts/lint.ps1kept the project layout in hand-maintained lists (compile-database paths, a file glob per project, the databases loaded for cache keys, the.clang-tidyconfigs, the vendored header trees), andbuild.ps1 fixkept another copy. They had drifted:dependencies\v8\include, which no longer exists.fixskipped the tests.This derives everything from the projects instead:
.vcxprojundersrc\andtests\. Each is linted on Win32 when it has a Win32 configuration, otherwise on the platform it has. A missing or stale compile database regenerates each platform that needs it.Pathfinder.cpp) is linted once, with the project whose directory holds it. That is the same 119 files as before..clang-tidyandvcpkg.json. None of those trees is linted; they only invalidate the cache.build.ps1 fix: runslint.ps1 -Fixover the same file set.It also fixes header caching. The dependency scan attributed each rule to the first
.cpppath it named, so a unit whose main file is a header was never cached. Rules are now matched against the files that were scanned.Adding a project (a second backend, another glue DLL) now needs no lint changes.
Testing
services/update/UpdateChecker.hre-linted exactly the 3 files that include it; the other 116 came from the cache.build.ps1 fix: discovers the same files and applies fixes. I stopped the smoke test after a few files; nothing changed.🤖 Generated with Claude Code