Skip to content

Commit

Permalink
Fix code to pass environmentalChecks and add blurb field documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lyuanww committed Feb 21, 2025
1 parent ba421b1 commit 9393180
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion config/report-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ repos:
author-display-name: Francis Hodianto
author-git-author-name: Francis Hodianto
author-emails:
ignore-authors-list:
ignore-authors-list:
2 changes: 2 additions & 0 deletions docs/ug/configFiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ e.g.: `example.java` in `example-repo` can either be in the `test` group or the
## `report-config.yaml`

You can also optionally use a `report-config.yaml` file to quickly define the repository information for the repositories you are interested in tracking and generate your very own code portfolio.
The configurations of this file will override the configurations in the csv files if the file is present and correctly formatted.

View this [example](report-config.yaml) for a better understanding of what repository information is required.

Expand All @@ -124,6 +125,7 @@ Note: All fields are optional unless specified otherwise.
* `globs` {{ mandatory }}: The list of file path globs to include for specified group.
* `branches`: A list of branches to analyse for each repository.
* `branch`: The name of the branch.
* `blurb`: The blurb to display for the branch. To display more detailed blurbs, use the `blurbs.md` file.
* `authors`: A list of authors to analyse on the branch.
* `author-git-host-id` {{ mandatory }}: Git host username of the author.
* `author-display-name`: Display name of the author.
Expand Down
1 change: 0 additions & 1 deletion docs/ug/report-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ repos:
ignore-glob-list:
- "**.md"
file-size-limit: 2000000

2 changes: 1 addition & 1 deletion frontend/cypress/config/report-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ repos:
author-display-name: Francis Hodianto
author-git-author-name: Francis Hodianto
author-emails:
ignore-authors-list:
ignore-authors-list:
2 changes: 1 addition & 1 deletion src/main/java/reposense/model/CliArguments.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public double getOriginalityThreshold() {
return originalityThreshold;
}

public boolean isReportConfigRepositoriesConfigured() {
public boolean areReportConfigRepositoriesConfigured() {
return reportConfiguration != null && !reportConfiguration.getReportRepoConfigurations().isEmpty();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ public List<RepoConfiguration> getRepoConfigurations() throws InvalidLocationExc
logger.info("Parsing " + rbd.getBranch() + "...");

RepoConfiguration.Builder builder = new RepoConfiguration.Builder()
.location(repoLocation);

builder = builder.branch(rbd.getBranch())
.location(repoLocation)
.branch(rbd.getBranch())
.ignoreGlobList(rbd.getIgnoreGlobList())
.ignoredAuthorsList(rbd.getIgnoreAuthorList())
.fileSizeLimit(rbd.getFileSizeLimit())
.isStandaloneConfigIgnored(true); // remove this when we deprecated the standalone config
// Needs to be removed this when we deprecate the standalone config
.isStandaloneConfigIgnored(true);

AuthorConfiguration authorConfiguration = new AuthorConfiguration(repoLocation, rbd.getBranch());
for (ReportAuthorDetails rad : rbd.getReportAuthorDetails()) {
Expand All @@ -62,7 +62,6 @@ public List<RepoConfiguration> getRepoConfigurations() throws InvalidLocationExc
author.setAuthorAliases(List.of(rad.getAuthorGitAuthorName()));

authorConfiguration.addAuthor(author);

}
authorConfigs.add(authorConfiguration);
repoConfigs.add(builder.build());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/reposense/model/RunConfigurationDecider.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static RunConfiguration getRunConfiguration(CliArguments cliArguments) {
return new CliRunConfiguration(cliArguments);
}

if (cliArguments.isReportConfigRepositoriesConfigured()) {
if (cliArguments.areReportConfigRepositoriesConfigured()) {
return new OneStopConfigRunConfiguration(cliArguments);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void parse_addRepos_returnsCliRunConfiguration() throws Exception {
}

@Test
public void parse_reposAndConfigNotSpecified_returnsConfigRunConfiguration() throws Exception {
public void parse_reposAndConfigNotSpecified_doesNotReturnCliRunConfiguration() throws Exception {
String input = new InputBuilder()
.addSinceDate("01/07/2017")
.addUntilDate("30/11/2017")
Expand Down

0 comments on commit 9393180

Please sign in to comment.