add td extension to the files

This commit is contained in:
Mitchell Hashimoto
2026-02-03 19:48:08 -08:00
parent 089f7f2128
commit d3b8e91ed9
4 changed files with 18 additions and 14 deletions

View File

@@ -48,9 +48,9 @@ The only requirement is [Nu](https://www.nushell.sh/).
### VOUCHED File
See [VOUCHED.example](VOUCHED.example) for the file format. The file is
looked up at `VOUCHED` or `.github/VOUCHED` by default. Create an
empty `VOUCHED` file.
See [VOUCHED.example.td](VOUCHED.example.td) for the file format. The file is
looked up at `VOUCHED.td` or `.github/VOUCHED.td` by default. Create an
empty `VOUCHED.td` file.
Overview:
@@ -61,7 +61,11 @@ platform:username
-platform:denounced-user reason for denouncement
```
The platform prefix (e.g., `github:`) specifies where the user identity comes from. Usernames without a platform prefix are also supported for backwards compatibility.
The platform prefix (e.g., `github:`) specifies where the user identity
comes from. The platform prefix is optional, since most projects exist
within the realm of a single platform. All the commands below take
`--default-platform` flags to specify what platform to assume when none
is present.
### Commands

View File

@@ -40,7 +40,7 @@ export def main [] {
export def "main add" [
username: string, # Username to vouch for (supports platform:user format)
--default-platform: string = "", # Assumed platform for entries without explicit platform
--vouched-file: string, # Path to vouched contributors file (default: VOUCHED or .github/VOUCHED)
--vouched-file: string, # Path to vouched contributors file (default: VOUCHED.td or .github/VOUCHED.td)
--write (-w), # Write the file in-place (default: output to stdout)
] {
let file = if ($vouched_file | is-empty) {
@@ -94,7 +94,7 @@ export def "main gh-manage-by-issue" [
issue_id: int, # GitHub issue number
comment_id: int, # GitHub comment ID
--repo (-R): string = "ghostty-org/ghostty", # Repository in "owner/repo" format
--vouched-file: string, # Path to vouched contributors file (default: VOUCHED or .github/VOUCHED)
--vouched-file: string, # Path to vouched contributors file (default: VOUCHED.td or .github/VOUCHED.td)
--allow-vouch = true, # Enable "lgtm" handling to vouch for contributors
--allow-denounce = true, # Enable "denounce" handling to denounce users
--dry-run = true, # Print what would happen without making changes
@@ -239,7 +239,7 @@ export def "main denounce" [
username: string, # Username to denounce (supports platform:user format)
--default-platform: string = "", # Assumed platform for entries without explicit platform
--reason: string, # Optional reason for denouncement
--vouched-file: string, # Path to vouched contributors file (default: VOUCHED or .github/VOUCHED)
--vouched-file: string, # Path to vouched contributors file (default: VOUCHED.td or .github/VOUCHED.td)
--write (-w), # Write the file in-place (default: output to stdout)
] {
let file = if ($vouched_file | is-empty) {
@@ -283,7 +283,7 @@ export def "main denounce" [
export def "main check" [
username: string, # Username to check (supports platform:user format)
--default-platform: string = "", # Assumed platform for entries without explicit platform
--vouched-file: string, # Path to vouched contributors file (default: VOUCHED or .github/VOUCHED)
--vouched-file: string, # Path to vouched contributors file (default: VOUCHED.td or .github/VOUCHED.td)
] {
let lines = try {
open-vouched-file $vouched_file
@@ -326,7 +326,7 @@ export def "main check" [
export def "main gh-check-pr" [
pr_number: int, # GitHub pull request number
--repo (-R): string = "ghostty-org/ghostty", # Repository in "owner/repo" format
--vouched-file: string = ".github/VOUCHED", # Path to vouched contributors file
--vouched-file: string = ".github/VOUCHED.td", # Path to vouched contributors file
--require-vouch = true, # Require users to be vouched; if false, only denounced users are blocked
--auto-close = false, # Close unvouched PRs with a comment
--dry-run = true, # Print what would happen without making changes
@@ -565,13 +565,13 @@ export def remove-user [
# Find the default VOUCHED file by checking common locations.
#
# Checks for VOUCHED in the current directory first, then .github/VOUCHED.
# Checks for VOUCHED.td in the current directory first, then .github/VOUCHED.td.
# Returns null if neither exists.
def default-vouched-file [] {
if ("VOUCHED" | path exists) {
"VOUCHED"
} else if (".github/VOUCHED" | path exists) {
".github/VOUCHED"
if ("VOUCHED.td" | path exists) {
"VOUCHED.td"
} else if (".github/VOUCHED.td" | path exists) {
".github/VOUCHED.td"
} else {
null
}