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

Fix some warnings from LGTM #2420

Merged
merged 9 commits into from Sep 13, 2020
Merged

Fix some warnings from LGTM #2420

merged 9 commits into from Sep 13, 2020

Conversation

@Hasenn
Copy link
Contributor

Hasenn commented Sep 13, 2020

Describe your change:

fixes minor issues : variables assigned to themselves, for - else without any break, redundant redefinitions ...

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • 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 have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.
@TravisBuddy
Copy link

TravisBuddy commented Sep 13, 2020

Hey @Hasenn,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: a51aa750-f58e-11ea-b8b5-77c9400cce29
ciphers/enigma_machine2.py Outdated Show resolved Hide resolved
Co-authored-by: Christian Clauss <cclauss@me.com>
@cclauss
Copy link
Member

cclauss commented Sep 13, 2020

Please run this PR thru psf/black. It knows how to format Python code.

@TravisBuddy
Copy link

TravisBuddy commented Sep 13, 2020

Hey @Hasenn,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: a925b2d0-f58f-11ea-b8b5-77c9400cce29
@@ -226,7 +226,9 @@ def has_cycle(self):
break
else:
return True
anticipating_nodes.add(stack[len_stack_minus_one])
# TODO:The following code is unreachable.

This comment has been minimized.

@cclauss

cclauss Sep 13, 2020

Member

If code is unreachable then determine if the lines are useful. If they are then move the return statement below them. If they are not useful then delete them.

This comment has been minimized.

@Hasenn

Hasenn Sep 13, 2020

Author Contributor

i tried.. i can't read that part i don't really understand what it's supposed to do

anticipating_nodes.add(
stack[len_stack_minus_one])
Comment on lines 230 to 231

This comment has been minimized.

@cclauss

cclauss Sep 13, 2020

Member

psf/black will undo this change.

This comment has been minimized.

@Hasenn

Hasenn Sep 13, 2020

Author Contributor

yeah autopep8 did that, i've just pushed after running black

Copy link
Member

cclauss left a comment

LGTM!

@cclauss cclauss merged commit 20e98fc into TheAlgorithms:master Sep 13, 2020
2 checks passed
2 checks passed
codespell
Details
Travis CI - Pull Request Build Passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.