feat(linter): Add --list-files to linter#17233
Open
wagenet wants to merge 5 commits intooxc-project:mainfrom
Open
feat(linter): Add --list-files to linter#17233wagenet wants to merge 5 commits intooxc-project:mainfrom
wagenet wants to merge 5 commits intooxc-project:mainfrom
Conversation
connorshea
reviewed
Dec 21, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a --list-files flag to the linter that allows users to see which files would be linted without actually performing the linting operation.
- Adds
--list-filescommand-line option - Implements file listing logic that displays matched files in sorted order and exits early
- Includes test coverage for the new functionality
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| apps/oxlint/src/command/lint.rs | Adds the list_files boolean field to LintCommand and includes a unit test |
| apps/oxlint/src/lint.rs | Implements the file listing logic and adds integration test |
| apps/oxlint/src/snapshots/_--list-files [email protected] | Snapshot test output for the --list-files feature |
| tasks/website_linter/src/snapshots/cli.snap | Updates help text documentation with the new flag |
| tasks/website_linter/src/snapshots/cli_terminal.snap | Updates terminal help output with the new flag |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The parallel file walker returns files in non-deterministic order. Sort the output for consistent, predictable results. Also update CLI help snapshots that were missing from initial commit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
9c6efd1 to
a4a545e
Compare
…iles with the command. And ensure that there's a snapshot of the output with no-ignore as well. Generated with help from Copilot + Raptor mini.
connorshea
approved these changes
Dec 31, 2025
dosmond
reviewed
Mar 2, 2026
| @@ -369,6 +357,17 @@ impl CliRunner { | |||
| .filter(|path| !ignore_matcher.should_ignore(Path::new(path))) | |||
| .collect::<Vec<Arc<OsStr>>>(); | |||
|
|
|||
| if self.options.list_files { | |||
| let mut sorted_files: Vec<_> = files_to_lint.iter().collect(); | |||
Contributor
There was a problem hiding this comment.
Just curious here, could we just use sort_unstable() here instead of copying and then sorting or are we worried about preserving the files_to_lint ordering?
Contributor
|
Following this from #19833 Just wondering if there are plans to merge this! This would be great to have! |
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.
Allows listing of all matched files without actually linting.
Fix #13172.