Repository navigation
fix(conventions): check the whole repository when run from a subdirectory - #4368
Merged
oneandonlydean merged 1 commit intoOct 12, 2026
Conversation
…tory Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
I ran |
Contributor
Author
|
Thanks for checking. For completeness: all 15 |
12 tasks done
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
Two git calls in
tools/check_conventions.pyresolve paths against the current directory. Run from anywhere but the repository root, for example fromtools/or from a build folder aspython3 ../tools/check_conventions.py, the checker gives wrong results without any warning:git ls-tree -rz <head>lists only the current directory's subtree, with paths relative to it. Fromtools/,self.treeholds 30 paths instead of the whole tree. As a result:doc-linkerror;docs/dev/TechnicalDebt.md, so stubs already listed there are reported assilent-stub;repository()see no submodules, so a3rdparty/submodule without a.gitmodulesurl passes, and one outside3rdparty/crashes the check.git grep … -- core/libs/prxsearches<cwd>/core/libs/prx. From a subdirectory it finds nothing, so a realduplicate-exportpasses.ls-treenow gets--full-tree. The grep gets--full-nameand the pathspec:(top)core/libs/prx, so it searches from the top of the repository and prints root-relative paths, which is whatduplicates()parses. With default configuration, the other git calls (diff,show <rev>:<path>,log,config --blob) already work from any directory. CI runs from the repository root, where the output does not change.Tested
Ubuntu 24.04, Python 3.12.3, git 2.43:
tools/testsfiles pass, including 32 tests intest_check_conventions_comments.py. The newtest_checks_from_a_subdirectory_see_the_whole_repositorycommits two libraries that define the same export, plus a document that links intocore/, and runs the check fromtools/. It expects only theduplicate-exportfinding. With main's checker the test fails: it reports a falsedoc-linkand misses the duplicate.--base <c>^1 --head <c>):tools/than from the root.tools/matches the root for all 40.tools/:0f6205aa3(feat: boot PPSA04263 with its own sce_module, into the story mode load (supersedes #144) #153): from the root, main's checker reports 5duplicate-exporterrors; fromtools/it reports none of them.6731a610e(fix(libSceNpTrophy2): return success from sceNpTrophy2ShowTrophyList #3470, the stray3rdparty/imguigitlink): the root reports thesystem-dependencyerror. Fromtools/, main's checker reports a falsedoc-linkand a falsesilent-stubinstead.tools/check_conventions.pyfrom main passes with this title and body.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Generated with Claude Code