-
Notifications
You must be signed in to change notification settings - Fork 343
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
Finish updating CTS to pass pylint and pyflake #3820
base: main
Are you sure you want to change the base?
Conversation
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.
Looking good.
I didn't look closely at the "drop make_test_group" commit. You and I have talked about other possible approaches in Slack, so it's not worth the tedium of review until we've settled on one.
This PR is already too big. I'm going to split it into one that's everything before dealing with make_test_group, and another that's that and everything after it. |
Just like everything else in cts/, we need to tell pylint to not worry about import order, file names, or comparisons at the top of the file.
A bunch of these strings are giant anyway and run well past the 80 character mark. Several were still continued onto a second line even though none of them are the longest description. So just condense them into single lines.
This is just the standard technique of inverting conditionals in order to return early, and then unindenting all the code after the conditional.
This is just referenced in one spot, there's no need to have it be a variable.
Fixing this is a larger problem than is addressable in this patch set - it requires rethinking how cts-scheduler is put together, which I don't want to work on at the moment. In the interest of running pylint and pyflake as part of the CI process without failing every build, I'm disabling this warning for now.
Yes, we know there's a lot of duplicate code in some of our regression test tools. In the interest of running pylint and pyflake as part of the CI process without failing every build, I'm disabling this warning for now.
This is a list of generated python scripts that can have pylint and pyflake run against them. It exists because we were working on these scripts one at a time, and I didn't want to overwhelm the results with tons of errors from scripts we hadn't gotten around to yet. The problem with this is that sometimes, we forget to add scripts to the list. That's the case with cts-cli, which is why it still needs to be converted to using f-strings. When we convert cts-schemas to python, this can all go away and we can use test_SCRIPTS instead.
The string substitutions I was doing with s.format() through the apply_substitutions function won't work once we move to f-strings. I don't think that function is doing anything special, however, so we can just get rid one substitution it's performing at a time. This removes all uses of {shadow} that don't occur in a string with some other substitution.
Just like the previous commit, there's still places where we can't completely switch over to f-strings for performing this substition, so it has to stay in the apply_substitutions function for now. However, there are several places we no longer need to call that function because the only thing we were substituting was cts_cli_home. Additionally, test_home wasn't being substituted anywhere so it can go.
ff3bfd3
to
4e64a39
Compare
Updated to address review comments, including a new patch at the end to deal with extra whitespace. |
I originally also wanted to include pylint and pyflake as part of "make check", but then I'd have to BuildRequires them and I don't think we want to do that (I haven't checked, but those tools may not be in all supported OSes).