Add support for .gitlab-ci.yaml files#596
Conversation
ea76699 to
5178514
Compare
|
Thanks for filing the issue and PR! I had been under the impression that GitLab only supports the Can you confirm that GitLab supports the There are a couple of things which need to be tweaked for this to merge:
|
|
The root gitlab pipeline config can be customised per repo Personally, I like |
Yeah, that makes total sense to me. If I used GitLab more actively, I could see adopting something similar. If you customize the path at which the file is found, my initial thought is that it makes sense for the repos:
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.33.0
hooks:
# match any YAML files in .gitlab/ ending in '-ci'
- id: check-gitlab-ci
files: ^\.gitlab/.*-ci\.(yaml|yml)$This PR is changing the default rule to match on I looked at schemastore, and they have some very permissive globs for gitlab-ci. Perhaps the correct solution is to follow their rule, which is to accept |
|
As described by RFC 9512, Paragraph 2.1:
As @andrew-rowson-lseg pointed out, it's not the default behavior but, since our company is following the suggestions of the RFC, we are actually using |
Done!
Should I revert the changes in |
You don't have to explicitly revert, but you need to update the file where the hook is really defined ( I've documented this very briefly here in the contrib doc. A few people have been confused by it, so I think I need to update it to be a bit clearer in terms of signposting. If you update |
|
Oh, I forgot to say! I'm okay with expanding to However, I think it's best to be even more permissive and follow the schemastore matching rule: https://github.com/SchemaStore/schemastore/blob/98eeb8ccb7cbf6617c848136a0041a197fd72678/src/api/json/catalog.json#L2712-L2717 I can do that as a fast-follow after this work, or if you would rather expand the match to follow the above rule, I'd be happy for that to be included in this PR. |
sirosen
left a comment
There was a problem hiding this comment.
I came back to check in on this, and I see two things which I had missed before
- you've already adjusted the catalog file
- the pattern already has a leading
.*, allowing for any directory (actually, probably allowing some weird stuff, likefoo.github-ci.yml, but that's not new...)
So, this looks great! Sorry about the delay, I didn't realize it was ready.
|
Hi @sirosen, Thanks for merging! Honestly I forgot to double-check and answer you so it was a bit my fault too. 🙂 |
Fixes #595