Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

compliance: Expose some more methods (#53831)

Finn Evers909dfd0a5cac
diff --git a/tooling/compliance/src/checks.rs b/tooling/compliance/src/checks.rs
index da8bb7d24d9..0ee8eed8081 100644
--- a/tooling/compliance/src/checks.rs
+++ b/tooling/compliance/src/checks.rs
@@ -110,7 +110,10 @@ impl<'a> Reporter<'a> {
}
/// Method that checks every commit for compliance
- async fn check_commit(&self, commit: &CommitDetails) -> Result<ReviewSuccess, ReviewFailure> {
+ pub async fn check_commit(
+ &self,
+ commit: &CommitDetails,
+ ) -> Result<ReviewSuccess, ReviewFailure> {
let Some(pr_number) = commit.pr_number() else {
return Err(ReviewFailure::NoPullRequestFound);
};
diff --git a/tooling/compliance/src/git.rs b/tooling/compliance/src/git.rs
index 424032d035a..e2581b1c7fa 100644
--- a/tooling/compliance/src/git.rs
+++ b/tooling/compliance/src/git.rs
@@ -127,6 +127,17 @@ pub struct CommitDetails {
body: String,
}
+impl CommitDetails {
+ pub fn new(sha: CommitSha, author: Committer, title: String, body: String) -> Self {
+ Self {
+ sha,
+ author,
+ title,
+ body,
+ }
+ }
+}
+
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Committer {
name: String,