mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 14:21:53 +00:00
Misc. clean up
This commit is contained in:
parent
a8e7a98300
commit
d6b4623ff7
3 changed files with 4 additions and 10 deletions
|
@ -13,7 +13,7 @@ clearscreen = "1.0.10"
|
||||||
colored = { version = "2.0.0" }
|
colored = { version = "2.0.0" }
|
||||||
fern = { version = "0.6.1" }
|
fern = { version = "0.6.1" }
|
||||||
log = { version = "0.4.17" }
|
log = { version = "0.4.17" }
|
||||||
notify = "4.0.17"
|
notify = { version = "4.0.17" }
|
||||||
rayon = { version = "1.5.3" }
|
rayon = { version = "1.5.3" }
|
||||||
rustpython-parser = { git = "https://github.com/RustPython/RustPython.git", rev = "dff916d45c5d13074d21ad329a5ab68a6499426a" }
|
rustpython-parser = { git = "https://github.com/RustPython/RustPython.git", rev = "dff916d45c5d13074d21ad329a5ab68a6499426a" }
|
||||||
serde = { version = "1.0.143", features = ["derive"] }
|
serde = { version = "1.0.143", features = ["derive"] }
|
||||||
|
|
|
@ -85,12 +85,14 @@ fn main() -> Result<()> {
|
||||||
set_up_logging(cli.verbose)?;
|
set_up_logging(cli.verbose)?;
|
||||||
|
|
||||||
if cli.watch {
|
if cli.watch {
|
||||||
|
// Perform an initial run instantly.
|
||||||
clearscreen::clear()?;
|
clearscreen::clear()?;
|
||||||
println!("Starting linter in watch mode...");
|
println!("Starting linter in watch mode...");
|
||||||
println!();
|
println!();
|
||||||
|
|
||||||
run_once(&cli.files)?;
|
run_once(&cli.files)?;
|
||||||
|
|
||||||
|
// Configure the file watcher.
|
||||||
let (tx, rx) = channel();
|
let (tx, rx) = channel();
|
||||||
let mut watcher = watcher(tx, Duration::from_secs(1))?;
|
let mut watcher = watcher(tx, Duration::from_secs(1))?;
|
||||||
for file in &cli.files {
|
for file in &cli.files {
|
||||||
|
@ -100,6 +102,7 @@ fn main() -> Result<()> {
|
||||||
loop {
|
loop {
|
||||||
match rx.recv() {
|
match rx.recv() {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
|
// Re-run on all change events.
|
||||||
clearscreen::clear()?;
|
clearscreen::clear()?;
|
||||||
println!("File change detected...");
|
println!("File change detected...");
|
||||||
println!();
|
println!();
|
||||||
|
|
|
@ -21,15 +21,6 @@ struct CheckResult {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn check_path(path: &Path) -> Result<Vec<Message>> {
|
pub fn check_path(path: &Path) -> Result<Vec<Message>> {
|
||||||
// TODO(charlie): These specific files are causing a stack overflow.
|
|
||||||
if path.to_string_lossy().eq_ignore_ascii_case(
|
|
||||||
"../spring-experiments/spr_experiments/spr_experiments/assayworks/experiments/order_20220204/pipeline_steps.py") ||
|
|
||||||
path.to_string_lossy().eq_ignore_ascii_case
|
|
||||||
( "../spring-experiments/spr_platform/spr_platform/data_index/bigquery_index.py")
|
|
||||||
{
|
|
||||||
return Ok(vec![]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check the cache.
|
// Check the cache.
|
||||||
if let Some(messages) = cache::get(path) {
|
if let Some(messages) = cache::get(path) {
|
||||||
debug!("Cache hit for: {}", path.to_string_lossy());
|
debug!("Cache hit for: {}", path.to_string_lossy());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue