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

Run pre-commit hooks after inputs redesign to use GenericDataset #143

Merged
merged 2 commits into from
Oct 19, 2024

Conversation

dyastremsky
Copy link
Contributor

@dyastremsky dyastremsky commented Oct 18, 2024

Re-run pre-commit hooks after inputs redesign. Since the new analyze changes will only support Python 3.10+, updating the code here to also only support 3.10+ to use aliases.

genai-perf/tests/test_cli.py Fixed Show fixed Hide fixed
genai-perf/tests/test_cli.py Fixed Show fixed Hide fixed
Update hook

Update test_cli

Remove accidental file

Remove unused variables
@@ -39,7 +39,7 @@ jobs:
fail-fast: false
Copy link
Contributor

Choose a reason for hiding this comment

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

In the future, could we put all formatting-related changes in their own commit or even better in their own PR?

Copy link
Contributor Author

@dyastremsky dyastremsky Oct 19, 2024

Choose a reason for hiding this comment

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

What do you mean? Usually, pre-commit is turned on, so the formatting would happen for every commit. Since it was turned off as part of this development work, re-enabling it immediately ran all the hooks. And then it warned me about types, other static errors, etc., so I fixed those manually, but it wouldn't let me commit without fixing everything.

I could have let the auto-formatting run, then uninstalled pre-commit, pushed a commit with just auto-formatting, re-installed pre-commit, and made any manual changes in a separate commit if that's in line with what you're asking for. Yeah, that sounds like a good strategy if this happens again.

P.S. I agree this is suboptimal and I'd prefer to find ways to avoid disabling pre-commit and creating these kinds of PRs in the future.

Copy link
Contributor

@matthewkotila matthewkotila Oct 19, 2024

Choose a reason for hiding this comment

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

I'm not sure how to achieve it, but I mean literally what I said. I had to read everything way closer because I couldn't tell if it was going to be a formatting related change or some other kind of change (e.g. using a python 3.10 feature or something).

It would be much easier to review if a single commit contained anything related to auto-formatting. Like run precommit without any feature-related changes for the first commit, then future commits are the non-formatting changes, like adding a trialing comma or whatever. That way, as the reviewer, I can skip looking at the commit/changes that auto-format, which saves mental load, and because I trust whatever auto-formatter we're using, and we have testing to make sure auto-formatting doesn't accidentally break anything.

Copy link
Contributor Author

@dyastremsky dyastremsky Oct 19, 2024

Choose a reason for hiding this comment

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

Totally fair. I had originally had it as a separate commit and will do so next time.

Just a heads up that I didn't make the aforementioned change. The trialing comma was actually pre-commit formatting. The only things I did were fixing the errors pre-commit returned, then fixing the 2-3 CLI unit tests that broke when the behavior was fixed. I think you're right though - I can run it just with auto-format and save that as a commit so that you don't need to review that commit.

Thanks again for reviewing so much with such quick turnaround, Matt!

@matthewkotila
Copy link
Contributor

Looks good overall, just some small questions.

@dyastremsky dyastremsky merged commit 809b7c8 into dyas-unit-tests Oct 19, 2024
6 checks passed
@dyastremsky dyastremsky deleted the dyas-precommit branch October 19, 2024 05:32
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