pre-commit authenticating to gitlab
Asked Answered
I

1

5

I'm new to SQLFluff and am interested in a pre-commit check of changed files for rule violations. SQLFluff is working correctly, and to get it working with pre-commit I'm following the guide found here, but am confused by pre-commit asking for git credentials before doing anything.

After entering a commit message, I see:

[INFO] Initializing environment for *my gitlab URL*

Username for '*my gitlab URL*':

My org does everything through SSO so I don't have the password to give. No guide or blog post detailing the set up of pre-commit (at least that I can find) shows or says anything about credentials or configuring authentication. Running pre-commit against a file using a terminal command yields the same result. From what I understand, the provided SQLFluff hooks are client side, so I don't know why authenticating to gitlab would be necessary. I feel like I am missing something obvious, but I've done my searching and came up short. Much thanks to anybody who can tell me what I'm missing!

Inotropic answered 20/10, 2021 at 20:28 Comment(4)
please show your configuration -- I suspect you're not following the directions and instead incorrectly listing your own repository instead of the sqlfluff oneDermatosis
You are absolutely correct, I had added my own git address on autopilot. Changing it to the proper URL got me a step further...now I'm investigating why .pre-commit-hooks.yaml is not being created. I've followed the steps listed on the official install page but no luck yet.Inotropic
Looks like I needed to run pre-commit autoupdate to get that file.Inotropic
Please provide enough code so others can better understand or reproduce the problem.Highpressure
W
10

In my case when trying flake8 on pre-commit, I had same issue, my configuration file was trying to get the repo from gitlab. Changing that to github solved the issue. Hope that would help!

Wringer answered 15/11, 2022 at 9:29 Comment(3)
Thanks. That's weird that they have different implementation for Github and GitLab.Govern
Thank you, this solved it also for me. I found more explanation here: reddit.com/r/Python/comments/yvfww8/…Translucent
Solved the issue for me as wellVehicle

© 2022 - 2024 — McMap. All rights reserved.