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 pre-commit failing - Add B023 to .flake8 ignores #7941

Closed
wants to merge 12 commits into from

Conversation

CaedenPH
Copy link
Contributor

@CaedenPH CaedenPH commented Nov 1, 2022

Describe your change:

Fixes #7940

  • 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 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 commit message contains Fixes: #{$ISSUE_NO}.

@algorithms-keeper algorithms-keeper bot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed labels Nov 1, 2022
.flake8 Outdated Show resolved Hide resolved
Co-authored-by: Christian Clauss <cclauss@me.com>
.flake8 Outdated Show resolved Hide resolved
@CaedenPH
Copy link
Contributor Author

CaedenPH commented Nov 2, 2022

#@cclauss the point is that those code snippets raise B023, which is automatically stripped by yesqa for some reason, failing the pre commit

@CaedenPH CaedenPH mentioned this pull request Nov 2, 2022
14 tasks
@CaedenPH
Copy link
Contributor Author

CaedenPH commented Nov 2, 2022

Huh, seems you can't do in-line comments in a .flake8 file

@CaedenPH
Copy link
Contributor Author

CaedenPH commented Nov 2, 2022

@cclauss Lots of failures in pre-commit due to previous code.
I wonder why they're only coming up now
Should I fix these issues?

@cclauss cclauss changed the title FIx pre-commi failing - Add B023 to .flake8 ignores FIx pre-commit failing - Add B023 to .flake8 ignores Nov 2, 2022
@cclauss
Copy link
Member

cclauss commented Nov 2, 2022

I think you should close this PR and start from scratch.

I am worried about ignoring all instances of B023 because the problem is real even though there are some false alarms. I would be happier to see us using # noqa: B023 in specific situations rather than a project-wide ignore.

@CaedenPH
Copy link
Contributor Author

CaedenPH commented Nov 2, 2022

Starting again sounds like a good idea but I'm not entirely sure how to fix this without ignoring all instances and trusting that the doctests will keep the algorithms on the straight and narrow.
It is another gotcha within our pre-commit that when you add #noqa: B023 to the actual error that the yesqa strips it...

@cclauss
Copy link
Member

cclauss commented Nov 2, 2022

yesqa might be stripping because PyCQA/flake8-bugbear#303 was recently landed and it might have fixed false alarms.

@CaedenPH CaedenPH closed this Nov 2, 2022
@CaedenPH CaedenPH deleted the fix-pre-commit branch November 2, 2022 19:11
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.

Pre-commit failing on genetic_algoirthm/basic_string
2 participants