Skip to content
This repository has been archived by the owner on Mar 25, 2023. It is now read-only.

fpm.dependency management #1

Merged
merged 10 commits into from
Dec 2, 2021
Merged

fpm.dependency management #1

merged 10 commits into from
Dec 2, 2021

Conversation

sharmashobhit
Copy link
Contributor

No description provided.


impl Dependency {
pub fn parse(b: &ftd::p2::Document) -> Vec<Dependency> {
b.to_owned().instances("fpm#dependency").unwrap()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets return Result instead of panicking.

k => k.to_string(),
};

let response = reqwest::get(download_url).await.expect("");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove .expect() and use .await?.


let response = reqwest::get(download_url).await.expect("");

std::fs::create_dir_all("./.packages/.cache").expect("failed to create build folder");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this expect also.

let download_path = format!("./.packages/.cache/{}.zip", self.name.replace("/", "__"));
let path = std::path::Path::new(download_path.as_str());
let mut file = match std::fs::File::create(&path) {
Err(why) => panic!("couldn't create {}", why),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return Err().

clap = "2.33.3"
home = "0.5.3"
reqwest = { version = "0.11.6"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should create a lint or auto formatter that converts such lines into reqwest = "0.11.6".

unreachable!("must never happen")
}

#[derive(thiserror::Error, Debug, serde_derive::Deserialize)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we deriving Deserialise?

Comment on lines +41 to +46
#[error("{doc_id}:{line_number} -> {message}")]
ParseError {
message: String,
doc_id: String,
line_number: usize,
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would we get this error? Technically we are parsing things, and there can be errors. But largely most errors would come from ftd.

@amitu amitu merged commit b6c59c7 into main Dec 2, 2021
@amitu amitu deleted the fpm-dependency branch December 2, 2021 10:41
@Arpita-Jaiswal Arpita-Jaiswal mentioned this pull request Dec 2, 2021
Heulitig added a commit that referenced this pull request Sep 14, 2022
Arpita-Jaiswal pushed a commit that referenced this pull request Sep 14, 2022
* ignored grepping id for commented/escaped-out components

* ignored ids under component definition

* clippy fix + removed debugs

* id regex adjustment

* adjusted to ignore mapping ids for youtube components + refactored code

* removed debugs + minor adjustments

* adjustments for few more cases

* using moved ftd parsing functions #1

* using moved ftd parsing functions #2

* moved ID regex to ftd and removed debugs

* cargo fmt

* bumped ftd version -> 7c702f9
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants