Skip to content

Fix password generator length validation - #15757

Open
dbhoopesh1-tech wants to merge 3 commits into
TheAlgorithms:masterfrom
dbhoopesh1-tech:master
Open

dbhoopesh1-tech wants to merge 3 commits into
TheAlgorithms:masterfrom
dbhoopesh1-tech:master

Conversation

@dbhoopesh1-tech

@dbhoopesh1-tech dbhoopesh1-tech commented Nov 13, 2026 •

Copy link
Copy Markdown

Add validation for minimum password length requirement.

Describe your change

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Add or change doctests? -- Note: Please avoid changing both code and tests in a single pull request.
  • Documentation change?

Checklist

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues, then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

Add validation for minimum password length requirement.
@algorithms-keeper algorithms-keeper Bot added awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files tests are failing Do not merge until tests pass labels Nov 13, 2026

@Mohit-Gaur75 Mohit-Gaur75 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for working on this validation!

There is an IndentationError in the if block where raise ValueError is not indented 8 spaces (4 spaces deeper than if), which is why the ruff and build CI checks are failing.

Please see the suggestion below to fix the indentation. Additionally, per the repository's contributing guidelines, consider adding a doctest to demonstrate this ValueError when i < len(chars_incl).

Comment thread other/password.py Resolved
@Charlie30157

Copy link
Copy Markdown

Hi, I would like to work on this issue and help get the PR into a mergeable state.

Please let me know if I can take this up. Thanks!

@Mohit-Gaur75

Copy link
Copy Markdown

Hi @Charlie30157, thanks for offering to help!

Just to clarify, this is an open Pull Request submitted by @dbhoopesh1-tech rather than an issue, so only the author (or repository maintainers) can push commits to this branch.

@dbhoopesh1-tech: Are you still planning to update this PR with the indentation fix and doctest? If you're busy or unable to continue, please let us know so @Charlie30157 or another contributor can help finish it.

@Charlie30157: If there's no response from the author in the next 1–2 days, feel free to open a fresh PR with the validation, proper indentation, and accompanying doctests, referencing this PR (Supersedes #15757) and co-authoring @dbhoopesh1-tech.

@dbhoopesh1-tech

Copy link
Copy Markdown
Author

Today i will fix it and sorry for the delay @Mohit-Gaur75

Co-authored-by: Mohit-Gaur75 <mohit29102006@gmail.com>
@algorithms-keeper algorithms-keeper Bot removed the tests are failing Do not merge until tests pass label Nov 21, 2026
Add docstring to alternative_password_generator function.
@dbhoopesh1-tech

Copy link
Copy Markdown
Author

Hi @Mohit-Gaur75, I've fixed the indentation and added the doctest for the ValueError case. All CI checks are passing now—ready for your review!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants