mirror of
https://codeberg.org/guix/guix.git
synced 2026-01-25 03:55:08 -06:00
teams: Use suitable team identifiers for Codeberg.
The “c++” team has to be called “cpp”. * etc/teams.scm (team-id->forgejo-id): New procedure. (team->codeowners-snippet): Use it. Change-Id: I10619d8833b5c747504f26b7b0eedb9d61bfd812
This commit is contained in:
parent
38b05ff27b
commit
1b7a11efb0
1 changed files with 15 additions and 1 deletions
|
|
@ -1024,13 +1024,27 @@ and REV-END, two git revision strings."
|
|||
(find-team-by-scope (apply diff-revisions
|
||||
(git-patch->revisions patch-file)))))
|
||||
|
||||
(define (team-id->forgejo-id id)
|
||||
"Return a name (string) suitable as a Forgejo team name."
|
||||
(define valid ;"AlphaDashDot"
|
||||
(char-set-union char-set:ascii (char-set #\-) (char-set #\.)))
|
||||
|
||||
(define (valid? chr)
|
||||
(char-set-contains? valid chr))
|
||||
|
||||
(string-map (match-lambda
|
||||
(#\+ #\p) ;special case for "c++"
|
||||
((? valid? chr) chr)
|
||||
(_ #\-))
|
||||
(symbol->string id)))
|
||||
|
||||
(define (team->codeowners-snippet team)
|
||||
(string-join (map (lambda (scope)
|
||||
(format #f "~50a @guix/~a"
|
||||
(if (regexp*? scope)
|
||||
(regexp*-pattern scope)
|
||||
(regexp-quote scope))
|
||||
(team-id team)))
|
||||
(team-id->forgejo-id (team-id team))))
|
||||
(team-scope team))
|
||||
"\n"
|
||||
'suffix))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue