-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create rule based detection of bad practices(#226)
- Loading branch information
Showing
5 changed files
with
141 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...rc/main/java/de/tum/in/www1/hephaestus/activity/PullRequestBadPracticeRuleRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package de.tum.in.www1.hephaestus.activity; | ||
|
||
import de.tum.in.www1.hephaestus.activity.model.PullRequestBadPracticeRule; | ||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface PullRequestBadPracticeRuleRepository extends JpaRepository<PullRequestBadPracticeRule, Long> { | ||
@Query( | ||
""" | ||
SELECT prbp | ||
FROM PullRequestBadPracticeRule prbp | ||
WHERE prbp.active = true | ||
""" | ||
) | ||
List<PullRequestBadPracticeRule> findAllActive(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...cation-server/src/main/java/de/tum/in/www1/hephaestus/activity/model/BadPracticeType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package de.tum.in.www1.hephaestus.activity.model; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum BadPracticeType { | ||
|
||
UncheckedCheckbox( | ||
"Unchecked Checkbox", | ||
"This pull request contains an unchecked checkbox.", | ||
"The pull request contains an unchecked checkbox. An unchecked checkbox looks like this: '- [ ]'." | ||
), | ||
EmptySection( | ||
"Empty Section", | ||
"This pull request contains an empty section.", | ||
"The pull request contains an empty section. An empty section is a section that does not contain any content. An empty section is directly followed by another section of the same or bigger title size." | ||
); | ||
|
||
private final String title; | ||
private final String description; | ||
private final String llmPrompt; | ||
|
||
BadPracticeType(String title, String description, String llmPrompt) { | ||
this.title = title; | ||
this.description = description; | ||
this.llmPrompt = llmPrompt; | ||
} | ||
} |
Empty file.