-
Notifications
You must be signed in to change notification settings - Fork 51
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
Airgapped ruff-pre-commit. #113
Comments
I'm not very familiar with how gitlab works but did you follow the pre-commit GitLab setup instructions? That it's downloading files is expected but the caching should help reduce the need to do so for subsequent runs. We don't plan on releasing a dedicated pre-commit for GitLab |
there are many places like:
which seems to be directly trying to access the WAN github, or use github variables. |
Can you share an example of how you're using the pre-commit in your GitLab CI pipeline? |
I'm not, I want to start using, I only truly need ruff and mypy. |
Hmm okay, I don't think I understand what you're looking for. You said that you want to run pre-commit on GitLab but it seems you're not? Did you try pre-commit's GitLab setup instructions that I linked above? |
You are correct. looks like there isn't a proper way to do this in our airgapped gitlab. trying to run this:
but even before that.
then I ran, pre-commit install, Now I suppose something is probably missing. |
This overall looks correct and this seems like an issue with your git client not being able to authenticate against your gitlab repository. I'm not sure how I can help you with that. |
That something I probably have to check. I really want to thank you for such quick responses and in depth answers. Do you think that simply taking this repo and changing the .github to .gitlab and uploading it to the gitlab will suffice? |
Thanks for the kind words
I don't think this should be necessary. Pre-commit itself should be independent from where or how you host your repository and it should take care of installing individual checks. Have you tried using the normal repo url instead of uploading this to gitlab? repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.9.2
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format |
It is airgapped. I have no access to the Internet. Therefore no way of accessing it. Sadly in our airgapped env we don't have a github, only enterprised gitlab |
Oh, I assumed Whatever you choose to do is probably going to be specific to your environment. Hve you considered running ruff in a docker container (that you can build and publish once?) You can also try to run ruff using uv (or install with pip). I think there's even a |
I would rather open a discussion but an issue will do.
I want to run ruff-pre-commit in my airgapped gitlab.
Now it should work flowlessly, but looking at the code I see many Installs, and variables that access a github.
Is it possible to just download this repo and upload it into my airgapped gitlab and use it?
Is it something planned?
The text was updated successfully, but these errors were encountered: