Repository navigation
Linter, Formatter: Sort globbed files and cap the default --jobs at 8 - #2856
Merged
Merged
Conversation
Glob results come back in filesystem and runtime dependent order, so the linter's and formatter's output order could differ between machines. Sort them in `Config#findFilesForTool` and in the linter's and formatter's own glob paths. Cap the linter's default number of workers at 8. Each worker loads its own WASM parser and config, so on machines with many cores the startup cost of one worker per core outweighs the extra parallelism. Also declare the linter's missing build dependency on @herb-tools/client, which it imports from `@herb-tools/client/directives`. Claude-Session: https://claude.ai/code/session_017jYmXZLoC2KgCkEWLEQqyy
marcoroth
reviewed
Nov 2, 2026
marcoroth
reviewed
Nov 2, 2026
Co-authored-by: Marco Roth <marco.roth@intergga.ch> Signed-off-by: Marco Roth <marco.roth@intergga.ch>
marcoroth
approved these changes
Nov 2, 2026
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.
Three small fixes that came up while building standalone executables for the linter and formatter (follow-up PR coming), but that stand on their own:
globreturns files in an order that depends on the filesystem and runtime, so the linter's and formatter's output could be ordered differently between machines. Files are now sorted inConfig#findFilesForTool(which covers the linter without patterns, the formatter's directory path and the language server) and in the linter's and formatter's own glob paths.--jobsat 8. Each worker loads its own WASM parser and config, so with one worker per core the startup cost outweighs the extra parallelism on machines with many cores. With 28 cores, linting 600 files was slower with the default than with--jobs 8.--jobs autoand explicit values are unchanged, and the help text now says[default: auto, CPU cores up to 8].@herb-tools/client. The linter imports@herb-tools/client/directives, so a targetednx buildof the linter failed with TS2307 when the client hadn't been built yet.Testing
config: 191 tests passlinter: 5520 tests pass; the test file count is the same as onmainformatter: 1541 tests passhttps://claude.ai/code/session_017jYmXZLoC2KgCkEWLEQqyy