compliance: Expose some more methods (#53831)

Finn Evers created

They will again come in handy for the GitHub worker.

Release Notes:

- N/A

Change summary

tooling/compliance/src/checks.rs |  5 ++++-
tooling/compliance/src/git.rs    | 11 +++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)

Detailed changes

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);
         };

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,