Skip to content

Improve flake8 checks#1132

Merged
jd merged 10 commits into
DataDog:masterfrom
jd:better-flake8
Nov 19, 2019
Merged

Improve flake8 checks#1132
jd merged 10 commits into
DataDog:masterfrom
jd:better-flake8

Conversation

@jd

@jd jd commented Nov 13, 2019

Copy link
Copy Markdown
Contributor

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

@majorgreys majorgreys left a comment

Copy link
Copy Markdown
Contributor

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

jd commented Nov 13, 2019

Copy link
Copy Markdown
Contributor Author

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
jd added 4 commits November 14, 2019 11:53
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.
jd added 3 commits November 14, 2019 17:06
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.

2 participants