mirror of
https://github.com/joshuadavidthomas/django-language-server.git
synced 2025-09-12 21:36:55 +00:00
add pedantic clippy setting and fix/allow warnings (#147)
Some checks are pending
lint / pre-commit (push) Waiting to run
lint / rustfmt (push) Waiting to run
lint / clippy (push) Waiting to run
lint / cargo-check (push) Waiting to run
release / build (push) Waiting to run
release / test (push) Waiting to run
release / release (push) Blocked by required conditions
test / generate-matrix (push) Waiting to run
test / Python , Django () (push) Blocked by required conditions
test / tests (push) Blocked by required conditions
zizmor 🌈 / zizmor latest via PyPI (push) Waiting to run
Some checks are pending
lint / pre-commit (push) Waiting to run
lint / rustfmt (push) Waiting to run
lint / clippy (push) Waiting to run
lint / cargo-check (push) Waiting to run
release / build (push) Waiting to run
release / test (push) Waiting to run
release / release (push) Blocked by required conditions
test / generate-matrix (push) Waiting to run
test / Python , Django () (push) Blocked by required conditions
test / tests (push) Blocked by required conditions
zizmor 🌈 / zizmor latest via PyPI (push) Waiting to run
This commit is contained in:
parent
e87c917cb6
commit
d677aacf7c
24 changed files with 180 additions and 113 deletions
|
@ -1,3 +1,5 @@
|
|||
use std::fmt::Write;
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::Parser;
|
||||
|
||||
|
@ -33,7 +35,7 @@ pub fn run(args: Vec<String>) -> Result<()> {
|
|||
Err(e) => {
|
||||
let mut msg = e.to_string();
|
||||
if let Some(source) = e.source() {
|
||||
msg += &format!(", caused by {}", source);
|
||||
let _ = write!(msg, ", caused by {source}");
|
||||
}
|
||||
Exit::error().with_message(msg).process_exit()
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ impl From<ExitStatus> for i32 {
|
|||
impl fmt::Display for ExitStatus {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let msg = self.as_str();
|
||||
write!(f, "{}", msg)
|
||||
write!(f, "{msg}")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,7 +69,7 @@ impl Exit {
|
|||
|
||||
pub fn process_exit(self) -> ! {
|
||||
if let Some(message) = self.message {
|
||||
println!("{}", message)
|
||||
println!("{message}");
|
||||
}
|
||||
std::process::exit(self.status.as_raw())
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ impl Exit {
|
|||
pub fn ok(self) -> Result<()> {
|
||||
match self.status {
|
||||
ExitStatus::Success => Ok(()),
|
||||
_ => Err(self.into()),
|
||||
ExitStatus::Error => Err(self.into()),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,8 +92,8 @@ impl fmt::Display for Exit {
|
|||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let status_str = self.status.as_str();
|
||||
match &self.message {
|
||||
Some(msg) => write!(f, "{}: {}", status_str, msg),
|
||||
None => write!(f, "{}", status_str),
|
||||
Some(msg) => write!(f, "{status_str}: {msg}"),
|
||||
None => write!(f, "{status_str}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// PyO3 entrypoint for the Django Language Server CLI.
|
||||
/// `PyO3` entrypoint for the Django Language Server CLI.
|
||||
///
|
||||
/// This module provides a Python interface using PyO3 to solve Python runtime
|
||||
/// interpreter linking issues. The PyO3 approach avoids complexities with
|
||||
/// This module provides a Python interface using `PyO3` to solve Python runtime
|
||||
/// interpreter linking issues. The `PyO3` approach avoids complexities with
|
||||
/// static/dynamic linking when building binaries that interact with Python.
|
||||
mod args;
|
||||
mod cli;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/// Binary interface for local development only.
|
||||
///
|
||||
/// This binary exists for development and testing with `cargo run`.
|
||||
/// The production CLI is distributed through the PyO3 interface in lib.rs.
|
||||
/// The production CLI is distributed through the `PyO3` interface in lib.rs.
|
||||
mod args;
|
||||
mod cli;
|
||||
mod commands;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue