Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/2952/automate gitlogparser #3041

Merged
merged 31 commits into from Sep 20, 2022

Conversation

MW-Friedrich
Copy link
Contributor

@MW-Friedrich MW-Friedrich commented Sep 13, 2022

Automate the gitlogparser further, to save the users from running even more shell commands

Issue: #2952

Description

When using the GitLogParser, the user needs to execute two commands before being able to actually execute the parser. This is clunky and not very user-friendly. This PR modifies the GitLogParser to now use two subcommands instead - repo-scan and log-scan - which execute the necessary git commands automatically and provide more logical option names for the existing functionality respectively.
The PR also upgrades the testing library to JUnit5, and removes redundant assertion libraries (hamcrest and hamkrest).

charlotteKehm and others added 29 commits August 5, 2022 18:15
Add cleanup todo for later
#2952
Fix ParserDialog appending "[]"
#2952
Remove unused dependencies
#2952
Remove unused dependencies
#2952
fix typos and wrongly formatted tables
#2952
@MW-Friedrich MW-Friedrich marked this pull request as ready for review September 20, 2022 14:38
@MW-Friedrich MW-Friedrich linked an issue Sep 20, 2022 that may be closed by this pull request
15 tasks
@sonarcloud
Copy link

sonarcloud bot commented Sep 20, 2022

[CodeCharta Analysis] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

86.9% 86.9% Coverage
0.0% 0.0% Duplication

@sonarcloud
Copy link

sonarcloud bot commented Sep 20, 2022

[CodeCharta Visualization] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@MW-Friedrich MW-Friedrich merged commit 6be91a9 into main Sep 20, 2022
@MW-Friedrich MW-Friedrich deleted the feature/2952/automate-gitlogparser branch September 20, 2022 15:07
parserStrategy: LogParserStrategy,
metricsFactory: MetricsFactory,
containsAuthors: Boolean,
silent: Boolean = false
): Project {
val namesInProject = readFileNameListFile(pathToNameTree)
val encoding = guessEncoding(pathToLog) ?: "UTF-8"
val namesInProject = readFileNameListFile(gitLsFile)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would always try to not use a abbreviation/acronym in variable names. By that it is mostly hard for new developers to understand the purpose of the variable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I remember talking about this with @Hall-Ma, we a lot of back and forth about this name too. Something like gitFiles or trackedFiles(List) would make the datatype hard to read/guess at a glance. We settled on this since we thought that the "ls" command is well known enough and can be inferred from both the docs and the command description.
I will try think of a new and better name though! :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't get the point that you mean the list command by Ls. :-)
I admit it is a bit tricky to combine the type "File" with the variable name. So I would just sugggest something like listOfRepositoryFiles. But this is nit picking. It is fine for me to keep it for now.

required = true,
description = ["list of all file names in current git project"]
)
private var gitLsFile: File? = null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same effect here.

return tempGitLog
}

private fun createGitLsFile(repoPath: Path): File {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitLogParser: Simplify and automate the process further
5 participants