-
Notifications
You must be signed in to change notification settings - Fork 21
Pre-commit demo #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tstirrat15
wants to merge
13
commits into
main
Choose a base branch
from
pre-commit-demo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Pre-commit demo #148
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3962a2b
Install biome and uninstall old ones
tstirrat15 fd7eab1
Add biome configuration
tstirrat15 33d494a
Get rid of old config
tstirrat15 e1e5520
Migrate to v2
tstirrat15 fded844
Run formatter on src files
tstirrat15 e13587a
Set indent style to spaces and match existing files
tstirrat15 56db94f
Add initial pre-commit config
tstirrat15 e19af1f
Try new pre-commit style
tstirrat15 e5e4af2
Re-run yarn
tstirrat15 256fe02
Add dist to exclude
tstirrat15 ff26e24
Turn off forEach rule
tstirrat15 aed9637
Fix yamllint issues
tstirrat15 40622dd
Make TSC available to local pre-commit hook
tstirrat15 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
repos: | ||
- repo: "https://github.com/adrienverge/yamllint" | ||
rev: "v1.35.1" | ||
hooks: | ||
- id: "yamllint" | ||
- repo: "https://github.com/biomejs/pre-commit" | ||
rev: "v0.4.0" | ||
hooks: | ||
- id: "biome-check" | ||
additional_dependencies: ["@biomejs/biome@1.8.3"] | ||
- repo: "local" | ||
hooks: | ||
- id: "typescript-check" | ||
name: "Check types" | ||
entry: "yarn run tsc --noEmit" | ||
language: "system" | ||
types_or: ["ts"] | ||
# We do this to ensure that type changes in the modified | ||
# files don't change things elsewhere. | ||
pass_filenames: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", | ||
"files": { | ||
"ignore": ["src/authzedapi", "dist"] | ||
}, | ||
"linter": { | ||
"rules": { | ||
"complexity": { | ||
"noForEach": "off" | ||
} | ||
} | ||
}, | ||
"formatter": { | ||
"indentWidth": 2, | ||
"indentStyle": "space" | ||
}, | ||
"json": { | ||
"formatter": { | ||
"enabled": false | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
#!/usr/bin/env -S buf generate buf.build/authzed/api:v1.35.0 --template | ||
#!/usr/bin/env -S buf generate | ||
# To regenerate: | ||
# npm install -g grpc-tools | ||
# ./buf.gen.yaml | ||
version: "v1beta1" | ||
--- | ||
version: "v2" | ||
inputs: | ||
- module: "buf.build/authzed/api:v1.35.0" | ||
plugins: | ||
- name: "ts" | ||
- local: "./node_modules/@protobuf-ts/plugin/bin/protoc-gen-ts" | ||
out: "src/authzedapi" | ||
opt: generate_dependencies,long_type_string,client_grpc1 | ||
path: ./node_modules/@protobuf-ts/plugin/bin/protoc-gen-ts | ||
# protobuf-ts expects this to be set to "all" | ||
# https://github.com/timostamm/protobuf-ts/issues/165#issuecomment-931492639 | ||
strategy: "all" | ||
opt: | ||
- "generate_dependencies" | ||
- "long_type_string" | ||
- "client_grpc1" |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
/** | ||
* Generates a random token with a prefix to support | ||
* unique, idempotent local testing. | ||
* @param prefix | ||
* @returns | ||
* @param prefix | ||
* @returns | ||
*/ | ||
export function generateTestToken(prefix: string): string { | ||
return `${prefix}-${Date.now().toString()}` | ||
} | ||
return `${prefix}-${Date.now().toString()}`; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.