-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c94fea
commit 6ee3249
Showing
17 changed files
with
524 additions
and
103 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,43 @@ | ||
title: RepoSense Report | ||
group-details: | ||
- repo: https://github.com/user/repo/tree/fake-branch | ||
groups: | ||
- group-name: code | ||
globs: | ||
- "**.java" | ||
- group-name: tests | ||
globs: | ||
- "src/test**" | ||
- group-name: docs | ||
globs: | ||
- "docs**" | ||
- "**.adoc" | ||
- "**.md" | ||
repos: | ||
- repo: https://github.com/user/repo | ||
authorNames: | ||
- johnDoe | ||
- John Doe | ||
- my home PC | ||
- repo: https://github.com/user/repo/tree/fake-branch | ||
author-emails: | ||
- [email protected] | ||
- [email protected] | ||
- [email protected] | ||
author-git-host-id: johnDoe | ||
author-display-name: John Doe | ||
author-git-author-name: my home PC | ||
branches: | ||
- branch: main | ||
blurb: very long blurb | ||
- branch: master | ||
blurb: very very long blurb | ||
- repo: https://github.com/user/repo2 | ||
authorNames: | ||
- author1 | ||
- author One | ||
- my author PC | ||
branches: | ||
- branch: main | ||
blurb: very very very long blurb | ||
file-formats: | ||
- override:java | ||
- md | ||
- fxml | ||
ignore-glob-list: | ||
- "docs**" | ||
ignore-standalone-config: true | ||
ignore-commits-list: | ||
- 2fb6b9b2dd9fa40bf0f9815da2cb0ae8731436c7 | ||
- c5a6dc774e22099cd9ddeb0faff1e75f9cf4f151 | ||
- cd7f610e0becbdf331d5231887d8010a689f87c7 | ||
- 768015345e70f06add2a8b7d1f901dc07bf70582 | ||
ignore-authors-list: | ||
- author1 | ||
- author2 | ||
is-shallow-cloning: true | ||
is-find-previous-authors: false |
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
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
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
49 changes: 49 additions & 0 deletions
49
src/main/java/reposense/model/reportconfig/ReportGroupDetails.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,49 @@ | ||
package reposense.model.reportconfig; | ||
|
||
import java.util.List; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Contains information about the group contained in a particular repo. | ||
*/ | ||
public class ReportGroupDetails { | ||
public static final String DEFAULT_REPO = "https://github.com/user/repo/tree/fake-branch"; | ||
public static final List<ReportGroupNameAndGlobs> DEFAULT_NAMES_AND_GLOBS = | ||
ReportGroupNameAndGlobs.DEFAULT_INSTANCES; | ||
public static final ReportGroupDetails DEFAULT_INSTANCE = new ReportGroupDetails(); | ||
|
||
static { | ||
DEFAULT_INSTANCE.repo = DEFAULT_REPO; | ||
DEFAULT_INSTANCE.reportGroupNameAndGlobsList = ReportGroupNameAndGlobs.DEFAULT_INSTANCES; | ||
} | ||
|
||
@JsonProperty("repo") | ||
private String repo; | ||
|
||
@JsonProperty("groups") | ||
private List<ReportGroupNameAndGlobs> reportGroupNameAndGlobsList; | ||
|
||
public String getRepo() { | ||
return repo == null ? DEFAULT_REPO : repo; | ||
} | ||
|
||
public List<ReportGroupNameAndGlobs> getReportGroupNameAndGlobsList() { | ||
return reportGroupNameAndGlobsList == null ? DEFAULT_NAMES_AND_GLOBS : reportGroupNameAndGlobsList; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (obj == this) { | ||
return true; | ||
} | ||
|
||
if (obj instanceof ReportGroupDetails) { | ||
ReportGroupDetails rgd = (ReportGroupDetails) obj; | ||
return this.getRepo().equals(rgd.getRepo()) | ||
&& this.getReportGroupNameAndGlobsList().equals(rgd.getReportGroupNameAndGlobsList()); | ||
} | ||
|
||
return false; | ||
} | ||
} |
69 changes: 69 additions & 0 deletions
69
src/main/java/reposense/model/reportconfig/ReportGroupNameAndGlobs.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,69 @@ | ||
package reposense.model.reportconfig; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
/** | ||
* Contains details about each report group and the corresponding globs. | ||
*/ | ||
public class ReportGroupNameAndGlobs { | ||
public static final String DEFAULT_GROUP_NAME = "code"; | ||
public static final List<String> DEFAULT_GLOBS = List.of( | ||
"**.java" | ||
); | ||
public static final List<ReportGroupNameAndGlobs> DEFAULT_INSTANCES = new ArrayList<>(); | ||
|
||
static { | ||
ReportGroupNameAndGlobs rg1 = new ReportGroupNameAndGlobs(); | ||
rg1.groupName = "code"; | ||
rg1.globs = List.of("**.java"); | ||
|
||
ReportGroupNameAndGlobs rg2 = new ReportGroupNameAndGlobs(); | ||
rg2.groupName = "tests"; | ||
rg2.globs = List.of("src/test**"); | ||
|
||
ReportGroupNameAndGlobs rg3 = new ReportGroupNameAndGlobs(); | ||
rg3.groupName = "docs"; | ||
rg3.globs = List.of("docs**", "**.adoc", "**.md"); | ||
|
||
DEFAULT_INSTANCES.add(rg1); | ||
DEFAULT_INSTANCES.add(rg2); | ||
DEFAULT_INSTANCES.add(rg3); | ||
} | ||
|
||
@JsonProperty("group-name") | ||
private String groupName; | ||
|
||
@JsonProperty("globs") | ||
private List<String> globs; | ||
|
||
public String getGroupName() { | ||
return groupName == null ? DEFAULT_GROUP_NAME : groupName; | ||
} | ||
|
||
public List<String> getGlobs() { | ||
return globs == null ? DEFAULT_GLOBS : globs; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (obj == this) { | ||
return true; | ||
} | ||
|
||
if (obj instanceof ReportGroupNameAndGlobs) { | ||
ReportGroupNameAndGlobs rgnag = (ReportGroupNameAndGlobs) obj; | ||
return rgnag.getGroupName().equals(this.getGroupName()) | ||
&& rgnag.getGlobs().equals(this.getGlobs()); | ||
} | ||
|
||
return false; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "RGNAG { group-name: " + this.groupName + ", globs: " + this.globs + "}"; | ||
} | ||
} |
Oops, something went wrong.