Skip to content

Commit

Permalink
chore: enable clippy::upper_case_acronyms
Browse files Browse the repository at this point in the history
This patch enables `clippy::upper_case_acronyms` and addresses
related issues.
  • Loading branch information
rockstar committed Mar 1, 2024
1 parent 251136a commit 96c2d78
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
14 changes: 11 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#![allow(clippy::declare_interior_mutable_const, clippy::borrow_interior_mutable_const, clippy::module_inception, clippy::result_large_err, clippy::type_complexity, clippy::upper_case_acronyms)]
#![allow(
clippy::declare_interior_mutable_const,
clippy::borrow_interior_mutable_const,
clippy::module_inception,
clippy::result_large_err,
clippy::type_complexity
)]
mod kvstore;
mod package_db;
mod prelude;
Expand Down Expand Up @@ -40,8 +46,10 @@ fn main() -> Result<()> {
let build_store = KVDirStore::new(build_tmp.path())?;

let db = package_db::PackageDB::new(
&[Url::parse("https://pybi.vorpus.org")?,
Url::parse("https://pypi.org/simple/")?],
&[
Url::parse("https://pybi.vorpus.org")?,
Url::parse("https://pypi.org/simple/")?,
],
PROJECT_DIRS.cache_dir(),
// PackageDB needs a place to install packages, in case it has to build some
// sdists. Using a shared env_forest is efficient, because it means different
Expand Down
6 changes: 3 additions & 3 deletions src/trampolines/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::{prelude::*, tree::WriteTree};

#[derive(Debug, Clone, Copy, Eq, PartialEq)]
pub enum ScriptType {
GUI,
Gui,
Console,
}
#[derive(Debug, Clone, Copy, Eq, PartialEq)]
Expand Down Expand Up @@ -58,7 +58,7 @@ impl TrampolineMaker {
fn unix_trampoline(&self, script: &[u8], script_type: ScriptType) -> Vec<u8> {
let prefix = match script_type {
ScriptType::Console => UNIX_TEMPLATE.into(),
ScriptType::GUI => UNIX_TEMPLATE.replace("POSY_PYTHON", "POSY_PYTHONW"),
ScriptType::Gui => UNIX_TEMPLATE.replace("POSY_PYTHON", "POSY_PYTHONW"),
};
let mut out = prefix.into_bytes();
out.extend_from_slice(script);
Expand All @@ -68,7 +68,7 @@ impl TrampolineMaker {
fn windows_trampoline(&self, script: &[u8], script_type: ScriptType) -> Vec<u8> {
let prefix = match script_type {
ScriptType::Console => WINDOWS_CONSOLE,
ScriptType::GUI => WINDOWS_GUI,
ScriptType::Gui => WINDOWS_GUI,
};
let mut suffix = std::io::Cursor::new(Vec::<u8>::new());
{
Expand Down
6 changes: 3 additions & 3 deletions src/vocab/artifact_formats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ impl Pybi {
}

fn script_for_entrypoint(entry: &Entrypoint, script_type: ScriptType) -> Vec<u8> {
let w = if script_type == ScriptType::GUI {
let w = if script_type == ScriptType::Gui {
"w"
} else {
""
Expand Down Expand Up @@ -496,7 +496,7 @@ impl Wheel {
};

write_scripts("console_scripts", ScriptType::Console)?;
write_scripts("gui_scripts", ScriptType::GUI)?;
write_scripts("gui_scripts", ScriptType::Gui)?;
}
Ok(())
}
Expand Down Expand Up @@ -574,7 +574,7 @@ where
if script_start.starts_with(b"#!python") {
// it's some kind of script, but which kind?
let script_type = if script_start.starts_with(b"#!pythonw") {
ScriptType::GUI
ScriptType::Gui
} else {
ScriptType::Console
};
Expand Down

0 comments on commit 96c2d78

Please sign in to comment.