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/3307/detect-invalid-file-input #3325

Merged
merged 20 commits into from
Jun 21, 2023

Conversation

moritz-suckow-mw
Copy link
Collaborator

Detect invalid file input

Issue: #3307

Description

This PR adds validation for file input for all parsers, by checking a row of conditions (existence, non-emptiness, ..., for details look at the specification in the issue).

@moritz-suckow-mw moritz-suckow-mw linked an issue May 30, 2023 that may be closed by this pull request
@moritz-suckow-mw
Copy link
Collaborator Author

Regarding the code smell from Sonar: I would ignore it. Moving the return out of a double nested if, is in my opinion, not good for the code's readability.

@moritz-suckow-mw
Copy link
Collaborator Author

Currently this feature is implemented in a way, that invalid resources can only be detected when running a command. That means when using the interactive parser or parser suggestions, the user first answers all questions to configure the parser, the parser/s start/s running and THEN the user gets warned if files/folders do not exist or are invalid.

Is that okay for now or should this PR also implement a warning when configuring?

@moritz-suckow-mw moritz-suckow-mw force-pushed the feature/3307/detect-invalid-file-input branch from 53e9b36 to 2720f6b Compare June 7, 2023 08:32
@phanlezz
Copy link
Collaborator

Small thing that should get changed:
Currently there is no error code, if a parser get stopped after configuration, and the "parser suggestions" thinks it executed correctly. -> Still tries to merge in the end
A user could miss the fact that one parser did not execute -> The hole execution should stop

@sonarcloud
Copy link

sonarcloud bot commented Jun 21, 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 1 Code Smell

96.4% 96.4% Coverage
0.0% 0.0% Duplication

@sonarcloud
Copy link

sonarcloud bot commented Jun 21, 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

Copy link
Collaborator

@phanlezz phanlezz left a comment

Choose a reason for hiding this comment

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

LGTM

@phanlezz phanlezz merged commit 8655014 into main Jun 21, 2023
@phanlezz phanlezz deleted the feature/3307/detect-invalid-file-input branch June 21, 2023 09:02
@moritz-suckow-mw
Copy link
Collaborator Author

Maybe after changing the action following invalid input from just printing a message and returning to throwing an exception we should also adapt the tests to check if an exception gets thrown?

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.

Detect invalid file input
2 participants