You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #34804 the locale linter tripped over a missing LC_ALL in libmultiprocess. That was trivial to fix, and perhaps a good thing, but it raised the question to what extend we should be linting subtrees: bitcoin-core/libmultiprocess#265 (comment)
Currently it's rather inconsistent; each linter has their own list of subtree exceptions, which doesn't include some old libraries (e.g. crc32c) and misses some new ones (e.g. libmultiprocess).
Should we make one list and exclude it from all linters? Or do we strive to keep the same code style in subtrees and make exceptions only as needed?
So if a linter is missing those, it should be added.
In any case, libmultiprocess is probably written in the same C++ that Bitcoin Core is written in, so it could make sense to apply some of the linters there.
I agree with Marco it's nice for these lint checks to apply. The thing that's not ideal is just the way the checks are currently applied because they aren't performed until the subtree is updated. One way to improve this might be to extend bitcoin-core/libmultiprocess#253 to run the Bitcoin core lint job in addition to other jobs when libmultiprocess prs are opened to provide earlier feedback. (It could also be good to make Bitcoin core CI code more modular so the checks could be easier to reuse and probably easier to maintain.)
I did a small audit of current master to check what still seems open here.
There are already shared subtree lists in both lint stacks:
Python: test/lint/lint_ignore_dirs.py has SHARED_EXCLUDED_SUBTREES
Rust lint runner: test/lint/test_runner/src/util.rs has get_subtrees() / get_pathspecs_default_excludes()
A number of checks already consume these lists, for example lint-locale-dependence.py, lint-includes.py, lint-include-guards.py, and the Rust lint-runner checks that use the default excludes.
The part that still seems inconsistent is the older Python linters with local or ad hoc subtree filtering. In particular, lint-shell-locale.py still scans all *.sh files and only skips src/(secp256k1|minisketch)/, so it still applies to the src/ipc/libmultiprocess/ci/scripts/*.sh files. Current master passes because bitcoin-core/libmultiprocess#265 added the expected LC_ALL lines, but the check is still being applied to that subtree.
So I think the remaining issue is probably narrower than "create one list": the shared lists exist, but some Python linters still bypass them or maintain separate exclusion logic. A small follow-up could move the ad hoc subtree filtering to SHARED_EXCLUDED_SUBTREES, while leaving explicit opt-ins for checks maintainers want to keep applying to a compatible subtree like libmultiprocess.
That would make the policy clearer:
subtree paths
|
+-- default: excluded through one shared list
|
+-- opt-in: individual linters intentionally include a subtree
when that check is useful there
I am interested in finishing the remaining work for this issue by completing the small follow up mentioned, @savagemechanic. Let me know if this issue is still outstanding or if there is any other work associated with completing it.
I compared the current regex, a corrected version that matches only the three listed subtrees that uses ( ) instead of [ ], and the existing SHARED_EXCLUDED_SUBTREES list against the 61 tracked .sh files.
Implementation
Excluded
Checked
Current regex
10
51
Corrected regex
5
56
SHARED_EXCLUDED_SUBTREES
10
51
The difference comes from five scripts under src/ipc/libmultiprocess/ci/scripts/ that are also matched by the current regex, despite libmultiprocess not being explicitly listed.
I tried replacing the hardcoded exclusions in both lint-shell.py and lint-shell-locale.py with SHARED_EXCLUDED_SUBTREES. This preserves the current set of excluded .sh files while making the exclusions consistent with the shared list.
I also ran ./ci/lint.py, which passed.
Would this be a reasonable small improvement toward addressing this issue?
I think it is unclear what to do here. There is some interest in linting the libmul scripts, so the options are:
lint them as part of this repo, which could make subtree bumps more tedious?
lint them as part of the libmul repo, by re-using or copying the script from this repo?
Both?
Neither or something else?
I think it could be best to do both:
Copy-paste the few lint into libmul, which are needed (probably just the shell ones and test/lint/lint-files.py, test/lint/lint-include-guards.py, test/lint/lint-includes.py? (the others aren't needed, IIUC). I think copy-pasting is easier than to vendor the lint framework for other repos.
Then, inside this repo, adjust those lints to also check the libmul subtree as a double-sanity check.
Activity
maflcko commentedon Mar 26, 2026
I don't think this is true. There are common/shared constants for those in Rust and Python:
So if a linter is missing those, it should be added.
In any case, libmultiprocess is probably written in the same C++ that Bitcoin Core is written in, so it could make sense to apply some of the linters there.
ryanofsky commentedon Mar 27, 2026
I agree with Marco it's nice for these lint checks to apply. The thing that's not ideal is just the way the checks are currently applied because they aren't performed until the subtree is updated. One way to improve this might be to extend bitcoin-core/libmultiprocess#253 to run the Bitcoin core lint job in addition to other jobs when libmultiprocess prs are opened to provide earlier feedback. (It could also be good to make Bitcoin core CI code more modular so the checks could be easier to reuse and probably easier to maintain.)
savagemechanic commentedon May 18, 2026
I did a small audit of current master to check what still seems open here.
There are already shared subtree lists in both lint stacks:
test/lint/lint_ignore_dirs.pyhasSHARED_EXCLUDED_SUBTREEStest/lint/test_runner/src/util.rshasget_subtrees()/get_pathspecs_default_excludes()A number of checks already consume these lists, for example
lint-locale-dependence.py,lint-includes.py,lint-include-guards.py, and the Rust lint-runner checks that use the default excludes.The part that still seems inconsistent is the older Python linters with local or ad hoc subtree filtering. In particular,
lint-shell-locale.pystill scans all*.shfiles and only skipssrc/(secp256k1|minisketch)/, so it still applies to thesrc/ipc/libmultiprocess/ci/scripts/*.shfiles. Current master passes because bitcoin-core/libmultiprocess#265 added the expectedLC_ALLlines, but the check is still being applied to that subtree.So I think the remaining issue is probably narrower than "create one list": the shared lists exist, but some Python linters still bypass them or maintain separate exclusion logic. A small follow-up could move the ad hoc subtree filtering to
SHARED_EXCLUDED_SUBTREES, while leaving explicit opt-ins for checks maintainers want to keep applying to a compatible subtree like libmultiprocess.That would make the policy clearer:
aaron-leeb commentedon Nov 3, 2026
I am interested in finishing the remaining work for this issue by completing the small follow up mentioned, @savagemechanic. Let me know if this issue is still outstanding or if there is any other work associated with completing it.
aaron-leeb commentedon Nov 3, 2026
While looking into the subtree exclusions, I noticed that the regex in
test/lint/lint-shell.pymay be matching more directories than intended:I compared the current regex, a corrected version that matches only the three listed subtrees that uses ( ) instead of [ ], and the existing
SHARED_EXCLUDED_SUBTREESlist against the 61 tracked.shfiles.SHARED_EXCLUDED_SUBTREESThe difference comes from five scripts under
src/ipc/libmultiprocess/ci/scripts/that are also matched by the current regex, despitelibmultiprocessnot being explicitly listed.I tried replacing the hardcoded exclusions in both
lint-shell.pyandlint-shell-locale.pywithSHARED_EXCLUDED_SUBTREES. This preserves the current set of excluded.shfiles while making the exclusions consistent with the shared list.I also ran
./ci/lint.py, which passed.Would this be a reasonable small improvement toward addressing this issue?
maflcko commentedon Nov 4, 2026
I think it is unclear what to do here. There is some interest in linting the libmul scripts, so the options are:
I think it could be best to do both: