Skip to content
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

fix: enable ruff and pyright checks #914

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
92 changes: 92 additions & 0 deletions .ghjk/lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,55 @@
"crateName": "cargo-udeps",
"locked": true,
"specifiedVersion": true
},
"bciqk32ytmretqjmmjadp4n5737sifnbyxdqkvkq6lvg3w5rxmsku57y": {
"version": "1.1.388",
"buildDepConfigs": {
"cpy_bs_ghrel": {
"version": "3.12.5",
"buildDepConfigs": {
"tar_aa": {
"version": "1.34",
"buildDepConfigs": {},
"portRef": "[email protected]",
"specifiedVersion": false
},
"zstd_aa": {
"version": "v1.4.8,",
"buildDepConfigs": {},
"portRef": "[email protected]",
"specifiedVersion": false
}
},
"portRef": "[email protected]",
"releaseTag": "20240814",
"specifiedVersion": true
}
},
"portRef": "[email protected]",
"packageName": "pyright",
"specifiedVersion": true
},
"bciqon5lanvscx2pvfxplu3yftfwyqb2sc7d7ju7veqbfhraw2okw4xa": {
"version": "1.1.388",
"buildDepConfigs": {
"node_org": {
"version": "v20.8.0",
"buildDepConfigs": {
"tar_aa": {
"version": "1.34",
"buildDepConfigs": {},
"portRef": "[email protected]",
"specifiedVersion": false
}
},
"portRef": "[email protected]",
"specifiedVersion": true
}
},
"portRef": "[email protected]",
"packageName": "pyright",
"specifiedVersion": true
}
}
},
Expand Down Expand Up @@ -770,6 +819,7 @@
"bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
"bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy",
"bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy",
"bciqaixkkacuuligsvtjcfdfgjgl65owtyspiiljb3vmutlgymecsiwq",
Expand Down Expand Up @@ -806,6 +856,7 @@
"bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
"bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy",
"bciqezep4ufkgwesldlm5etyfkgdsiickfudx7cosydcz6xtgeorn2hy",
"bciqaixkkacuuligsvtjcfdfgjgl65owtyspiiljb3vmutlgymecsiwq",
Expand All @@ -830,6 +881,7 @@
"installs": [
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
"bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy",
"bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a"
],
Expand Down Expand Up @@ -870,6 +922,7 @@
"bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
"bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy"
],
"allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y"
Expand All @@ -884,6 +937,7 @@
"bciqlt27ioikxnpkqq37hma7ibn5e5wpzfarbvoh77zwdkarwghtvzxa",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
"bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy"
],
"allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y"
Expand All @@ -898,6 +952,7 @@
"bciqlt27ioikxnpkqq37hma7ibn5e5wpzfarbvoh77zwdkarwghtvzxa",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
"bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy"
],
"allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y"
Expand Down Expand Up @@ -925,6 +980,7 @@
"bciqjme7csfq43oenkrsakdhaha34hgy6vdwkfffki2ank3kf6mjcguq",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
"bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy"
],
"allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y"
Expand All @@ -951,6 +1007,7 @@
"bciqminqcmgw3fbbhibwc7tf6mrupttheic7kpiykadbowqmnzhmzo5a",
"bciqfpjzi6gguk7dafyicfjpzpwtybgyc2dsnxg2zxkcmyinzy7abpla",
"bciqkgncxbauys2qfguplxcz2auxrcyamj4b6htqk2fqvohfm3afd7sa",
"bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi",
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy"
],
"allowedBuildDeps": "bciqek3tmrhm4iohl6tvdzlhxwhv7b52makvvgehltxv52d3l7rbki3y"
Expand Down Expand Up @@ -2798,6 +2855,41 @@
},
"packageName": "ruff"
},
"bciqav4kugvq2ceed4xyic2urs5cg2ay5atiwx757u7yhx3cgauf7gqi": {
"version": "1.1.388",
"port": {
"ty": "denoWorker@v1",
"name": "npmi_npm",
"platforms": [
"x86_64-linux",
"aarch64-linux",
"x86_64-darwin",
"aarch64-darwin",
"x86_64-windows",
"aarch64-windows",
"x86_64-freebsd",
"aarch64-freebsd",
"x86_64-netbsd",
"aarch64-netbsd",
"x86_64-aix",
"aarch64-aix",
"x86_64-solaris",
"aarch64-solaris",
"x86_64-illumos",
"aarch64-illumos",
"x86_64-android",
"aarch64-android"
],
"version": "0.1.0",
"buildDeps": [
{
"name": "node_org"
}
],
"moduleSpecifier": "https://raw.githubusercontent.com/metatypedev/ghjk/v0.2.1/ports/npmi.ts"
},
"packageName": "pyright"
},
"bciqihcmo6l5uwzih3e3ujc55curep4arfomo6rzkdsfim74unxexiqy": {
"version": "1.8.3",
"port": {
Expand Down
76 changes: 24 additions & 52 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,25 @@ repos:
- id: deno-fmt
name: Deno format
language: system
entry: bash -c 'cd src/typegate && deno fmt --ignore=native,src/typegraphs,tmp,tests/e2e/nextjs,tests/metagen/typegraphs/sample/ts/client.ts && cd ../../tools && deno fmt && cd ../src/typegraph/deno && deno fmt --ignore=node_modules,dist && cd ../../../src/metagen/src && deno fmt'
entry: bash -c 'deno fmt'
pass_filenames: false
types:
- javascript
- ts
files: ^(src/typegate|tools|src/typegraph/deno)/
- tsx
- json
- yaml
- id: deno-lint
name: Deno lint
language: system
entry: bash -c 'cd src/typegate && deno lint --rules-exclude=no-explicit-any --ignore=native,tmp,tests/e2e/nextjs && cd ../../tools && deno lint && cd ../src/metagen/src/ && deno lint'
entry: bash -c 'deno lint'
pass_filenames: false
types:
- javascript
- ts
files: ^(src/typegate|tools)/
- tsx
- json
- yaml
- id: es-lint
name: Eslint website
language: system
Expand All @@ -49,23 +55,21 @@ repos:
types_or:
- ts
- tsx
files: ^website/
exclude: ^website/typegraphs/
- id: devtools-lint
name: ESLint meta-lsp
language: system
entry: bash -c 'cd meta-lsp && pnpm lint'
pass_filenames: false
types:
- ts
files: ^meta-lsp/
files: ^docs/metatype.dev
#- id: cargo-udeps
# name: Check for unused cargo dependencies
# language: system
# entry: bash -c '[ -z "${CI+x}" ] && cargo-udeps udeps'
# pass_filenames: false
# types:
# - toml
# - id: pyright
# name: Pyright type check
# language: system
# entry: bash -c 'pyright'
# pass_filenames: false
# types:
# - python
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
Expand All @@ -87,9 +91,9 @@ repos:
.*deno.lock|
CHANGELOG.md|
.*\.snap$|
typegate/src/typegraphs/.*\.json|
website/docs/reference/|
libs/pyrt_wit_wire/pyrt|
src/typegate/src/typegraphs/.*\.json|
docs/metatype.dev/reference/|
src/pyrt_wit_wire/pyrt|
migration_lock.toml|
tests/metagen/typegraphs/sample/[rs|ts|py]/client\.[rs|ts|py]
)
Expand All @@ -105,7 +109,7 @@ repos:
- "--skip-license-insertion-comment=no-auto-license-header"
types_or:
- python
files: ^typegraph/
exclude: ^examples/
- id: insert-license
name: "License MPL-2.0 rust"
args:
Expand All @@ -116,38 +120,7 @@ repos:
- "--skip-license-insertion-comment=@generated"
types_or:
- rust
files: ^(typegate|libs!(/metagen/.*))/
- id: insert-license
name: "License MPL-2.0 rust"
args:
#- --remove-header
- --license-filepath=tools/license-header-MPL-2.0.txt
- "--comment-style=//"
- "--skip-license-insertion-comment=no-auto-license-header"
types_or:
- rust
files: ^(meta-cli|typegraph|libs/metagen)/
- id: insert-license
name: "License MPL-2.0 deno"
args:
#- --remove-header
- --license-filepath=tools/license-header-MPL-2.0.txt
- "--comment-style=//"
- "--skip-license-insertion-comment=no-auto-license-header"
- "--skip-license-insertion-comment=@generated"
types_or:
- ts
files: ^(typegate|tools)/
- id: insert-license
name: "License MPL-2.0 deno"
args:
#- --remove-header
- --license-filepath=tools/license-header-MPL-2.0.txt
- "--comment-style=//"
- "--skip-license-insertion-comment=no-auto-license-header"
types_or:
- ts
files: ^typegraph/
exclude: ^examples/
- id: insert-license
name: "License MPL-2.0 typescript"
args:
Expand All @@ -158,8 +131,7 @@ repos:
types_or:
- ts
- tsx
files: ^website/
exclude: website/typegraphs
exclude: ^examples/
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.6
hooks:
Expand Down
34 changes: 17 additions & 17 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"recommendations": [
"charliermarsh.ruff",
"rust-lang.rust-analyzer",
"ms-python.black-formatter",
"denoland.vscode-deno",
"ms-vscode-remote.remote-containers",
"dbaeumer.vscode-eslint",
"graphql.vscode-graphql-syntax",
"unifiedjs.vscode-mdx",
"ms-python.vscode-pylance",
"ms-python.python",
"chrischinchilla.vale-vscode",
"hediet.vscode-drawio",
"davidlday.languagetool-linter",
"dtsvet.vscode-wasm",
"bierner.comment-tagged-templates"
]
"recommendations": [
"charliermarsh.ruff",
"rust-lang.rust-analyzer",
"ms-python.black-formatter",
"denoland.vscode-deno",
"ms-vscode-remote.remote-containers",
"dbaeumer.vscode-eslint",
"graphql.vscode-graphql-syntax",
"unifiedjs.vscode-mdx",
"ms-python.vscode-pylance",
"ms-python.python",
"chrischinchilla.vale-vscode",
"hediet.vscode-drawio",
"davidlday.languagetool-linter",
"dtsvet.vscode-wasm",
"bierner.comment-tagged-templates"
]
}
64 changes: 32 additions & 32 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
// A launch configuration that compiles the extension and then opens it inside a new window
{
"version": "0.2.0",
"configurations": [
{
"type": "extensionHost",
"request": "launch",
"name": "Launch Client",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}/meta-lsp"
],
"outFiles": [
"${workspaceRoot}/meta-lsp/vscode-metatype-support/out/**/*.js"
],
"preLaunchTask": "vscode-ext:build"
},
{
"name": "Language Server E2E Test",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/client/out/test/index",
"${workspaceRoot}/client/testFixture"
],
"outFiles": [
"${workspaceRoot}/client/out/test/**/*.js"
]
}
]
// A launch configuration that compiles the extension and then opens it inside a new window
{
"version": "0.2.0",
"configurations": [
{
"type": "extensionHost",
"request": "launch",
"name": "Launch Client",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}/meta-lsp"
],
"outFiles": [
"${workspaceRoot}/meta-lsp/vscode-metatype-support/out/**/*.js"
],
"preLaunchTask": "vscode-ext:build"
},
{
"name": "Language Server E2E Test",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/client/out/test/index",
"${workspaceRoot}/client/testFixture"
],
"outFiles": [
"${workspaceRoot}/client/out/test/**/*.js"
]
}
]
}
Loading
Loading