Skip to content

pre-commit: move prospector inside pre-commit #10105

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

Merged
merged 2 commits into from
Mar 8, 2023

Conversation

humitos
Copy link
Member

@humitos humitos commented Mar 5, 2023

  • removes prospector check from tox
  • run prospector check inside pre-commit

This allows developers to auto-run prospector before pushing changes to GitHub and be able to fix these problems locally in a quicker way.

Requires: readthedocs/common#166

- removes `prospector` check from tox
- run `prospector` check inside pre-commit

This allows developers to auto-run prospector _before_ pushing changes to GitHub
and be able to fix these problems locally in a quicker way.
@humitos humitos force-pushed the humitos/pre-commit-prospector branch from 272fd66 to a2cadda Compare March 5, 2023 16:57
@humitos humitos requested a review from ericholscher March 8, 2023 08:34
Copy link
Contributor

@benjaoming benjaoming left a comment

Choose a reason for hiding this comment

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

Yes please ❤️

The workflow of waiting for CI to lint things that aren't automatically linted locally is slow. So this will be a relative improvement and most welcome 👍

After doing this, I think we should seriously consider getting a much faster linting process, though. Having https://raw.githubusercontent.com/readthedocs/readthedocs.org/main/requirements/pip.txt inside pre-commit requirements also seems a bit dramatic.

@humitos
Copy link
Member Author

humitos commented Mar 8, 2023

Having https://raw.githubusercontent.com/readthedocs/readthedocs.org/main/requirements/pip.txt inside pre-commit requirements also seems a bit dramatic.

This is only executed once when the environment is created. Unfortunately, on CircleCI we have to install these requirements each time :/ --but I didn't find a better way of doing this for now. We can explore other alternatives in the future.

@benjaoming
Copy link
Contributor

This is only executed once when the environment is created. Unfortunately, on CircleCI we have to install these requirements each time :/ --but I didn't find a better way of doing this for now. We can explore other alternatives in the future.

If it makes sense from build times, we could open an issue explore putting .pre-commit into a Circle CI cache. AFAIK, pre-commit manages its virtualenvs in a very sophisticated manner so it's quite likely that it could bootstrap from a cache and save to a cache afterwards.

@humitos
Copy link
Member Author

humitos commented Mar 8, 2023

It seems all of us are more or less on board with this change and the one in common/. We can tune it a little more as we go while finding things that are not working as we expect. Also, we can revert if we find it does not work at all.

I'm merging this PR and the one in common as well to start trying this out.

@humitos humitos enabled auto-merge (squash) March 8, 2023 19:03
@benjaoming
Copy link
Contributor

I think this sounds like a great call, and nothing that cannot be reverted if for some reason it doesn't perform well enough. It shouldn't have any impacts, otherwise since it's the same linter.

Because pre-commit is also a local tool, it's much easier to tweak and optimize, and all changes will automatically work in CI 👍

@humitos humitos merged commit 2fd05fa into main Mar 8, 2023
@humitos humitos deleted the humitos/pre-commit-prospector branch March 8, 2023 19:16
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.

3 participants