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

feat: Add URL validation contract and error messages #67

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

LyubomirT
Copy link

Description

Proposed Changes

Fixed issue #33 by adding the necessary error messages, classes, and methods to add the UrlValidationContract.

Review Checklist

  • I have read the Contributing.md
  • Tests have been added or updated to reflect the changes (if applicable).
  • An entry has been added to the changelog / My PR does not require a new changelog entry.
  • The documentation in Portuguese has been updated or created, if necessary.
  • If documentation was created, the update of the English file.
  • I have documented my changes in the code, adding docstrings and comments. Instructions
  • The code follows the project's style guidelines and coding standards.
  • All tests pass. Instructions
  • The Pull Request has been tested locally. Instructions
  • There are no merge conflicts.

Additional Comments (optional)

Related Issue

#33

Closes #33

Copy link
Owner

@fazedordecodigo fazedordecodigo left a comment

Choose a reason for hiding this comment

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

First of all, thank you very much for your contribution.

Please verify as the tests are not passing.

image

@fazedordecodigo
Copy link
Owner

Please check the existing conflict as well.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 suggestion.

Comments skipped due to low confidence (4)

tests/validations/test_url_validation_contract.py:18

  • The test case for 'None' value is not necessary as 'None' is not a valid string input for URL validation. Consider removing this test case.
(None, False),

tests/validations/test_url_validation_contract.py:36

  • The test case for 'None' value is not necessary as 'None' is not a valid string input for URL validation. Consider removing this test case.
(None, True),

tests/validations/test_url_validation_contract.py:54

  • The test case for 'None' value is not necessary as 'None' is not a valid string input for URL validation. Consider removing this test case.
(None, True),

tests/validations/test_url_validation_contract.py:72

  • The test case for 'None' value is not necessary as 'None' is not a valid string input for URL validation. Consider removing this test case.
(None, True),

@@ -1,5 +1,10 @@
from flunt.constants import MAX_LENGTH, REQUIRED

IS_URL_ERROR_MESSAGE = lambda key: f"{key} is not a valid URL."
IS_URL_OR_EMPTY_ERROR_MESSAGE = lambda key: f"{key} is not a valid URL or empty."
IS_NOT_URL_ERROR_MESSAGE = lambda key: f"{key} is a valid URL."
Copy link
Preview

Copilot AI Nov 16, 2024

Choose a reason for hiding this comment

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

The error message 'key is a valid URL' is unclear. It should be changed to 'key should not be a valid URL.'

Suggested change
IS_NOT_URL_ERROR_MESSAGE = lambda key: f"{key} is a valid URL."
IS_NOT_URL_ERROR_MESSAGE = lambda key: f"{key} should not be a valid URL."

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
01 - Enhancement New feature or request
Projects
Status: Review
Development

Successfully merging this pull request may close these issues.

Add UrlValidationContract
2 participants