Skip to content

Commit

Permalink
Merge branch 'reposense:944-analyze-authorship' into 944-analyze-auth…
Browse files Browse the repository at this point in the history
…orship
  • Loading branch information
SkyBlaise99 committed Mar 7, 2024
2 parents 34b3673 + b90b9a3 commit a59f992
Show file tree
Hide file tree
Showing 85 changed files with 2,474 additions and 1,242 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ RepoSense is a contribution analysis tool for Git repositories. It is particular
- [User Guide for the latest `master` (not yet released to users)](https://reposense.github.io/RepoSense)

---
### Our Contributors :
<a href="https://github.com/reposense/RepoSense/graphs/contributors">
<img src="https://contrib.rocks/image?repo=reposense/RepoSense" />
</a>

**Acknowledgements**: The web previews of RepoSense is powered by Netlify and Surge.

Expand Down
24 changes: 12 additions & 12 deletions docs/dg/learningBasics.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ Here are some small tasks for you to gain some basic knowledge of the code relat

Therefore, the first step you can take is to add the following to `ArgsParser`.

```
```java
public static final String[] JSON_PRINT_MODE_FLAGS = new String[]{"--use-json-pretty-printing", "-j"};
```

In `getArgumentParser` method, add the following content to make `ArgumentParser` capture the new argument.

```
```java
parser.addArgument(JSON_PRINT_MODE_FLAGS)
.dest(JSON_PRINT_MODE_FLAGS[0])
.action(Arguments.storeTrue())
Expand All @@ -102,7 +102,7 @@ Here are some small tasks for you to gain some basic knowledge of the code relat

1. Add the following content to `CliArguments` to include `isPrettyPrintingUsed` as a new attribute to the class.

```
```java
protected boolean isPrettyPrintingUsed;

public boolean isPrettyPrintingUsed() {
Expand All @@ -112,13 +112,13 @@ Here are some small tasks for you to gain some basic knowledge of the code relat

2. In the constructor of `ConfigCliArguments`, add `isPrettyPrintingUsed` as a new parameter of the method, and add the following instruction to the method body.

```
```java
this.isPrettyPrintingUsed = isPrettyPrintingUsed;
```

3. In the `parse` method of `ArgsParser`, add the following instruction to get `isJsonPrettyPrintingUsed` from `ArgmentParser`.

```
```java
boolean isJsonPrettyPrintingUsed = results.get(JSON_PRINT_MODE_FLAGS[0]);
```

Expand All @@ -139,13 +139,13 @@ Here are some small tasks for you to gain some basic knowledge of the code relat

2. Add the following content to `FileUtil`.

```
```java
private static boolean isPrettyPrintingUsed = false;
```

3. In the `writeJsonFile` method, Replace the creation of the `Gson` object with the following instructions.

```
```java
GsonBuilder gsonBuilder = new GsonBuilder()
.registerTypeAdapter(LocalDateTime.class, (JsonSerializer<LocalDateTime>) (date, typeOfSrc, context)
-> new JsonPrimitive(date.format(DateTimeFormatter.ofPattern(GITHUB_API_DATE_FORMAT))))
Expand All @@ -160,15 +160,15 @@ Here are some small tasks for you to gain some basic knowledge of the code relat

4. To notify `FileUtil` of the switch between different printing mode, add the following method to `FileUtil`.

```
```java
public static void setPrettyPrintingMode(boolean isPrettyPrintingAdopted) {
isPrettyPrintingUsed = isPrettyPrintingAdopted;
}
```

5. It is now possible to notify `FileUtil` of the printing mode switch by extracting the argument from the `CliArguments` object in the `main` method of `RepoSense.java` and passing it to the corresponding method in `FileUtil`.

```
```java
FileUtil.setPrettyPrintingMode(cliArguments.isPrettyPrintingUsed());
```

Expand Down Expand Up @@ -225,7 +225,7 @@ Here are some small tasks for you to gain some basic knowledge of the code relat

Add this to the catch block of `spawnCloneProcess` and `waitForCloneProcess`, so that the message will be captured in `summary.json`.

```
```java
ErrorSummary.getInstance().addErrorMessage(config.getDisplayName(), e.getMessage());
```
</panel>
Expand Down Expand Up @@ -358,7 +358,7 @@ Here are some small tasks for you to gain some basic knowledge of the code relat

Add this to `c_summary.scss`.

```
```css
.active-text {
color: mui-color('green');
}
Expand Down Expand Up @@ -485,4 +485,4 @@ You can now proceed to learn the [contributing workflow](workflow.html).

## DevOps

If you want to understand and contribute to the DevOps aspect of RepoSense, you can refer to the [DevOps guide](https://github.com/reposense/RepoSense/wiki/DevOps-guide) for more information.
If you want to understand and contribute to the DevOps aspect of RepoSense, you can refer to the [DevOps guide](devOpsGuide.html) for more information.
2 changes: 1 addition & 1 deletion docs/dg/settingUp.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<box type="info" seamless>

Type `java -version`, `npm -v` and `git --version` respectively on your OS terminal and ensure that you have the correct version of each prerequisite installed.
Type `java -version`, `node -v` and `git --version` respectively on your OS terminal and ensure that you have the correct version of each prerequisite installed.
</box>

<!-- ==================================================================================================== -->
Expand Down
24 changes: 12 additions & 12 deletions docs/dg/styleGuides.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Our coding standards are mostly based on those at [se-education.org/guides](http

## Note on Ternary Operators:
Ternary operators can be used to shorten if-else blocks such as this:
```
```java
LocalDateTime min = ARBITRARY_FIRST_COMMIT_DATE_UTC.withZoneSameInstant(zoneId).toLocalDateTime();
if (!commitInfos.isEmpty()) {
min = commitInfos.get(0).getTime();
Expand All @@ -31,7 +31,7 @@ return min;
```

The result would look something like this:
```
```java
return (commitInfos.isEmpty())
? ARBITRARY_FIRST_COMMIT_DATE_UTC.withZoneSameInstant(zoneId).toLocalDateTime()
: commitInfos.get(0).getTime();
Expand All @@ -48,16 +48,16 @@ In addition to what has been mentioned in the [**Java** coding standard (SE-EDU)
* This is not necessary (although still recommended) for methods with `@Override` annotations if Javadoc is used. However, if the method that is being overriden is part of your code and has Javadoc, all parameters must be described.

Negative Examples:
```
Not okay (Only mentions zoneId parameter):
```java
// Not okay (Only mentions zoneId parameter):
/**
* Returns a {@link LocalDateTime} object adjusted for timezone given by {@code zoneId}.
*/
public LocalDateTime adjustTimeZone(LocalDateTime sinceDate, ZoneId zoneId) {
//Code here
}

Not okay (@param tag used only for zoneId)
// Not okay (@param tag used only for zoneId)
/**
* Returns a {@link LocalDateTime} object by adjusting {@code sinceDate}
* to the timezone given by {@code zoneId}.
Expand All @@ -69,8 +69,8 @@ public LocalDateTime adjustTimeZone(LocalDateTime sinceDate, ZoneId zoneId) {
}
```
Positive Example #1:
```
Okay (No @param tags):
```java
// Okay (No @param tags):
/**
* Returns a {@link LocalDateTime} object by adjusting {@code sinceDate}
* to the timezone given by {@code zoneId}.
Expand All @@ -80,8 +80,8 @@ public LocalDateTime adjustTimeZone(LocalDateTime sinceDate, ZoneId zoneId) {
}
```
Positive Example #2:
```
Okay (@param tags used for all inputs):
```java
// Okay (@param tags used for all inputs):
/**
* Returns a {@link LocalDateTime} object by adjusting {@code sinceDate}
* to the timezone given by {@code zoneId}.
Expand All @@ -98,8 +98,8 @@ public LocalDateTime adjustTimeZone(LocalDateTime sinceDate, ZoneId zoneId) {
* This requirement does not apply to test code.
* One `@throws` tag per unique exception.
* The order of exceptions in the `@throws` tag block should match that of the method's `throws` statement.
```
Not okay (order of exceptions in tag block and method signature do not match):
```java
// Not okay (order of exceptions in tag block and method signature do not match):
/**
* Returns a {@link LocalDateTime} object from {@code dateString}.
*
Expand All @@ -111,7 +111,7 @@ public LocalDateTime parseDate(String dateString) throws NullPointerException, P
// Code here
}

Should be:
// Should be:
/**
* Returns a {@link LocalDateTime} object from {@code dateString}.
*
Expand Down
3 changes: 2 additions & 1 deletion docs/ug/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ The section below provides explanations for each of the flags.
<div id="section-assets">

**`--assets ASSETS_DIRECTORY`**: Specifies where to place assets for report generation.
* Parameter: `ASSETS_DIRECTORY` The directory containing the assets files. A `favicon.ico` file can be placed here to customize the favicon of the dashboard.
* Parameter: `ASSETS_DIRECTORY` The directory containing the assets files. A `favicon.ico` file can be placed here to customize the favicon of the dashboard,
while a `title.md` file can be placed to customize the header of the report using [Markdown syntax](https://www.markdownguide.org/basic-syntax/).
* Alias: `-a`
* Example: `--assets ./assets` or `-a ./assets`

Expand Down
6 changes: 3 additions & 3 deletions docs/ug/configFiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ Date: Fri Feb 9 19:13:13 2018 +0800
```
`ActualGitHostId` and `ConfiguredAuthorName` are both `Git Author Name` of the same author.<br>
To find the author name that you are currently using for your current git repository, run the following command within your git repository:
``` {.no-line-numbers}
``` shell {.no-line-numbers}
git config user.name
```
To set the author name to the value you want (e.g., to set it to your GitHub username) for your current git repository, you can use the following command ([more info](https://www.git-tower.com/learn/git/faq/change-author-name-email)):
``` {.no-line-numbers}
``` shell {.no-line-numbers}
git config user.name "YOUR_AUTHOR_NAME”
```
To set the author name to use a default value you want for future git repositories, you can use the following command:
``` {.no-line-numbers}
``` shell {.no-line-numbers}
git config --global user.name "YOUR_AUTHOR_NAME”
```
RepoSense expects the Git Author Name to be the same as author's username on the Git hosting platform (GitHub, GitLab, BitBucket). If an author's `Git Author Name` is different from their username on the Git hosting platform, the `Git Author Name` needs to be specified in the standalone config file. If the author has more than one `Git Author Name`, multiple values can be entered too.
Expand Down
21 changes: 20 additions & 1 deletion frontend/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,26 @@
}
],
"@typescript-eslint/member-delimiter-style": "error",
"@typescript-eslint/type-annotation-spacing": "error"
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/array-type": [
"error",
{
"default": "array-simple",
"readonly": "array-simple"
}
]
}
},
{
"files": ["*.vue"],
"rules": {
"@typescript-eslint/array-type": [
"error",
{
"default": "generic",
"readonly": "generic"
}
]
}
}
]
Expand Down
4 changes: 3 additions & 1 deletion frontend/.stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"scss/no-global-function-names": null,
"selector-type-no-unknown": null,
"at-rule-no-unknown": null,
"no-duplicate-selectors": null
"no-duplicate-selectors": null,
"block-opening-brace-space-before": "always",
"declaration-colon-space-before": "never"
}
}
4 changes: 4 additions & 0 deletions frontend/cypress/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ Cypress.Screenshot.defaults({

beforeEach(() => {
cy.visit('/');
cy.intercept({
method: 'GET',
url: '/title.md',
}, '# RepoSense Intro').as('getTitleMd');
});
11 changes: 11 additions & 0 deletions frontend/cypress/tests/chartView/chartView_zoomFeature.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ describe('range changes in chartview should reflect in zoom', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('jamessspanggg');
cy.get('input[name="until"]:visible')
.type('2023-12-31');

cy.get('body').type(zoomKey, { release: false })
.get('#summary-charts .summary-chart__ramp .ramp')
.first()
Expand All @@ -277,6 +280,9 @@ describe('range changes in chartview should reflect in zoom', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('jamessspanggg');
cy.get('input[name="until"]:visible')
.type('2023-12-31');

cy.get('body').type(zoomKey, { release: false })
.get('#summary-charts .summary-chart__ramp .ramp')
.first()
Expand All @@ -303,6 +309,9 @@ describe('range changes in chartview should reflect in zoom', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('jamessspanggg');
cy.get('input[name="until"]:visible')
.type('2023-12-31');

cy.get('body').type(zoomKey, { release: false })
.get('#summary-charts .summary-chart__ramp .ramp')
.first()
Expand All @@ -329,6 +338,8 @@ describe('range changes in chartview should reflect in zoom', () => {
cy.get('div.mui-textfield.search_box > input:visible')
.should('be.visible')
.type('jamessspanggg');
cy.get('input[name="until"]:visible')
.type('2023-12-31');

cy.get('body').type(zoomKey, { release: false })
.get('#summary-charts .summary-chart__ramp .ramp')
Expand Down
Loading

0 comments on commit a59f992

Please sign in to comment.