Skip to content

Commit

Permalink
Some touchups on the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
AffectedArc07 committed Dec 30, 2022
1 parent 8e4b9ae commit 5d4d6f9
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 37 deletions.
7 changes: 7 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[*]
indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = crlf
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ Home of MapDiffBot2 and IconDiffBot2.
This is a monorepo of all the respective binary crate, under the `crates/` directory.

Licensing of our code is MIT, dependency on SpacemanDMM enforces a license of GPLv3 on the final binary.

---

IDB2 install link: [https://github.com/apps/icondiffbot-2](https://github.com/apps/icondiffbot-2)

MDB2 install link: [https://github.com/apps/mapdiffbot-2](https://github.com/apps/mapdiffbot-2)
6 changes: 3 additions & 3 deletions crates/diffbot_lib/src/github/error_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ An unexpected error occured during processing, possibly caused by malformed maps

The following stack trace may be useful:
<details>
<summary>
Stack trace
</summary>
<summary>
Stack trace
</summary>

{stack_trace}

Expand Down
4 changes: 2 additions & 2 deletions crates/diffbot_lib/src/github/github_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl CheckRun {
.post(
format!("/repos/{full_repo}/check-runs"),
Some(&CreateCheckRun {
name: name.unwrap_or("MapDiffBot2").to_string(),
name: name.unwrap_or("BYONDDiffBot").to_string(),
head_sha: head_sha.to_string(),
}),
)
Expand Down Expand Up @@ -210,7 +210,7 @@ pub async fn download_file<S: AsRef<str>>(
path.push(".");
path.push(DOWNLOAD_DIR);
path.push(&target.sha);
path.set_extension("dmi");
path.set_extension("dmi"); // Method should have an IDB qualifier due to being a shared crate

async_fs::create_dir_all(path.parent().unwrap()).await?;
let mut file = File::create(&path).await?;
Expand Down
2 changes: 1 addition & 1 deletion crates/icondiffbot2/config.example.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blacklist = [
1337,
1337,
]
blacklist_contact = "Good luck!"

Expand Down
4 changes: 2 additions & 2 deletions crates/icondiffbot2/src/table_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl<'a> OutputTableBuilder<'a> {
if current_output_text.len() + diff_block.len() > 60_000 {
chunks.push(Output {
title: "Icon difference rendering",
summary: "*This is still a beta. Please file any issues [here](https://github.com/spacestation13/BYONDDiffBots/).*\n\nIcons with diff:".to_string(),
summary: "*Please file any issues [here](https://github.com/spacestation13/BYONDDiffBots/issues).*\n\nIcons with diff:".to_string(),
text: std::mem::take(&mut current_output_text)
});
}
Expand All @@ -85,7 +85,7 @@ impl<'a> OutputTableBuilder<'a> {
if !current_output_text.is_empty() {
chunks.push(Output {
title: "Icon difference rendering",
summary: "*This is still a beta. Please file any issues [here](https://github.com/spacestation13/BYONDDiffBots/).*\n\nIcons with diff:".to_string(),
summary: "*Please file any issues [here](https://github.com/spacestation13/BYONDDiffBots/issues).*\n\nIcons with diff:".to_string(),
text: std::mem::take(&mut current_output_text)
});
}
Expand Down
6 changes: 3 additions & 3 deletions crates/icondiffbot2/templates/diff_details.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<details>
<summary>
{typ} - {filename}
</summary>
<summary>
{typ} - {filename}
</summary>

|State Name (duplicate)|Old Icon|New Icon|Status|
|----------|--------|--------|------|
Expand Down
7 changes: 0 additions & 7 deletions crates/mapdiffbot2/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion crates/mapdiffbot2/config.example.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blacklist = [
1337,
1337,
]
blacklist_contact = "Good luck!"

Expand Down
18 changes: 9 additions & 9 deletions crates/mapdiffbot2/src/job_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ fn generate_finished_output<P: AsRef<Path>>(

let mut builder = CheckOutputBuilder::new(
"Map renderings",
"*This is still a beta. Please file any issues [here](https://github.com/MCHSL/mapdiffbot2/issues).*\n\nMaps with diff:",
);
"*Please file any issues [here](https://github.com/spacestation13/BYONDDiffBots/issues).*\n\nMaps with diff:",
);

let link_base = format!("{}/{}", file_url, non_abs_directory);

Expand Down Expand Up @@ -261,13 +261,13 @@ pub fn do_job(job: Job) -> Result<CheckOutputs> {
trace!("Directory doesn't exist, creating dir");
std::fs::create_dir_all(&repo_dir)?;
handle.block_on(async {
let output = Output {
title: "Cloning repo...",
summary: "The repository is being cloned, this will take a few minutes. Future runs will not require cloning.".to_owned(),
text: "".to_owned(),
};
let _ = job.check_run.set_output(output).await; // we don't really care if updating the job fails, just continue
});
let output = Output {
title: "Cloning repo...",
summary: "The repository is being cloned, this will take a few minutes. Future runs will not require cloning.".to_owned(),
text: "".to_owned(),
};
let _ = job.check_run.set_output(output).await; // we don't really care if updating the job fails, just continue
});
clone_repo(&repo, &repo_dir).context("Cloning repo")?;
}

Expand Down
6 changes: 3 additions & 3 deletions crates/mapdiffbot2/templates/diff_template_add.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<details>
<summary>
ADDED - {filename}
</summary>
<summary>
ADDED - {filename}
</summary>

Added:
[Raw link]({image_link})
Expand Down
6 changes: 3 additions & 3 deletions crates/mapdiffbot2/templates/diff_template_mod.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<details>
<summary>
MODIFIED - {filename}
</summary>
<summary>
MODIFIED - {filename}
</summary>

Modified region: {bounds}

Expand Down
6 changes: 3 additions & 3 deletions crates/mapdiffbot2/templates/diff_template_remove.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<details>
<summary>
REMOVED - {filename}
</summary>
<summary>
REMOVED - {filename}
</summary>

Removed:
[Raw link]({image_link})
Expand Down

0 comments on commit 5d4d6f9

Please sign in to comment.