-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
python: Integrate linting tools #15922
Conversation
4ba1e2e
to
fa71a1c
Compare
Signed-off-by: Ryan Northey <ryan@synca.io>
coverage is here https://storage.googleapis.com/envoy-pr/15922/tooling/index.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks solid, but there is a lot, so I'm asking for some high-level due diligence before checking this in.
to be fair, the majority of added code is unit tests. Ive done some things to try and cut this down (ie using "parametrization") it could be cut further, but only at the cost of a significant increase in complexity - ive tried to balance the complexity <> brevity - the tests inevitably have to be read/changed as the code changes The other point re the voluminous code. Ive tried to abstract away the common patterns for our needs in terms of python tooling - this makes the actual implementation code much less, and far easier to test. Pretty much all of our current tooling could imho benefit from being rewritten/tested using these classes, which i believe will cut down a significant amount of existing code |
this is certainly something ive thought about quite a lot. There is not easy answers, there are definitely many ways the aims here could have been acheived. In my thinking/design the requirements of the checker are a super set of the runner - hence their entanglement. Broadly, the requirements of the runner are:
I have often lamented that python doesnt have a Regarding argparse - there is another pattern/approach that i could have taken - click I didnt do this - it would have only provided one aspect of what is required and would enforce another layer/pattern which most likely would not have reduced code. Also it is a functional/procedural approach - which imhe is a lot harder to write tests for. Ultimately its another thing to learn - The next candidate in terms of generics would be attrs. Im mindful that some pretty expert opinion argues that no matter what the question The checker class adds some additional features/requirements
i dont know of any generic checker class/es - any search i make returns There are also a couple of orthogonal (to both runner and checker) considerations:
wrt to subshell forking - re bazel - i have searched, pypi and google, and to my surprise there is not a |
@phlax fair, thanks for the detailed explanation, it sounds like the homework has been done here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, modulo comments.
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io>
@htuch should be good for final review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
/lgtm deps |
Signed-off-by: Ryan Northey <ryan@synca.io> Signed-off-by: Douglas Reid <douglas-reid@users.noreply.github.com>
Signed-off-by: Ryan Northey <ryan@synca.io>
Signed-off-by: Ryan Northey <ryan@synca.io> Signed-off-by: Gokul Nair <gnair@twitter.com>
Signed-off-by: Ryan Northey ryan@synca.io
Commit Message: python: Integrate linting tools
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Deprecated:]
[Optional API Considerations:]