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

Flake8 ignore #134

Merged
merged 5 commits into from Aug 26, 2021
Merged

Flake8 ignore #134

merged 5 commits into from Aug 26, 2021

Conversation

briancohan
Copy link
Contributor

Reduced the number of error codes ignored by flake8 in the tox.ini file.

The main goal was to add more structure to the docstrings, however additional codes were removed. No functional changes were made in the codebase. The only "code" that was changed what altering the tests from assert <cond> == True to assert <cond> is True.

For the error codes that remain, the meaning of the error codes has been provided in tox.ini.

Copy link
Contributor

@eniraa eniraa left a comment

Choose a reason for hiding this comment

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

Wouldn't it be more pythonic to use assert <cond> directly? Or is there actually a need to check that these tests result in booleans?

@@ -1 +1,2 @@
"""Exmple file that raises ZeroDivisionError."""
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be Example rather than Exmple.

@briancohan
Copy link
Contributor Author

Wouldn't it be more pythonic to use assert <cond> directly? Or is there actually a need to check that these tests result in booleans?

Probably, but the specific error code is checking for == when True/False/None are used. I was just trying to reduce the number of ignored styles.

Copy link
Owner

@VagishVela VagishVela left a comment

Choose a reason for hiding this comment

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

Looks good!

One comment, be careful when using is vs ==, as is will work for cached values such as a or true but not for values such as [1].

@VagishVela
Copy link
Owner

@briancohan Just wondering why the switch from == to is, as we will still need to use == if we are comparing two objects or arrays, as is will return false.

@briancohan
Copy link
Contributor Author

@briancohan Just wondering why the switch from == to is, as we will still need to use == if we are comparing two objects or arrays, as is will return false.

I don't think the == vs. is applies to most comparisons. My understanding is just when True/False/None are involved (though I could be wrong). If we find this to be an actual issue, then by all means, we can revert the code.

@briancohan briancohan merged commit 66d2ff7 into main Aug 26, 2021
@briancohan briancohan deleted the flake8-ignore branch August 26, 2021 11:53
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.

None yet

3 participants