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/3274/use-current-directory-if-input-empty #3319

Merged

Conversation

moritz-suckow-mw
Copy link
Collaborator

@moritz-suckow-mw moritz-suckow-mw commented May 26, 2023

Use current working directory if input is empty for parsers

Issue: #3274

Description

This adds a new default value to all parsers where a folder can be input to be parsed. This default value will be the current working directory. A default value will only be set for parsers which accept folders, for all others a hint with the working directory plus an exemplary not existing file will be shown (e.g. working/directory/yourInput.cc.json).

@moritz-suckow-mw moritz-suckow-mw linked an issue May 26, 2023 that may be closed by this pull request
class ParserDialogHelper {

companion object {
fun getInputFiles(isSourceMonitor: Boolean): MutableList<String> {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just made this class to avoid some duplication, only thing new here is the KInquirer hint.

@moritz-suckow-mw
Copy link
Collaborator Author

Should I also adjust the directory question which is asked for the parser suggestions? Currently an empty input is mapped to current directory, but I find the solution here to be better (setting default value to current directory instead of just mapping it).

@ce-bo
Copy link
Collaborator

ce-bo commented Jun 2, 2023

Should I also adjust the directory question which is asked for the parser suggestions? Currently an empty input is mapped to current directory, but I find the solution here to be better (setting default value to current directory instead of just mapping it).

That would be a nice improvement, thank you.

Copy link
Collaborator

@ce-bo ce-bo left a comment

Choose a reason for hiding this comment

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

LGTM :-) Maybe @phanlezz could overtake a short test of the new feature, I am not sure, when I can do this at the moment. Maybe you can present your changes @moritz-suckow?

@phanlezz
Copy link
Collaborator

phanlezz commented Jun 6, 2023

I did some testing and it worked for me :)
We could remove the hint from the gitlogparser, that an empty input would be equal to the current working directory, as the current working directory is already inserted as a path. The underlying functionality that actually then puts a "." as input could be removed as well, because it might be the only parser that does this.
But this is optional, as it is still a feature, but just not really required anymore. But I might missed a use-case here.

@moritz-suckow-mw
Copy link
Collaborator Author

I removed the hint and conversion from the GitLogParser, for now it just aborts when there is no input. This will change soon anyways when #3325 is merged, so I did not put any further work in it.

@sonarcloud
Copy link

sonarcloud bot commented Jun 6, 2023

[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

94.8% 94.8% Coverage
5.4% 5.4% Duplication

@sonarcloud
Copy link

sonarcloud bot commented Jun 6, 2023

[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

@moritz-suckow-mw moritz-suckow-mw merged commit 7802f2a into main Jun 6, 2023
@moritz-suckow-mw moritz-suckow-mw deleted the feature/3274/use-current-directory-if-input-empty branch June 6, 2023 08:52
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.

Use current working directory as default path for file input
3 participants