Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Nov 19, 2024
1 parent 5af54d4 commit a99da34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/oxlint/src/command/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub struct BasicOptions {
/// TypeScript `tsconfig.json` path for reading path alias and project references for import plugin
#[bpaf(argument("./tsconfig.json"), hide_usage)]
pub tsconfig: Option<PathBuf>,

/// The working directory where oxlint should be executed
/// defaults to `env::current_dir()`
#[bpaf(long("working-dir"), hide_usage)]
Expand Down
15 changes: 9 additions & 6 deletions apps/oxlint/src/lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,19 @@ impl Runner for LintRunner {
let now = Instant::now();

let mut cwd = env::current_dir().expect("Failed to get current working directory");

// append the working directory paths
if let Some(working_dir) = basic_options.working_dir {
cwd.push(working_dir);

paths = paths.into_iter().map(|x| {
let mut new = cwd.clone();
new.push(x);
new
}).collect()
paths = paths
.into_iter()
.map(|x| {
let mut new = cwd.clone();
new.push(x);
new
})
.collect()
}

// The ignore crate whitelists explicit paths, but priority
Expand Down

0 comments on commit a99da34

Please sign in to comment.