Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
158f01e
Add ts dev lint domains and install-hooks on the commands/dev layout
aram356 Jul 10, 2026
c2703eb
Fix lint fixture committer identity and spec markdown formatting
aram356 Jul 17, 2026
eb18c83
Merge branch 'main' into feature/check-domains-spec
aram356 Jul 19, 2026
231abb9
Merge branch 'main' into feature/check-domains-spec
aram356 Aug 1, 2026
2ddccb9
Merge branch 'main' into feature/check-domains-spec
aram356 Aug 18, 2026
c0ffbfc
Address review: fix self-exclusion path, hook safety, subdir discovery
aram356 Sep 6, 2026
d86e4aa
Merge branch 'main' into feature/check-domains-spec
aram356 Sep 6, 2026
db714df
Merge branch 'main' into feature/check-domains-spec
aram356 Sep 7, 2026
1c2914a
Fix dead link to the design spec in the lint-domains plan
aram356 Sep 7, 2026
026fafc
Merge branch 'main' into feature/check-domains-spec
aram356 Sep 8, 2026
fbbb6ae
Install the pre-commit hook into .git/hooks instead of repointing cor…
aram356 Sep 11, 2026
4c510b2
Canonicalize the whole URL authority before the allowlist check
aram356 Sep 11, 2026
76c7b26
Treat renames from unscanned paths as additions in diff modes
aram356 Sep 11, 2026
0c9ba26
Narrow the self-exclusion to the linter's own files and ignore extens…
aram356 Sep 11, 2026
96e8371
Pin fixture repositories to main regardless of init.defaultBranch
aram356 Sep 11, 2026
e48dd8b
Address the smaller lint domains review findings
aram356 Sep 11, 2026
f9eab1c
Merge remote-tracking branch 'origin/main' into feature/check-domains…
aram356 Sep 11, 2026
7077b7a
Record the shell-script scope gap and format the check-domains spec
aram356 Sep 11, 2026
0da2520
Drop em dashes from new doc comments
aram356 Sep 11, 2026
0a0bfea
Merge branch 'main' into feature/check-domains-spec
aram356 Sep 11, 2026
875ca36
Close four hook and host-extraction bypasses in ts dev lint domains
aram356 Sep 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,40 @@ Consistency is the most important. Following the existing Rust style, formatting

Style and format will be enforced with a linter when PR is created.

## :lock: Pre-commit URL-host linter

The `ts` CLI ships a source/config/docs linter that flags non-allowlisted URL
hosts (`ts dev lint domains`). Install the managed pre-commit hook once per
checkout so staged changes are checked before every commit:

```bash
# Build/install the host CLI first (see the README Quick Start), then:
ts dev install-hooks
```

This writes a `pre-commit` hook into git's own hook directory (`.git/hooks`,
shared by every linked worktree of the clone) that runs
`ts dev lint domains --staged`. It never edits git configuration and never
writes into the working tree. If `.git/hooks/pre-commit` already exists and was
not written by this command, it refuses; re-run with `--force` to replace it
(the previous hook is backed up next to it and the backup path is printed). If
`core.hooksPath` is set in any git config scope, git does not run hooks from
`.git/hooks`, so the command refuses and prints the value; add
`ts dev lint domains --staged` to the pre-commit hook in that directory instead.
To uninstall, delete `.git/hooks/pre-commit` (and restore any `pre-commit.bak.*`
backup). To scan the whole checkout on demand:

```bash
# Full working-tree audit. Diagnostic only for now: it reports the repo's
# pre-existing violations, so a non-zero exit here is expected today.
ts dev lint domains
ts dev lint domains --changed-vs origin/main # only lines added vs a ref
```

To allow a new host, add it to the allowlist constants in
`crates/trusted-server-cli/src/commands/dev/lint/domains.rs`; to suppress a
single line, append `// allow-domain: <host>` in a comment.

## :warning: Error Handling

We use [error-stack](https://docs.rs/error-stack/latest/error_stack/) for error handling to provide rich context and traceability.
Expand Down
Loading
Loading