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

Add input validation #52

Merged
merged 7 commits into from
Dec 17, 2023
Merged

Conversation

nikele2001
Copy link
Collaborator

No description provided.

@nikele2001 nikele2001 marked this pull request as draft December 15, 2023 18:07
Copy link

codecov bot commented Dec 15, 2023

Codecov Report

Attention: 174 lines in your changes are missing coverage. Please review.

Comparison is base (66ea124) 5.72% compared to head (330d4da) 5.58%.

Files Patch % Lines
src/util/userInput.ts 0.00% 84 Missing and 1 partial ⚠️
src/commands/viewMainMenuScene.ts 0.00% 67 Missing ⚠️
src/commands/addProjectScene.ts 0.00% 19 Missing ⚠️
src/models/sampleTest.ts 0.00% 2 Missing ⚠️
src/models/TestAlgorithmUtil.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main     #52      +/-   ##
========================================
- Coverage   5.72%   5.58%   -0.14%     
========================================
  Files         36      36              
  Lines       1921    1968      +47     
  Branches      41      41              
========================================
  Hits         110     110              
- Misses      1778    1825      +47     
  Partials      33      33              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nikele2001 nikele2001 marked this pull request as ready for review December 16, 2023 16:21
Copy link
Collaborator

@sopa301 sopa301 left a comment

Choose a reason for hiding this comment

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

LGTM

'Please enter a valid project name. A project name needs to be at least 3 characters long and cannot start with /.',
);
}
const text = getTextFromTextMessages(ctx);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like this refactor. I would do it the same way too.

* @param text - The text to check

*/
export const validateProjectName = (text: string) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe the Project class already has this method

* Checks if a string is a valid project description.
* @param text - The text to check
*/
export const validateProjectDescription = (text: string) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This too

@sopa301 sopa301 merged commit 88b7d56 into CarelessLlama:main Dec 17, 2023
3 of 5 checks passed
@nikele2001 nikele2001 deleted the Branch-Input-Validation branch December 17, 2023 17:04
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.

2 participants