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

Improve flake8 checks #1132

Merged
merged 10 commits into from Nov 19, 2019
Merged

Improve flake8 checks #1132

merged 10 commits into from Nov 19, 2019

Conversation

jd
Copy link
Contributor

@jd jd commented Nov 13, 2019

Remove quote enforcement

The current quote enforcement is a restrictive and annoying.

Furthermore, it arbitrary enforces single quotes whereas tools like black —
which are now standard in Python ecosystem — sticks to the Python widely used
double quotes.

Add flake8-blind-except

Checks that no except statement is used without specifying an exception type.

flake8: ignore no error

We only ignore W503 in favor of W504 to define where we put the line break
before binary operators.

Add flake8-builtins

This makes sure we pick proper variable names.

Add flake8-logging-format

This makes sure that we use a correct logging format in our log strings.

Enable flake8-rst-docstrings

This fixes various RST directives that we got wrong and log format

flake8: enable flake8-docstrings

@jd jd requested a review from a team as a code owner November 13, 2019 14:02
Copy link
Collaborator

@majorgreys majorgreys left a comment

Choose a reason for hiding this comment

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

I think all but the removal of single quote enforcement seems to be an obvious yes. I'm ok with approving this PR before we make a decision on black but would also like us to have a clear path set out for adopting black if we remove this enforcement.

@jd
Copy link
Contributor Author

jd commented Nov 13, 2019

I'm also working on getting black. As you noticed, this single quote thing will get in the way anyway.

majorgreys
majorgreys previously approved these changes Nov 13, 2019
The current quote enforcement is a restrictive and annoying.

Furthermore, it arbitrary enforces single quotes whereas tools like black —
which are now standard in Python ecosystem — sticks to the Python widely used
double quotes.
Checks that no except statement is used without specifying an exception type.
We only ignore W503 in favor of W504 to define where we put the line break
before binary operators.
This makes sure we pick proper variable names.
This makes sure that we use a correct logging format in our log strings.
This fixes various RST directives that we got wrong and log format
@jd jd changed the title Pull request for better-flake8 Improve flake8 checks Nov 14, 2019
@majorgreys majorgreys self-requested a review November 18, 2019 18:27
@jd jd merged commit 47396c6 into DataDog:master Nov 19, 2019
@jd jd deleted the better-flake8 branch November 19, 2019 10:12
@majorgreys majorgreys added this to the 0.32.0 milestone Dec 18, 2019
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

2 participants