Skip to content

Commit

Permalink
fix clipply lints (#1260)
Browse files Browse the repository at this point in the history
* fix clipply lints

* pin rust in lunatic example
  • Loading branch information
coffee-cup authored Jan 11, 2025
1 parent 15ea79e commit b161f1a
Show file tree
Hide file tree
Showing 27 changed files with 28 additions and 29 deletions.
1 change: 1 addition & 0 deletions examples/lunatic-basic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "lunatic-basic"
version = "0.1.0"
edition = "2021"
rust-version = "1.83.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
6 changes: 2 additions & 4 deletions src/nixpacks/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ impl Environment {
/// Collects all variables from the calling environment.
pub fn from_envs(envs: Vec<&str>) -> Result<Environment> {
let mut environment = Environment::default();
let re = Regex::new(r"([A-Za-z0-9_-]*)(?:=?)([\s\S]*)").unwrap();
for env in envs {
let matches = Regex::new(r"([A-Za-z0-9_-]*)(?:=?)([\s\S]*)")
.unwrap()
.captures(env)
.unwrap();
let matches = re.captures(env).unwrap();
if matches.get(2).unwrap().as_str() == "" {
// No value, pull from the current environment
let name = matches.get(1).unwrap().as_str();
Expand Down
2 changes: 1 addition & 1 deletion src/providers/clojure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const DEFAULT_JDK_PKG_NAME: &str = "jdk8";
pub struct ClojureProvider {}

impl Provider for ClojureProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"clojure"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/cobol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const DEFAULT_COBOL_COMPILE_ARGS: &str = "-x -o";
pub struct CobolProvider {}

impl Provider for CobolProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"cobol"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/crystal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct ShardYaml {
pub struct CrystalProvider {}

impl Provider for CrystalProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"crystal"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/csharp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct CSharpProvider {}
pub const ARTIFACT_DIR: &str = "out";

impl Provider for CSharpProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"c#"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/dart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct DartPubspec {
pub struct DartProvider {}

impl Provider for DartProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"dart"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/deno.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub struct DenoJson {
pub struct DenoProvider {}

impl Provider for DenoProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"deno"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/elixir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const ELIXIR_NIXPKGS_ARCHIVE: &str = "c5702bd28cbde41a191a9c2a00501f18941efbd0";
pub struct ElixirProvider {}

impl Provider for ElixirProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"elixir"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/fsharp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub struct FSharpProvider {}
pub const ARTIFACT_DIR: &str = "out";

impl Provider for FSharpProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"f#"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/gleam/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl GleamManifest {
pub struct GleamProvider;

impl Provider for GleamProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"gleam"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/go.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const DEFAULT_ARCHIVE: &str = "e89cf1c932006531f454de7d652163a9a5c86668";
const GO_BUILD_CACHE_DIR: &str = "/root/.cache/go-build";

impl Provider for GolangProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"go"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/haskell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const STACK_WORK_CACHE_DIR: &str = ".stack-work";
pub struct HaskellStackProvider {}

impl Provider for HaskellStackProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"haskell"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/java.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const DEFAULT_GRADLE_VERSION: u32 = 8;
const JAVA_NIXPKGS_ARCHIVE: &str = "59dc10b5a6f2a592af36375c68fda41246794b86";

impl Provider for JavaProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"java"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/lunatic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use regex::Regex;
pub struct LunaticProvider {}

impl Provider for LunaticProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"lunatic"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub struct PackageJson {
pub struct NodeProvider {}

impl Provider for NodeProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"node"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/php/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const PHP_ARCHIVE_VERSIONS: &[(&str, (&str, &str))] = &[
pub struct PhpProvider;

impl Provider for PhpProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"php"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/procfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use anyhow::{Context, Ok, Result};
pub struct ProcfileProvider {}

impl Provider for ProcfileProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"procfile"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const LEGACY_PYTHON_NIXPKGS_ARCHIVE: &str = "5148520bfab61f99fd25fb9ff7bfbb50dad
pub struct PythonProvider {}

impl Provider for PythonProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"python"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/ruby.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub struct RubyProvider {}
const BUNDLE_CACHE_DIR: &str = "/root/.bundle/cache";

impl Provider for RubyProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"ruby"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const CARGO_TARGET_CACHE_DIR: &str = "target";
pub struct RustProvider {}

impl Provider for RustProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"rust"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/scala.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const DEFAULT_JDK_VERSION: u32 = 17;
* TODO: Add support for scala-cli and mill
*/
impl Provider for ScalaProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"scala"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/scheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use anyhow::Result;
pub struct HauntProvider {}

impl Provider for HauntProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"scheme"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/staticfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub struct Staticfile {
pub struct StaticfileProvider {}

impl Provider for StaticfileProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"staticfile"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/swift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const AVAILABLE_SWIFT_VERSIONS: &[(&str, &str)] = &[
pub struct SwiftProvider {}

impl Provider for SwiftProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"swift"
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/zig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::ffi::OsStr;
pub struct ZigProvider;

impl Provider for ZigProvider {
fn name(&self) -> &str {
fn name(&self) -> &'static str {
"zig"
}

Expand Down
2 changes: 1 addition & 1 deletion tests/snapshots/generate_plan_tests__lunatic_basic.snap
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ expression: plan
"nixPkgs": [
"binutils",
"gcc",
"(rust-bin.stable.latest.default.override { targets = [\"wasm32-wasi\"]; })",
"(rust-bin.stable.\"1.83.0\".default.override { targets = [\"wasm32-wasi\"]; })",
"lunatic"
],
"nixOverlays": [
Expand Down

0 comments on commit b161f1a

Please sign in to comment.