Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: disable clippy checks on fsevents #5890

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/turborepo-filewatch/src/cookie_jar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#[error("filewatching encountered errors: {0}")]
NotifyError(#[from] NotifyError),
#[error("filewatching has closed, cannot watch cookies")]
Closed,

Check warning on line 27 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (ubuntu, ubuntu-latest)

variant `Closed` is never constructed

Check warning on line 27 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (macos, macos-latest)

variant `Closed` is never constructed

Check warning on line 27 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (windows, windows-latest)

variant `Closed` is never constructed

Check warning on line 27 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Go Integration Tests (ubuntu, ubuntu-latest)

variant `Closed` is never constructed

Check warning on line 27 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (ubuntu, ubuntu-latest)

variant `Closed` is never constructed

Check warning on line 27 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (macos, macos-latest)

variant `Closed` is never constructed

Check warning on line 27 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (windows, windows-latest)

variant `Closed` is never constructed

Check warning on line 27 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo Examples (ubuntu, ubuntu-latest)

variant `Closed` is never constructed

Check warning on line 27 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo Examples (macos, macos-latest)

variant `Closed` is never constructed
}

#[derive(Debug, Error)]
Expand All @@ -41,7 +41,7 @@

type CookieResponse = Result<(), WatchError>;

pub struct CookieJar {

Check warning on line 44 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (ubuntu, ubuntu-latest)

struct `CookieJar` is never constructed

Check warning on line 44 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (macos, macos-latest)

struct `CookieJar` is never constructed

Check warning on line 44 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (windows, windows-latest)

struct `CookieJar` is never constructed

Check warning on line 44 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Go Integration Tests (ubuntu, ubuntu-latest)

struct `CookieJar` is never constructed

Check warning on line 44 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (ubuntu, ubuntu-latest)

struct `CookieJar` is never constructed

Check warning on line 44 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (macos, macos-latest)

struct `CookieJar` is never constructed

Check warning on line 44 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (windows, windows-latest)

struct `CookieJar` is never constructed

Check warning on line 44 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo Examples (ubuntu, ubuntu-latest)

struct `CookieJar` is never constructed

Check warning on line 44 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo Examples (macos, macos-latest)

struct `CookieJar` is never constructed
root: AbsoluteSystemPathBuf,
serial: AtomicUsize,
timeout: Duration,
Expand All @@ -55,12 +55,12 @@

#[derive(Default)]
struct Watches {
closed: bool,

Check warning on line 58 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (ubuntu, ubuntu-latest)

fields `closed` and `cookies` are never read

Check warning on line 58 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (macos, macos-latest)

fields `closed` and `cookies` are never read

Check warning on line 58 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (windows, windows-latest)

fields `closed` and `cookies` are never read

Check warning on line 58 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Go Integration Tests (ubuntu, ubuntu-latest)

fields `closed` and `cookies` are never read

Check warning on line 58 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (ubuntu, ubuntu-latest)

fields `closed` and `cookies` are never read

Check warning on line 58 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (macos, macos-latest)

fields `closed` and `cookies` are never read

Check warning on line 58 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (windows, windows-latest)

fields `closed` and `cookies` are never read

Check warning on line 58 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo Examples (ubuntu, ubuntu-latest)

fields `closed` and `cookies` are never read

Check warning on line 58 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo Examples (macos, macos-latest)

fields `closed` and `cookies` are never read
cookies: HashMap<PathBuf, oneshot::Sender<CookieResponse>>,
}

impl CookieJar {
pub fn new(

Check warning on line 63 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (ubuntu, ubuntu-latest)

associated items `new` and `wait_for_cookie` are never used

Check warning on line 63 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (macos, macos-latest)

associated items `new` and `wait_for_cookie` are never used

Check warning on line 63 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (windows, windows-latest)

associated items `new` and `wait_for_cookie` are never used

Check warning on line 63 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Go Integration Tests (ubuntu, ubuntu-latest)

associated items `new` and `wait_for_cookie` are never used

Check warning on line 63 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (ubuntu, ubuntu-latest)

associated items `new` and `wait_for_cookie` are never used

Check warning on line 63 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (macos, macos-latest)

associated items `new` and `wait_for_cookie` are never used

Check warning on line 63 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (windows, windows-latest)

associated items `new` and `wait_for_cookie` are never used

Check warning on line 63 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo Examples (ubuntu, ubuntu-latest)

associated items `new` and `wait_for_cookie` are never used

Check warning on line 63 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo Examples (macos, macos-latest)

associated items `new` and `wait_for_cookie` are never used
root: &AbsoluteSystemPath,
timeout: Duration,
file_events: broadcast::Receiver<Result<Event, NotifyError>>,
Expand Down Expand Up @@ -109,7 +109,7 @@
}
}

async fn watch_cookies(

Check warning on line 112 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (ubuntu, ubuntu-latest)

function `watch_cookies` is never used

Check warning on line 112 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (macos, macos-latest)

function `watch_cookies` is never used

Check warning on line 112 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (windows, windows-latest)

function `watch_cookies` is never used

Check warning on line 112 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Go Integration Tests (ubuntu, ubuntu-latest)

function `watch_cookies` is never used

Check warning on line 112 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (ubuntu, ubuntu-latest)

function `watch_cookies` is never used

Check warning on line 112 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (macos, macos-latest)

function `watch_cookies` is never used

Check warning on line 112 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (windows, windows-latest)

function `watch_cookies` is never used

Check warning on line 112 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo Examples (ubuntu, ubuntu-latest)

function `watch_cookies` is never used

Check warning on line 112 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo Examples (macos, macos-latest)

function `watch_cookies` is never used
root: AbsoluteSystemPathBuf,
watches: Arc<Mutex<Watches>>,
mut file_events: broadcast::Receiver<Result<Event, NotifyError>>,
Expand All @@ -130,7 +130,7 @@
.expect("Non-absolute path from filewatching");
if root.relation_to_path(abs_path) == PathRelation::Parent {
if let Some(responder) = watches.cookies.remove(&path) {
if let Err(_) = responder.send(Ok(())) {
if responder.send(Ok(())).is_err() {
// Note that cookie waiters will time out if they don't get a
// response, so we don't necessarily
// need to panic here, although we could decide to do that in the
Expand All @@ -151,7 +151,7 @@
let resp = if is_closing { WatchError::Closed } else { e };
let mut watches = watches.lock().expect("mutex poisoned");
for (_, sender) in watches.cookies.drain() {
if let Err(_) = sender.send(Err(resp.clone())) {
if sender.send(Err(resp.clone())).is_err() {
// Note that cookie waiters will time out if they don't get a response, so
// we don't necessarily need to panic here, although
// we could decide to do that in the future.
Expand All @@ -171,7 +171,7 @@

// result flattening is an unstable feature, so add a manual helper to do so.
// This version is for unwrapping events coming from filewatching
fn flatten_event(

Check warning on line 174 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (ubuntu, ubuntu-latest)

function `flatten_event` is never used

Check warning on line 174 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (macos, macos-latest)

function `flatten_event` is never used

Check warning on line 174 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Build Turborepo (windows, windows-latest)

function `flatten_event` is never used

Check warning on line 174 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Go Integration Tests (ubuntu, ubuntu-latest)

function `flatten_event` is never used

Check warning on line 174 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (ubuntu, ubuntu-latest)

function `flatten_event` is never used

Check warning on line 174 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (macos, macos-latest)

function `flatten_event` is never used

Check warning on line 174 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo E2E Tests (windows, windows-latest)

function `flatten_event` is never used

Check warning on line 174 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo Examples (ubuntu, ubuntu-latest)

function `flatten_event` is never used

Check warning on line 174 in crates/turborepo-filewatch/src/cookie_jar.rs

View workflow job for this annotation

GitHub Actions / Turborepo Examples (macos, macos-latest)

function `flatten_event` is never used
event: Result<Result<Event, NotifyError>, broadcast::error::RecvError>,
) -> Result<Event, WatchError> {
Ok(event??)
Expand Down
8 changes: 5 additions & 3 deletions crates/turborepo-filewatch/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![deny(clippy::all)]
#![feature(assert_matches)]

use std::{
Expand Down Expand Up @@ -33,6 +34,7 @@ use {

mod cookie_jar;
#[cfg(target_os = "macos")]
#[allow(clippy::all)]
mod fsevent;

#[cfg(not(target_os = "macos"))]
Expand Down Expand Up @@ -90,7 +92,7 @@ impl FileSystemWatcher {
let watcher = run_watcher(&watch_root, send_file_events).unwrap();
let (exit_ch, exit_signal) = tokio::sync::oneshot::channel();
// Ensure we are ready to receive new events, not events for existing state
futures::executor::block_on(wait_for_cookie(&root, &mut recv_file_events))?;
futures::executor::block_on(wait_for_cookie(root, &mut recv_file_events))?;
tokio::task::spawn(watch_events(
watcher,
watch_root,
Expand Down Expand Up @@ -149,7 +151,7 @@ async fn watch_events(
{
if event.kind == EventKind::Create(CreateKind::Folder) {
for new_path in &event.paths {
if let Err(err) = manually_add_recursive_watches(&new_path, &mut watcher, Some(&broadcast_sender)) {
if let Err(err) = manually_add_recursive_watches(new_path, &mut watcher, Some(&broadcast_sender)) {
warn!("encountered error watching filesystem {}", err);
break 'outer;
}
Expand Down Expand Up @@ -233,7 +235,7 @@ fn watch_parents(root: &AbsoluteSystemPath, watcher: &mut Backend) -> Result<(),

#[cfg(not(feature = "manual_recursive_watch"))]
fn watch_recursively(root: &AbsoluteSystemPath, watcher: &mut Backend) -> Result<(), WatchError> {
watcher.watch(&root.as_std_path(), RecursiveMode::Recursive)?;
watcher.watch(root.as_std_path(), RecursiveMode::Recursive)?;
Ok(())
}

Expand Down
Loading