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

[Lint] Add flake8-bugbear #19053

Merged
merged 2 commits into from
Oct 4, 2021
Merged

[Lint] Add flake8-bugbear #19053

merged 2 commits into from
Oct 4, 2021

Conversation

jjyao
Copy link
Collaborator

@jjyao jjyao commented Oct 1, 2021

Why are these changes needed?

flakey-bugbear has some extra checks for python anti-patterns like mutable default argument.
We can iterate on what checks to include/exclude.

Related issue number

Checks

  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Copy link
Contributor

@simon-mo simon-mo left a comment

Choose a reason for hiding this comment

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

Can you add it to requirements txt so it runs on lint?

@jjyao
Copy link
Collaborator Author

jjyao commented Oct 3, 2021

Can you add it to requirements txt so it runs on lint?

Which file you are talking about? I have already added it to python/requirements_linters.txt.

@@ -83,6 +83,10 @@ if [[ $(flake8 --version) != *"flake8_quotes"* ]]; then
echo "WARNING: Ray uses flake8 with flake8_quotes. Might error without it. Install with: pip install flake8-quotes"
fi

if [[ $(flake8 --version) != *"flake8-bugbear"* ]]; then
echo "WARNING: Ray uses flake8 with flake8-bugbear. Might error without it. Install with: pip install flake8-bugbear"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why don't we just fail it here?

@rkooo567 rkooo567 merged commit 7588bfd into ray-project:master Oct 4, 2021
@jjyao jjyao deleted the jjyao/bugbear branch October 4, 2021 15:03
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.

4 participants