From d4d45cfdeb45157b2234317b57fafd9218ea9f42 Mon Sep 17 00:00:00 2001 From: Nathan DuPont Date: Thu, 28 Mar 2024 01:05:15 -0700 Subject: [PATCH] Adding bazel format task, and CI format check --- .bazelrc | 5 + .flake8 | 2 + .github/workflows/README.md | 3 + .github/workflows/ci.yaml | 40 ++ .gitignore | 221 +++++++- .ruff.toml | 1 + BUILD.bazel | 6 + MODULE.bazel | 7 + MODULE.bazel.lock | 1014 +++++++++++++++++++++++++++++------ README.md | 2 + WORKSPACE.bzlmod | 14 + src/api/v1/api.py | 10 +- src/api/v1/main.py | 8 - src/robot/v1/nodelete | 0 src/ui/v1/nodelete | 1 + tools/format/BUILD.bazel | 16 + tools/lint/BUILD.bazel | 32 ++ tools/lint/linters.bzl | 31 ++ 18 files changed, 1248 insertions(+), 165 deletions(-) create mode 100644 .bazelrc create mode 100644 .flake8 create mode 100644 .github/workflows/README.md create mode 100644 .github/workflows/ci.yaml create mode 100644 .ruff.toml create mode 100644 WORKSPACE.bzlmod create mode 100644 src/robot/v1/nodelete create mode 100644 src/ui/v1/nodelete create mode 100644 tools/format/BUILD.bazel create mode 100644 tools/lint/BUILD.bazel create mode 100644 tools/lint/linters.bzl diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 0000000..94fd1a2 --- /dev/null +++ b/.bazelrc @@ -0,0 +1,5 @@ +# Bazel configurations set for this repository. You + +# can also set local configs in your ~/.bazelrc file. + +common --enable_bzlmod diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..427f46e --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +# TODO \ No newline at end of file diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 0000000..65b82c0 --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,3 @@ +# GitHub Workflows + +Use `act` for testing workflows locally: https://nektosact.com/introduction.html diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..dd12acf --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,40 @@ +name: CI +on: + push: + pull_request: + branches: [main] + workflow_dispatch: +concurrency: + # Cancel previous actions from the same PR: https://stackoverflow.com/a/72408109 + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +jobs: + format: + runs-on: ubuntu-latest + steps: + - name: ๐Ÿš€ Checkout + uses: actions/checkout@v4 + - name: ๐ŸŒฟ Setup Bazel + uses: bazel-contrib/setup-bazel@0.8.0 + with: + bazelisk-cache: true + disk-cache: ${{ github.workflow }} + repository-cache: true + bazelrc: | + build --color=yes + build --show_timestamps + - name: ๐Ÿ—’๏ธ Track Current Files + run: touch /tmp/pre_fmt + - name: ๐Ÿงน Format Repository + run: bazel run //:format + - name: ๐Ÿ‘€ Detect Diff + run: | + set +x + formatted_files=$(find ./config ./src ./tools -newer /tmp/pre_fmt) + num_formatted_files=$(find ./config ./src ./tools -newer /tmp/pre_fmt | wc -l) + + if [ "$num_formatted_files" -gt "0" ]; then + echo "โŒ๐Ÿ”ฅ Bad code detected! The following files would be reformatted:" + echo "$formatted_files" + exit 1 + fi diff --git a/.gitignore b/.gitignore index cbebcd4..3ea1b20 100644 --- a/.gitignore +++ b/.gitignore @@ -197,4 +197,223 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ \ No newline at end of file +#.idea/ + +# Ruff styling gitignore +# Benchmarking cpython (CONTRIBUTING.md) +crates/ruff_linter/resources/test/cpython +# generate_mkdocs.py +mkdocs.generated.yml +# check_ecosystem.py +ruff-old +github_search*.jsonl +# update_schemastore.py +schemastore +# `maturin develop` and ecosystem_all_check.sh +.venv* +# Formatter debugging (crates/ruff_python_formatter/README.md) +scratch.* +# Created by `perf` (CONTRIBUTING.md) +perf.data +perf.data.old +# Created by `flamegraph` (CONTRIBUTING.md) +flamegraph.svg +# Additional target directories that don't invalidate the main compile cache when changing linker settings, +# e.g. `CARGO_TARGET_DIR=target-maturin maturin build --release --strip` or +# `CARGO_TARGET_DIR=target-llvm-lines RUSTFLAGS="-Csymbol-mangling-version=v0" cargo llvm-lines -p ruff --lib` +/target* + +### +# Rust.gitignore +### + +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb + +### +# Python.gitignore +### + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ +repos/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +.idea/ +.vimspector.json + +# Visual Studio Code +.vscode/ + +# VIM +.*.sw? +.sw? + +# Custom re-inclusions for the resolver test cases +!crates/ruff_python_resolver/resources/test/airflow/venv/ +!crates/ruff_python_resolver/resources/test/airflow/venv/lib +!crates/ruff_python_resolver/resources/test/airflow/venv/lib/python3.11/site-packages/_watchdog_fsevents.cpython-311-darwin.so +!crates/ruff_python_resolver/resources/test/airflow/venv/lib/python3.11/site-packages/orjson/orjson.cpython-311-darwin.so \ No newline at end of file diff --git a/.ruff.toml b/.ruff.toml new file mode 100644 index 0000000..f87f5c1 --- /dev/null +++ b/.ruff.toml @@ -0,0 +1 @@ +# TODO \ No newline at end of file diff --git a/BUILD.bazel b/BUILD.bazel index 20b4a42..a7c10f9 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,5 +1,6 @@ load("@rules_multirun//:defs.bzl", "command", "multirun") load("@rules_python//python:pip.bzl", "compile_pip_requirements") +load("@rules_python//python/entry_points:py_console_script_binary.bzl", "py_console_script_binary") # This rule adds a convenient way to update the requirements file. compile_pip_requirements( @@ -23,3 +24,8 @@ multirun( ], jobs = 0, ) + +alias( + name = "format", + actual = "//tools/format", +) diff --git a/MODULE.bazel b/MODULE.bazel index f640439..bc564ad 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -12,9 +12,12 @@ module( # Project Dependencies bazel_dep(name = "aspect_bazel_lib", version = "2.5.3") +bazel_dep(name = "aspect_rules_lint", version = "0.14.2") +bazel_dep(name = "bazel_skylib", version = "1.4.2") bazel_dep(name = "gazelle", version = "0.35.0") bazel_dep(name = "rules_go", version = "0.46.0") bazel_dep(name = "rules_multirun", version = "0.9.0") +bazel_dep(name = "platforms", version = "0.0.7") bazel_dep(name = "rules_oci", version = "1.6.0") bazel_dep(name = "rules_python", version = "0.29.0") @@ -44,3 +47,7 @@ oci.pull( ], ) use_repo(oci, "py3.11") + +# Set up formatters +# ruff = use_extension("@aspect_rules_lint//lint:ruff.bzl", "ruff") +# ruff.fetch_ruff() diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index c7d76b1..132e8ab 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -1,6 +1,6 @@ { "lockFileVersion": 6, - "moduleFileHash": "145264228151735f98e5e527a40c2feb0ad12670e8a1a5ca8af790428fa337e4", + "moduleFileHash": "6f4a010c0cbbd08689da85cb0a095f4ca5b00f47abbea85769a31e583dff5270", "flags": { "cmdRegistries": [ "https://bcr.bazel.build/" @@ -30,7 +30,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 22, + "line": 25, "column": 23 }, "imports": {}, @@ -44,7 +44,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 23, + "line": 26, "column": 17 } } @@ -58,7 +58,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 27, + "line": 30, "column": 20 }, "imports": { @@ -76,7 +76,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 28, + "line": 31, "column": 10 } } @@ -90,7 +90,7 @@ "usingModule": "", "location": { "file": "@@//:MODULE.bazel", - "line": 36, + "line": 39, "column": 20 }, "imports": { @@ -111,7 +111,7 @@ "devDependency": false, "location": { "file": "@@//:MODULE.bazel", - "line": 38, + "line": 41, "column": 9 } } @@ -122,9 +122,12 @@ ], "deps": { "aspect_bazel_lib": "aspect_bazel_lib@2.5.3", + "aspect_rules_lint": "aspect_rules_lint@0.14.2", + "bazel_skylib": "bazel_skylib@1.5.0", "gazelle": "gazelle@0.35.0", "rules_go": "rules_go@0.46.0", "rules_multirun": "rules_multirun@0.9.0", + "platforms": "platforms@0.0.8", "rules_oci": "rules_oci@1.6.0", "rules_python": "rules_python@0.29.0", "bazel_tools": "bazel_tools@_", @@ -281,6 +284,104 @@ } } }, + "aspect_rules_lint@0.14.2": { + "name": "aspect_rules_lint", + "version": "0.14.2", + "key": "aspect_rules_lint@0.14.2", + "repoName": "aspect_rules_lint", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_multitool//multitool:extension.bzl", + "extensionName": "multitool", + "usingModule": "aspect_rules_lint@0.14.2", + "location": { + "file": "https://bcr.bazel.build/modules/aspect_rules_lint/0.14.2/MODULE.bazel", + "line": 31, + "column": 26 + }, + "imports": { + "multitool": "multitool" + }, + "devImports": [], + "tags": [ + { + "tagName": "hub", + "attributeValues": { + "lockfile": "//format:multitool.lock.json" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/aspect_rules_lint/0.14.2/MODULE.bazel", + "line": 32, + "column": 14 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "aspect_bazel_lib": "aspect_bazel_lib@2.5.3", + "aspect_rules_js": "aspect_rules_js@1.33.1", + "bazel_skylib": "bazel_skylib@1.5.0", + "platforms": "platforms@0.0.8", + "rules_multitool": "rules_multitool@0.4.0", + "rules_proto": "rules_proto@5.3.0-21.7", + "rules_buf": "rules_buf@0.1.1", + "com_google_protobuf": "protobuf@21.7", + "io_bazel_rules_go": "rules_go@0.46.0", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/aspect-build/rules_lint/releases/download/v0.14.2/rules_lint-v0.14.2.tar.gz" + ], + "integrity": "sha256-B91iWIlHV+RNsaXdNlBzHBQyytd5Wv2qbZRdS6O4T2g=", + "strip_prefix": "rules_lint-0.14.2", + "remote_patches": { + "https://bcr.bazel.build/modules/aspect_rules_lint/0.14.2/patches/module_dot_bazel_version.patch": "sha256-WU8FmPO5ChiCU1Xn8//mvVbwiXdVhcu28JpX7PmfmU0=" + }, + "remote_patch_strip": 1 + } + } + }, + "bazel_skylib@1.5.0": { + "name": "bazel_skylib", + "version": "1.5.0", + "key": "bazel_skylib@1.5.0", + "repoName": "bazel_skylib", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "//toolchains/unittest:cmd_toolchain", + "//toolchains/unittest:bash_toolchain" + ], + "extensionUsages": [], + "deps": { + "platforms": "platforms@0.0.8", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz" + ], + "integrity": "sha256-zVWgYudjuTSZIfD124w5MyiNyLpPdt2UFqrGis7jy5Q=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, "gazelle@0.35.0": { "name": "gazelle", "version": "0.35.0", @@ -538,6 +639,33 @@ } } }, + "platforms@0.0.8": { + "name": "platforms", + "version": "0.0.8", + "key": "platforms@0.0.8", + "repoName": "platforms", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "rules_license": "rules_license@0.0.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz" + ], + "integrity": "sha256-gVBAZgU4ns7LbaB8vLUJ1WN6OrmiS8abEQFTE2fYnXQ=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, "rules_oci@1.6.0": { "name": "rules_oci", "version": "1.6.0", @@ -880,19 +1008,18 @@ "bazel_tools": "bazel_tools@_" } }, - "bazel_skylib@1.5.0": { - "name": "bazel_skylib", - "version": "1.5.0", - "key": "bazel_skylib@1.5.0", - "repoName": "bazel_skylib", + "stardoc@0.5.4": { + "name": "stardoc", + "version": "0.5.4", + "key": "stardoc@0.5.4", + "repoName": "stardoc", "executionPlatformsToRegister": [], - "toolchainsToRegister": [ - "//toolchains/unittest:cmd_toolchain", - "//toolchains/unittest:bash_toolchain" - ], + "toolchainsToRegister": [], "extensionUsages": [], "deps": { - "platforms": "platforms@0.0.8", + "bazel_skylib": "bazel_skylib@1.5.0", + "rules_java": "rules_java@7.4.0", + "rules_license": "rules_license@0.0.7", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, @@ -901,25 +1028,86 @@ "ruleClassName": "http_archive", "attributes": { "urls": [ - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz" + "https://github.com/bazelbuild/stardoc/releases/download/0.5.4/stardoc-0.5.4.tar.gz" ], - "integrity": "sha256-zVWgYudjuTSZIfD124w5MyiNyLpPdt2UFqrGis7jy5Q=", + "integrity": "sha256-7FcTnkZvquVj8vw5YJ2klIpHm7UbbWeu3X2bG4BZxDM=", "strip_prefix": "", "remote_patches": {}, "remote_patch_strip": 0 } } }, - "platforms@0.0.8": { - "name": "platforms", - "version": "0.0.8", - "key": "platforms@0.0.8", - "repoName": "platforms", + "aspect_rules_js@1.33.1": { + "name": "aspect_rules_js", + "version": "1.33.1", + "key": "aspect_rules_js@1.33.1", + "repoName": "aspect_rules_js", "executionPlatformsToRegister": [], "toolchainsToRegister": [], - "extensionUsages": [], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_nodejs//nodejs:extensions.bzl", + "extensionName": "node", + "usingModule": "aspect_rules_js@1.33.1", + "location": { + "file": "https://bcr.bazel.build/modules/aspect_rules_js/1.33.1/MODULE.bazel", + "line": 17, + "column": 21 + }, + "imports": { + "nodejs_linux_amd64": "nodejs_linux_amd64", + "nodejs_darwin_arm64": "nodejs_darwin_arm64", + "nodejs_darwin_amd64": "nodejs_darwin_amd64", + "nodejs_linux_arm64": "nodejs_linux_arm64", + "nodejs_linux_s390x": "nodejs_linux_s390x", + "nodejs_linux_ppc64le": "nodejs_linux_ppc64le", + "nodejs_windows_amd64": "nodejs_windows_amd64" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + }, + { + "extensionBzlFile": "@aspect_rules_js//npm:extensions.bzl", + "extensionName": "pnpm", + "usingModule": "aspect_rules_js@1.33.1", + "location": { + "file": "https://bcr.bazel.build/modules/aspect_rules_js/1.33.1/MODULE.bazel", + "line": 26, + "column": 21 + }, + "imports": { + "pnpm": "pnpm", + "pnpm__links": "pnpm__links" + }, + "devImports": [], + "tags": [ + { + "tagName": "pnpm", + "attributeValues": { + "name": "pnpm", + "pnpm_version": "8.6.7", + "pnpm_version_integrity": "sha512-vRIWpD/L4phf9Bk2o/O2TDR8fFoJnpYrp2TKqTIZF/qZ2/rgL3qKXzHofHgbXsinwMoSEigz28sqk3pQ+yMEQQ==" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/aspect_rules_js/1.33.1/MODULE.bazel", + "line": 27, + "column": 10 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], "deps": { - "rules_license": "rules_license@0.0.7", + "aspect_bazel_lib": "aspect_bazel_lib@2.5.3", + "bazel_features": "bazel_features@1.1.1", + "bazel_skylib": "bazel_skylib@1.5.0", + "rules_nodejs": "rules_nodejs@5.8.2", + "platforms": "platforms@0.0.8", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, @@ -928,27 +1116,78 @@ "ruleClassName": "http_archive", "attributes": { "urls": [ - "https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz" + "https://github.com/aspect-build/rules_js/releases/download/v1.33.1/rules_js-v1.33.1.tar.gz" ], - "integrity": "sha256-gVBAZgU4ns7LbaB8vLUJ1WN6OrmiS8abEQFTE2fYnXQ=", - "strip_prefix": "", + "integrity": "sha256-qUnVb+2PoKjdgqCmYKzJSSU6BbKwxSoH5ANOJ/ESGPY=", + "strip_prefix": "rules_js-1.33.1", + "remote_patches": { + "https://bcr.bazel.build/modules/aspect_rules_js/1.33.1/patches/module_dot_bazel_version.patch": "sha256-CHLR0Gk7/cj0aaVphnEPr5Lp+kYzuHhHVARoow47U8o=" + }, + "remote_patch_strip": 1 + } + } + }, + "rules_multitool@0.4.0": { + "name": "rules_multitool", + "version": "0.4.0", + "key": "rules_multitool@0.4.0", + "repoName": "rules_multitool", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@multitool//toolchains:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_multitool//multitool:extension.bzl", + "extensionName": "multitool", + "usingModule": "rules_multitool@0.4.0", + "location": { + "file": "https://bcr.bazel.build/modules/rules_multitool/0.4.0/MODULE.bazel", + "line": 14, + "column": 26 + }, + "imports": { + "multitool": "multitool" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@1.5.0", + "buildifier_prebuilt": "buildifier_prebuilt@6.1.2", + "platforms": "platforms@0.0.8", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/theoremlp/rules_multitool/releases/download/v0.4.0/rules_multitool-0.4.0.tar.gz" + ], + "integrity": "sha256-eTEF6ku4nPnYJBHL7kC2h0CF9TAxRgCIdTniFOSXCjo=", + "strip_prefix": "rules_multitool-0.4.0", "remote_patches": {}, "remote_patch_strip": 0 } } }, - "stardoc@0.5.4": { - "name": "stardoc", - "version": "0.5.4", - "key": "stardoc@0.5.4", - "repoName": "stardoc", + "rules_proto@5.3.0-21.7": { + "name": "rules_proto", + "version": "5.3.0-21.7", + "key": "rules_proto@5.3.0-21.7", + "repoName": "rules_proto", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [], "deps": { "bazel_skylib": "bazel_skylib@1.5.0", - "rules_java": "rules_java@7.4.0", - "rules_license": "rules_license@0.0.7", + "com_google_protobuf": "protobuf@21.7", + "rules_cc": "rules_cc@0.0.9", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, @@ -957,15 +1196,66 @@ "ruleClassName": "http_archive", "attributes": { "urls": [ - "https://github.com/bazelbuild/stardoc/releases/download/0.5.4/stardoc-0.5.4.tar.gz" + "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz" ], - "integrity": "sha256-7FcTnkZvquVj8vw5YJ2klIpHm7UbbWeu3X2bG4BZxDM=", - "strip_prefix": "", + "integrity": "sha256-3D+yBqLLNEG0heseQjFlsjEjWh6psDG0Qzz3vB+kYN0=", + "strip_prefix": "rules_proto-5.3.0-21.7", "remote_patches": {}, "remote_patch_strip": 0 } } }, + "rules_buf@0.1.1": { + "name": "rules_buf", + "version": "0.1.1", + "key": "rules_buf@0.1.1", + "repoName": "rules_buf", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@rules_buf_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@rules_buf//buf:extensions.bzl", + "extensionName": "ext", + "usingModule": "rules_buf@0.1.1", + "location": { + "file": "https://bcr.bazel.build/modules/rules_buf/0.1.1/MODULE.bazel", + "line": 14, + "column": 20 + }, + "imports": { + "rules_buf_toolchains": "rules_buf_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "platforms": "platforms@0.0.8", + "com_google_protobuf": "protobuf@21.7", + "rules_proto": "rules_proto@5.3.0-21.7", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bufbuild/rules_buf/archive/abbbfce7c3fccf1d4b87afa28140d9ce53f80057.zip" + ], + "integrity": "sha256-/cvkfvtor1wk3+dSdJqwsqDBrAIV49KM9unuKODCrvs=", + "strip_prefix": "rules_buf-abbbfce7c3fccf1d4b87afa28140d9ce53f80057", + "remote_patches": { + "https://bcr.bazel.build/modules/rules_buf/0.1.1/patches/bzlmod.patch": "sha256-D5PYozjx10XcIqo0mMyoGIqO3PJHJtxLQ1vo3zesDS0=" + }, + "remote_patch_strip": 1 + } + } + }, "protobuf@21.7": { "name": "protobuf", "version": "21.7", @@ -1050,35 +1340,6 @@ } } }, - "rules_proto@5.3.0-21.7": { - "name": "rules_proto", - "version": "5.3.0-21.7", - "key": "rules_proto@5.3.0-21.7", - "repoName": "rules_proto", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [], - "deps": { - "bazel_skylib": "bazel_skylib@1.5.0", - "com_google_protobuf": "protobuf@21.7", - "rules_cc": "rules_cc@0.0.9", - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz" - ], - "integrity": "sha256-3D+yBqLLNEG0heseQjFlsjEjWh6psDG0Qzz3vB+kYN0=", - "strip_prefix": "rules_proto-5.3.0-21.7", - "remote_patches": {}, - "remote_patch_strip": 0 - } - } - }, "bazel_features@1.1.1": { "name": "bazel_features", "version": "1.1.1", @@ -1126,6 +1387,32 @@ } } }, + "rules_license@0.0.7": { + "name": "rules_license", + "version": "0.0.7", + "key": "rules_license@0.0.7", + "repoName": "rules_license", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz" + ], + "integrity": "sha256-RTHezLkTY5ww5cdRKgVNXYdWmNrrddjPkPKEN1/nw2A=", + "strip_prefix": "", + "remote_patches": {}, + "remote_patch_strip": 0 + } + } + }, "rules_cc@0.0.9": { "name": "rules_cc", "version": "0.0.9", @@ -1275,15 +1562,83 @@ } } }, - "rules_license@0.0.7": { - "name": "rules_license", - "version": "0.0.7", - "key": "rules_license@0.0.7", - "repoName": "rules_license", + "buildozer@6.4.0.2": { + "name": "buildozer", + "version": "6.4.0.2", + "key": "buildozer@6.4.0.2", + "repoName": "buildozer", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [], + "extensionUsages": [ + { + "extensionBzlFile": "@buildozer//:buildozer_binary.bzl", + "extensionName": "buildozer_binary", + "usingModule": "buildozer@6.4.0.2", + "location": { + "file": "https://bcr.bazel.build/modules/buildozer/6.4.0.2/MODULE.bazel", + "line": 7, + "column": 33 + }, + "imports": { + "buildozer_binary": "buildozer_binary" + }, + "devImports": [], + "tags": [ + { + "tagName": "buildozer", + "attributeValues": { + "sha256": { + "darwin-amd64": "d29e347ecd6b5673d72cb1a8de05bf1b06178dd229ff5eb67fad5100c840cc8e", + "darwin-arm64": "9b9e71bdbec5e7223871e913b65d12f6d8fa026684daf991f00e52ed36a6978d", + "linux-amd64": "8dfd6345da4e9042daa738d7fdf34f699c5dfce4632f7207956fceedd8494119", + "linux-arm64": "6559558fded658c8fa7432a9d011f7c4dcbac6b738feae73d2d5c352e5f605fa", + "windows-amd64": "e7f05bf847f7c3689dd28926460ce6e1097ae97380ac8e6ae7147b7b706ba19b" + }, + "version": "6.4.0" + }, + "devDependency": false, + "location": { + "file": "https://bcr.bazel.build/modules/buildozer/6.4.0.2/MODULE.bazel", + "line": 8, + "column": 27 + } + } + ], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/fmeum/buildozer/releases/download/v6.4.0.2/buildozer-v6.4.0.2.tar.gz" + ], + "integrity": "sha256-k7tFKQMR2AygxpmZfH0yEPnQmF3efFgD9rBPkj+Yz/8=", + "strip_prefix": "buildozer-6.4.0.2", + "remote_patches": { + "https://bcr.bazel.build/modules/buildozer/6.4.0.2/patches/module_dot_bazel_version.patch": "sha256-gKANF2HMilj7bWmuXs4lbBIAAansuWC4IhWGB/CerjU=" + }, + "remote_patch_strip": 1 + } + } + }, + "zlib@1.3": { + "name": "zlib", + "version": "1.3", + "key": "zlib@1.3", + "repoName": "zlib", "executionPlatformsToRegister": [], "toolchainsToRegister": [], "extensionUsages": [], "deps": { + "platforms": "platforms@0.0.8", + "rules_cc": "rules_cc@0.0.9", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, @@ -1292,54 +1647,101 @@ "ruleClassName": "http_archive", "attributes": { "urls": [ - "https://github.com/bazelbuild/rules_license/releases/download/0.0.7/rules_license-0.0.7.tar.gz" + "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz" ], - "integrity": "sha256-RTHezLkTY5ww5cdRKgVNXYdWmNrrddjPkPKEN1/nw2A=", + "integrity": "sha256-/wukwpIBPbwnUws6geH5qBPNOd4Byl4Pi/NVcC76WT4=", + "strip_prefix": "zlib-1.3", + "remote_patches": { + "https://bcr.bazel.build/modules/zlib/1.3/patches/add_build_file.patch": "sha256-Ei+FYaaOo7A3jTKunMEodTI0Uw5NXQyZEcboMC8JskY=", + "https://bcr.bazel.build/modules/zlib/1.3/patches/module_dot_bazel.patch": "sha256-fPWLM+2xaF/kuy+kZc1YTfW6hNjrkG400Ho7gckuyJk=" + }, + "remote_patch_strip": 0 + } + } + }, + "apple_support@1.5.0": { + "name": "apple_support", + "version": "1.5.0", + "key": "apple_support@1.5.0", + "repoName": "build_bazel_apple_support", + "executionPlatformsToRegister": [], + "toolchainsToRegister": [ + "@local_config_apple_cc_toolchains//:all" + ], + "extensionUsages": [ + { + "extensionBzlFile": "@build_bazel_apple_support//crosstool:setup.bzl", + "extensionName": "apple_cc_configure_extension", + "usingModule": "apple_support@1.5.0", + "location": { + "file": "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel", + "line": 17, + "column": 35 + }, + "imports": { + "local_config_apple_cc": "local_config_apple_cc", + "local_config_apple_cc_toolchains": "local_config_apple_cc_toolchains" + }, + "devImports": [], + "tags": [], + "hasDevUseExtension": false, + "hasNonDevUseExtension": true + } + ], + "deps": { + "bazel_skylib": "bazel_skylib@1.5.0", + "platforms": "platforms@0.0.8", + "bazel_tools": "bazel_tools@_", + "local_config_platform": "local_config_platform@_" + }, + "repoSpec": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_archive", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/apple_support/releases/download/1.5.0/apple_support.1.5.0.tar.gz" + ], + "integrity": "sha256-miM41vja0yRPgj8txghKA+TQ+7J8qJLclw5okNW0gYQ=", "strip_prefix": "", "remote_patches": {}, "remote_patch_strip": 0 } } }, - "buildozer@6.4.0.2": { - "name": "buildozer", - "version": "6.4.0.2", - "key": "buildozer@6.4.0.2", - "repoName": "buildozer", + "rules_nodejs@5.8.2": { + "name": "rules_nodejs", + "version": "5.8.2", + "key": "rules_nodejs@5.8.2", + "repoName": "rules_nodejs", "executionPlatformsToRegister": [], - "toolchainsToRegister": [], + "toolchainsToRegister": [ + "@nodejs_toolchains//:all" + ], "extensionUsages": [ { - "extensionBzlFile": "@buildozer//:buildozer_binary.bzl", - "extensionName": "buildozer_binary", - "usingModule": "buildozer@6.4.0.2", + "extensionBzlFile": "@rules_nodejs//nodejs:extensions.bzl", + "extensionName": "node", + "usingModule": "rules_nodejs@5.8.2", "location": { - "file": "https://bcr.bazel.build/modules/buildozer/6.4.0.2/MODULE.bazel", - "line": 7, - "column": 33 + "file": "https://bcr.bazel.build/modules/rules_nodejs/5.8.2/MODULE.bazel", + "line": 12, + "column": 21 }, "imports": { - "buildozer_binary": "buildozer_binary" + "nodejs_toolchains": "nodejs_toolchains" }, "devImports": [], "tags": [ { - "tagName": "buildozer", + "tagName": "toolchain", "attributeValues": { - "sha256": { - "darwin-amd64": "d29e347ecd6b5673d72cb1a8de05bf1b06178dd229ff5eb67fad5100c840cc8e", - "darwin-arm64": "9b9e71bdbec5e7223871e913b65d12f6d8fa026684daf991f00e52ed36a6978d", - "linux-amd64": "8dfd6345da4e9042daa738d7fdf34f699c5dfce4632f7207956fceedd8494119", - "linux-arm64": "6559558fded658c8fa7432a9d011f7c4dcbac6b738feae73d2d5c352e5f605fa", - "windows-amd64": "e7f05bf847f7c3689dd28926460ce6e1097ae97380ac8e6ae7147b7b706ba19b" - }, - "version": "6.4.0" + "name": "nodejs" }, "devDependency": false, "location": { - "file": "https://bcr.bazel.build/modules/buildozer/6.4.0.2/MODULE.bazel", - "line": 8, - "column": 27 + "file": "https://bcr.bazel.build/modules/rules_nodejs/5.8.2/MODULE.bazel", + "line": 16, + "column": 15 } } ], @@ -1348,36 +1750,8 @@ } ], "deps": { - "bazel_tools": "bazel_tools@_", - "local_config_platform": "local_config_platform@_" - }, - "repoSpec": { - "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", - "ruleClassName": "http_archive", - "attributes": { - "urls": [ - "https://github.com/fmeum/buildozer/releases/download/v6.4.0.2/buildozer-v6.4.0.2.tar.gz" - ], - "integrity": "sha256-k7tFKQMR2AygxpmZfH0yEPnQmF3efFgD9rBPkj+Yz/8=", - "strip_prefix": "buildozer-6.4.0.2", - "remote_patches": { - "https://bcr.bazel.build/modules/buildozer/6.4.0.2/patches/module_dot_bazel_version.patch": "sha256-gKANF2HMilj7bWmuXs4lbBIAAansuWC4IhWGB/CerjU=" - }, - "remote_patch_strip": 1 - } - } - }, - "zlib@1.3": { - "name": "zlib", - "version": "1.3", - "key": "zlib@1.3", - "repoName": "zlib", - "executionPlatformsToRegister": [], - "toolchainsToRegister": [], - "extensionUsages": [], - "deps": { + "bazel_skylib": "bazel_skylib@1.5.0", "platforms": "platforms@0.0.8", - "rules_cc": "rules_cc@0.0.9", "bazel_tools": "bazel_tools@_", "local_config_platform": "local_config_platform@_" }, @@ -1386,40 +1760,38 @@ "ruleClassName": "http_archive", "attributes": { "urls": [ - "https://github.com/madler/zlib/releases/download/v1.3/zlib-1.3.tar.gz" + "https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.2/rules_nodejs-core-5.8.2.tar.gz" ], - "integrity": "sha256-/wukwpIBPbwnUws6geH5qBPNOd4Byl4Pi/NVcC76WT4=", - "strip_prefix": "zlib-1.3", + "integrity": "sha256-dko7N1e7jDxqArozRHMaPXHlWCIK3LDPfkPJu6LDe6g=", + "strip_prefix": "", "remote_patches": { - "https://bcr.bazel.build/modules/zlib/1.3/patches/add_build_file.patch": "sha256-Ei+FYaaOo7A3jTKunMEodTI0Uw5NXQyZEcboMC8JskY=", - "https://bcr.bazel.build/modules/zlib/1.3/patches/module_dot_bazel.patch": "sha256-fPWLM+2xaF/kuy+kZc1YTfW6hNjrkG400Ho7gckuyJk=" + "https://bcr.bazel.build/modules/rules_nodejs/5.8.2/patches/module_dot_bazel.patch": "sha256-5QrAbAO9TVzmRytAov5d4xvl/U3aRQsUpeP/h5SFmu4=" }, "remote_patch_strip": 0 } } }, - "apple_support@1.5.0": { - "name": "apple_support", - "version": "1.5.0", - "key": "apple_support@1.5.0", - "repoName": "build_bazel_apple_support", + "buildifier_prebuilt@6.1.2": { + "name": "buildifier_prebuilt", + "version": "6.1.2", + "key": "buildifier_prebuilt@6.1.2", + "repoName": "buildifier_prebuilt", "executionPlatformsToRegister": [], "toolchainsToRegister": [ - "@local_config_apple_cc_toolchains//:all" + "@buildifier_prebuilt_toolchains//:all" ], "extensionUsages": [ { - "extensionBzlFile": "@build_bazel_apple_support//crosstool:setup.bzl", - "extensionName": "apple_cc_configure_extension", - "usingModule": "apple_support@1.5.0", + "extensionBzlFile": "@buildifier_prebuilt//:defs.bzl", + "extensionName": "buildifier_prebuilt_deps_extension", + "usingModule": "buildifier_prebuilt@6.1.2", "location": { - "file": "https://bcr.bazel.build/modules/apple_support/1.5.0/MODULE.bazel", - "line": 17, - "column": 35 + "file": "https://bcr.bazel.build/modules/buildifier_prebuilt/6.1.2/MODULE.bazel", + "line": 10, + "column": 32 }, "imports": { - "local_config_apple_cc": "local_config_apple_cc", - "local_config_apple_cc_toolchains": "local_config_apple_cc_toolchains" + "buildifier_prebuilt_toolchains": "buildifier_prebuilt_toolchains" }, "devImports": [], "tags": [], @@ -1438,11 +1810,13 @@ "ruleClassName": "http_archive", "attributes": { "urls": [ - "https://github.com/bazelbuild/apple_support/releases/download/1.5.0/apple_support.1.5.0.tar.gz" + "https://github.com/keith/buildifier-prebuilt/archive/refs/tags/6.1.2.tar.gz" ], - "integrity": "sha256-miM41vja0yRPgj8txghKA+TQ+7J8qJLclw5okNW0gYQ=", - "strip_prefix": "", - "remote_patches": {}, + "integrity": "sha256-KaUOpUWBDcB3xAjVIOuD6d4+7P5jleicsHFJ2QP8MeU=", + "strip_prefix": "buildifier-prebuilt-6.1.2", + "remote_patches": { + "https://bcr.bazel.build/modules/buildifier_prebuilt/6.1.2/patches/module_dot_bazel_version.patch": "sha256-U79F1nzwKoLhPknGAjb0A/xNnnB62K5Hj71pgXYfNO0=" + }, "remote_patch_strip": 0 } } @@ -2198,6 +2572,179 @@ "recordedRepoMappingEntries": [] } }, + "@@buildifier_prebuilt~//:defs.bzl%buildifier_prebuilt_deps_extension": { + "general": { + "bzlTransitiveDigest": "ckn6/2JzYw2uR60Mj6xXomT6udNZCxxPZY/ucSJL3jg=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "buildozer_darwin_amd64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildozer-darwin-amd64" + ], + "downloaded_file_path": "buildozer", + "executable": true, + "sha256": "4014751a4cc5e91a7dc4b64be7b30c565bd9014ae6d1879818dc624562a1d431" + } + }, + "buildifier_linux_amd64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildifier-linux-amd64" + ], + "downloaded_file_path": "buildifier", + "executable": true, + "sha256": "51bc947dabb7b14ec6fb1224464fbcf7a7cb138f1a10a3b328f00835f72852ce" + } + }, + "buildozer_darwin_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildozer-darwin-arm64" + ], + "downloaded_file_path": "buildozer", + "executable": true, + "sha256": "e78bd5357f2356067d4b0d49ec4e4143dd9b1308746afc6ff11b55b952f462d7" + } + }, + "buildozer_linux_amd64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildozer-linux-amd64" + ], + "downloaded_file_path": "buildozer", + "executable": true, + "sha256": "2aef0f1ef80a0140b8fe6e6a8eb822e14827d8855bfc6681532c7530339ea23b" + } + }, + "buildozer_windows_amd64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildozer-windows-amd64.exe" + ], + "downloaded_file_path": "buildozer.exe", + "executable": true, + "sha256": "07664d5d08ee099f069cd654070cabf2708efaae9f52dc83921fa400c67a868b" + } + }, + "buildozer_linux_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildozer-linux-arm64" + ], + "downloaded_file_path": "buildozer", + "executable": true, + "sha256": "586e27630cbc242e8bd6fe8e24485eca8dcadea6410cc13cbe059202655980ac" + } + }, + "buildifier_windows_amd64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildifier-windows-amd64.exe" + ], + "downloaded_file_path": "buildifier.exe", + "executable": true, + "sha256": "92bdd284fbc6766fc3e300b434ff9e68ac4d76a06cb29d1bdefe79a102a8d135" + } + }, + "buildifier_prebuilt_toolchains": { + "bzlFile": "@@buildifier_prebuilt~//:defs.bzl", + "ruleClassName": "_buildifier_toolchain_setup", + "attributes": { + "assets_json": "[{\"arch\":\"amd64\",\"name\":\"buildifier\",\"platform\":\"darwin\",\"sha256\":\"e2f4a67691c5f55634fbfb3850eb97dd91be0edd059d947b6c83d120682e0216\",\"version\":\"v6.1.2\"},{\"arch\":\"arm64\",\"name\":\"buildifier\",\"platform\":\"darwin\",\"sha256\":\"7549b5f535219ac957aa2a6069d46fbfc9ea3f74abd85fd3d460af4b1a2099a6\",\"version\":\"v6.1.2\"},{\"arch\":\"amd64\",\"name\":\"buildifier\",\"platform\":\"linux\",\"sha256\":\"51bc947dabb7b14ec6fb1224464fbcf7a7cb138f1a10a3b328f00835f72852ce\",\"version\":\"v6.1.2\"},{\"arch\":\"arm64\",\"name\":\"buildifier\",\"platform\":\"linux\",\"sha256\":\"0ba6e8e3208b5a029164e542ddb5509e618f87b639ffe8cc2f54770022853080\",\"version\":\"v6.1.2\"},{\"arch\":\"amd64\",\"name\":\"buildifier\",\"platform\":\"windows\",\"sha256\":\"92bdd284fbc6766fc3e300b434ff9e68ac4d76a06cb29d1bdefe79a102a8d135\",\"version\":\"v6.1.2\"},{\"arch\":\"amd64\",\"name\":\"buildozer\",\"platform\":\"darwin\",\"sha256\":\"4014751a4cc5e91a7dc4b64be7b30c565bd9014ae6d1879818dc624562a1d431\",\"version\":\"v6.1.2\"},{\"arch\":\"arm64\",\"name\":\"buildozer\",\"platform\":\"darwin\",\"sha256\":\"e78bd5357f2356067d4b0d49ec4e4143dd9b1308746afc6ff11b55b952f462d7\",\"version\":\"v6.1.2\"},{\"arch\":\"amd64\",\"name\":\"buildozer\",\"platform\":\"linux\",\"sha256\":\"2aef0f1ef80a0140b8fe6e6a8eb822e14827d8855bfc6681532c7530339ea23b\",\"version\":\"v6.1.2\"},{\"arch\":\"arm64\",\"name\":\"buildozer\",\"platform\":\"linux\",\"sha256\":\"586e27630cbc242e8bd6fe8e24485eca8dcadea6410cc13cbe059202655980ac\",\"version\":\"v6.1.2\"},{\"arch\":\"amd64\",\"name\":\"buildozer\",\"platform\":\"windows\",\"sha256\":\"07664d5d08ee099f069cd654070cabf2708efaae9f52dc83921fa400c67a868b\",\"version\":\"v6.1.2\"}]" + } + }, + "buildifier_darwin_amd64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildifier-darwin-amd64" + ], + "downloaded_file_path": "buildifier", + "executable": true, + "sha256": "e2f4a67691c5f55634fbfb3850eb97dd91be0edd059d947b6c83d120682e0216" + } + }, + "buildifier_darwin_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildifier-darwin-arm64" + ], + "downloaded_file_path": "buildifier", + "executable": true, + "sha256": "7549b5f535219ac957aa2a6069d46fbfc9ea3f74abd85fd3d460af4b1a2099a6" + } + }, + "buildifier_linux_arm64": { + "bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl", + "ruleClassName": "http_file", + "attributes": { + "urls": [ + "https://github.com/bazelbuild/buildtools/releases/download/v6.1.2/buildifier-linux-arm64" + ], + "downloaded_file_path": "buildifier", + "executable": true, + "sha256": "0ba6e8e3208b5a029164e542ddb5509e618f87b639ffe8cc2f54770022853080" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "buildifier_prebuilt~", + "bazel_skylib", + "bazel_skylib~" + ], + [ + "buildifier_prebuilt~", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, + "@@rules_buf~//buf:extensions.bzl%ext": { + "general": { + "bzlTransitiveDigest": "g+jMGdq+n4/yJrpHH5E0NFOhJJ1qUGT36b/kwcBonsU=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "rules_buf_toolchains": { + "bzlFile": "@@rules_buf~//buf/internal:toolchain.bzl", + "ruleClassName": "buf_download_releases", + "attributes": { + "version": "v1.27.0" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_buf~", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, "@@rules_go~//go:extensions.bzl%go_sdk": { "os:linux,arch:amd64": { "bzlTransitiveDigest": "RXEyYjQesMdT619yePZ3F0V7pLqQC1DHnKNr/8TwLYk=", @@ -2894,6 +3441,169 @@ ] } }, + "@@rules_multitool~//multitool:extension.bzl%multitool": { + "general": { + "bzlTransitiveDigest": "AtvPzG/SAawYMKVVHcMoJq4EXkVPTIhS3AeNwENXp9E=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "multitool.linux_x86_64": { + "bzlFile": "@@rules_multitool~//multitool/private:multitool.bzl", + "ruleClassName": "_env_specific_tools", + "attributes": { + "lockfiles": [ + "@@aspect_rules_lint~//format:multitool.lock.json" + ], + "os": "linux", + "cpu": "x86_64" + } + }, + "multitool.linux_arm64": { + "bzlFile": "@@rules_multitool~//multitool/private:multitool.bzl", + "ruleClassName": "_env_specific_tools", + "attributes": { + "lockfiles": [ + "@@aspect_rules_lint~//format:multitool.lock.json" + ], + "os": "linux", + "cpu": "arm64" + } + }, + "multitool.macos_x86_64": { + "bzlFile": "@@rules_multitool~//multitool/private:multitool.bzl", + "ruleClassName": "_env_specific_tools", + "attributes": { + "lockfiles": [ + "@@aspect_rules_lint~//format:multitool.lock.json" + ], + "os": "macos", + "cpu": "x86_64" + } + }, + "multitool.macos_arm64": { + "bzlFile": "@@rules_multitool~//multitool/private:multitool.bzl", + "ruleClassName": "_env_specific_tools", + "attributes": { + "lockfiles": [ + "@@aspect_rules_lint~//format:multitool.lock.json" + ], + "os": "macos", + "cpu": "arm64" + } + }, + "multitool": { + "bzlFile": "@@rules_multitool~//multitool/private:multitool.bzl", + "ruleClassName": "_multitool_hub", + "attributes": { + "lockfiles": [ + "@@aspect_rules_lint~//format:multitool.lock.json" + ] + } + } + }, + "recordedRepoMappingEntries": [] + } + }, + "@@rules_nodejs~//nodejs:extensions.bzl%node": { + "general": { + "bzlTransitiveDigest": "1HxpI0AgCvpGfUCJicdseptT6HrlCwj+F0XM5ewp5Ts=", + "recordedFileInputs": {}, + "recordedDirentsInputs": {}, + "envVariables": {}, + "generatedRepoSpecs": { + "nodejs_host": { + "bzlFile": "@@rules_nodejs~//nodejs/private:nodejs_repo_host_os_alias.bzl", + "ruleClassName": "nodejs_repo_host_os_alias", + "attributes": { + "user_node_repository_name": "nodejs" + } + }, + "nodejs_linux_s390x": { + "bzlFile": "@@rules_nodejs~//nodejs:repositories.bzl", + "ruleClassName": "node_repositories", + "attributes": { + "platform": "linux_s390x", + "node_version": "16.19.0" + } + }, + "nodejs_windows_amd64": { + "bzlFile": "@@rules_nodejs~//nodejs:repositories.bzl", + "ruleClassName": "node_repositories", + "attributes": { + "platform": "windows_amd64", + "node_version": "16.19.0" + } + }, + "nodejs_toolchains": { + "bzlFile": "@@rules_nodejs~//nodejs/private:toolchains_repo.bzl", + "ruleClassName": "toolchains_repo", + "attributes": { + "user_node_repository_name": "nodejs" + } + }, + "nodejs_linux_amd64": { + "bzlFile": "@@rules_nodejs~//nodejs:repositories.bzl", + "ruleClassName": "node_repositories", + "attributes": { + "platform": "linux_amd64", + "node_version": "16.19.0" + } + }, + "nodejs_linux_ppc64le": { + "bzlFile": "@@rules_nodejs~//nodejs:repositories.bzl", + "ruleClassName": "node_repositories", + "attributes": { + "platform": "linux_ppc64le", + "node_version": "16.19.0" + } + }, + "nodejs_darwin_amd64": { + "bzlFile": "@@rules_nodejs~//nodejs:repositories.bzl", + "ruleClassName": "node_repositories", + "attributes": { + "platform": "darwin_amd64", + "node_version": "16.19.0" + } + }, + "nodejs_linux_arm64": { + "bzlFile": "@@rules_nodejs~//nodejs:repositories.bzl", + "ruleClassName": "node_repositories", + "attributes": { + "platform": "linux_arm64", + "node_version": "16.19.0" + } + }, + "nodejs": { + "bzlFile": "@@rules_nodejs~//nodejs/private:nodejs_repo_host_os_alias.bzl", + "ruleClassName": "nodejs_repo_host_os_alias", + "attributes": { + "user_node_repository_name": "nodejs" + } + }, + "nodejs_darwin_arm64": { + "bzlFile": "@@rules_nodejs~//nodejs:repositories.bzl", + "ruleClassName": "node_repositories", + "attributes": { + "platform": "darwin_arm64", + "node_version": "16.19.0" + } + } + }, + "recordedRepoMappingEntries": [ + [ + "rules_nodejs~", + "bazel_skylib", + "bazel_skylib~" + ], + [ + "rules_nodejs~", + "bazel_tools", + "bazel_tools" + ] + ] + } + }, "@@rules_oci~//oci:extensions.bzl%oci": { "general": { "bzlTransitiveDigest": "8qkNzfL/ggii73B+EPGXyEbIqaBxFCUPgDjm91vn0lE=", diff --git a/README.md b/README.md index e97856c..799719a 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,5 @@ ![TRENTON](/tbfc.jpg) # Instructions + +[![CI](https://github.com/TrentonBowserFanClub/TrentonBot/actions/workflows/ci.yaml/badge.svg)](https://github.com/TrentonBowserFanClub/TrentonBot/actions/workflows/ci.yaml) diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod new file mode 100644 index 0000000..908750f --- /dev/null +++ b/WORKSPACE.bzlmod @@ -0,0 +1,14 @@ +# Marker that this is the root of a Bazel workspace +# This file shadows WORKSPACE.bazel under --enable_bzlmod. + +# Support repos that aren't on bazel central registry +# Needed until Bazel 7 allows MODULE.bazel to directly call repository rules + +# Copied from https://github.com/aspect-build/rules_lint/blob/main/example/WORKSPACE.bzlmod +load("@aspect_rules_lint//lint:ruff.bzl", "fetch_ruff") + +fetch_ruff() + +load("@aspect_rules_lint//lint:shellcheck.bzl", "fetch_shellcheck") + +fetch_shellcheck() diff --git a/src/api/v1/api.py b/src/api/v1/api.py index 6ea177a..43250c8 100644 --- a/src/api/v1/api.py +++ b/src/api/v1/api.py @@ -6,9 +6,10 @@ import cv2 app = FastAPI() -camera = cv2.VideoCapture(0,cv2.CAP_DSHOW) +camera = cv2.VideoCapture(0, cv2.CAP_DSHOW) templates = Jinja2Templates(directory="templates") + @app.get("/") def read_root(): return {"Hello": "World"} @@ -18,6 +19,7 @@ def read_root(): def read_item(item_id: int, q: Union[str, None] = None): return {"item_id": item_id, "q": q} + # https://stackoverflow.com/a/70626324 @app.websocket("/ws") async def get_stream(websocket: WebSocket): @@ -28,8 +30,8 @@ async def get_stream(websocket: WebSocket): if not success: break else: - ret, buffer = cv2.imencode('.jpg', frame) - await websocket.send_bytes(buffer.tobytes()) + ret, buffer = cv2.imencode(".jpg", frame) + await websocket.send_bytes(buffer.tobytes()) await asyncio.sleep(0.03) except (WebSocketDisconnect, ConnectionClosed): - print("Client disconnected") \ No newline at end of file + print("Client disconnected") diff --git a/src/api/v1/main.py b/src/api/v1/main.py index 36cea8d..a35513b 100644 --- a/src/api/v1/main.py +++ b/src/api/v1/main.py @@ -2,12 +2,4 @@ import sys if __name__ == "__main__": - # We insert this after the default argv at position 0 - # to ensure we bind to the `FastAPI` variable saved in - # our app. We put this in here as this is the root uvicorn - # invocation - otherwise we'd need to put it in all py_binary - # and oci_image rules. - #sys.argv.insert(1, "src.api.v1.api:app") sys.exit(uvicorn.main()) - - # sys.exit(uvicorn.run("src.api.v1.api:app", host="0.0.0.0")) \ No newline at end of file diff --git a/src/robot/v1/nodelete b/src/robot/v1/nodelete new file mode 100644 index 0000000..e69de29 diff --git a/src/ui/v1/nodelete b/src/ui/v1/nodelete new file mode 100644 index 0000000..f8f5cdb --- /dev/null +++ b/src/ui/v1/nodelete @@ -0,0 +1 @@ +nodelete \ No newline at end of file diff --git a/tools/format/BUILD.bazel b/tools/format/BUILD.bazel new file mode 100644 index 0000000..ece60cd --- /dev/null +++ b/tools/format/BUILD.bazel @@ -0,0 +1,16 @@ +"""BUILD definition for the formatter binary + +This is in its own package because it has so many loading-time symbols, +we don't want to trigger eager fetches of these for builds that don't want to run format. + +Copied from https://github.com/aspect-build/rules_lint/blob/main/example/tools/format/BUILD.bazel +""" + +load("@aspect_rules_lint//format:defs.bzl", "format_multirun") + +package(default_visibility = ["//:__subpackages__"]) + +format_multirun( + name = "format", + python = "//tools/lint:ruff", +) diff --git a/tools/lint/BUILD.bazel b/tools/lint/BUILD.bazel new file mode 100644 index 0000000..c35d65d --- /dev/null +++ b/tools/lint/BUILD.bazel @@ -0,0 +1,32 @@ +"""Definition of the formatter binary + +This is in its own package because it has so many loading-time symbols, +we don't want to trigger eager fetches of these for builds that don't want to run format. + +Copied from https://github.com/aspect-build/rules_lint/blob/main/example/tools/lint/BUILD.bazel +""" + +load("@aspect_rules_lint//lint:shellcheck.bzl", "shellcheck_binary") +load("@rules_python//python/entry_points:py_console_script_binary.bzl", "py_console_script_binary") + +package(default_visibility = ["//:__subpackages__"]) + +alias( + name = "ruff", + actual = select({ + "@bazel_tools//src/conditions:linux_x86_64": "@ruff_x86_64-unknown-linux-gnu//:ruff", + "@bazel_tools//src/conditions:linux_aarch64": "@ruff_aarch64-unknown-linux-gnu//:ruff", + "@bazel_tools//src/conditions:darwin_arm64": "@ruff_aarch64-apple-darwin//:ruff", + "@bazel_tools//src/conditions:darwin_x86_64": "@ruff_x86_64-apple-darwin//:ruff", + }), +) + +# We can test that it works with: +# bazel run :flake8 -- --help +py_console_script_binary( + name = "flake8", + pkg = "@pip//flake8:pkg", +) + +# bazel run :shellcheck -- --help +shellcheck_binary(name = "shellcheck") diff --git a/tools/lint/linters.bzl b/tools/lint/linters.bzl new file mode 100644 index 0000000..31a17c5 --- /dev/null +++ b/tools/lint/linters.bzl @@ -0,0 +1,31 @@ +"Define linter aspects." +# Copied from https://github.com/aspect-build/rules_lint/blob/main/example/tools/lint/linters.bzl + +load("@aspect_rules_lint//lint:flake8.bzl", "lint_flake8_aspect") +load("@aspect_rules_lint//lint:lint_test.bzl", "lint_test") +load("@aspect_rules_lint//lint:ruff.bzl", "lint_ruff_aspect") +load("@aspect_rules_lint//lint:shellcheck.bzl", "lint_shellcheck_aspect") + +ruff = lint_ruff_aspect( + binary = "@@//tools/lint:ruff", + configs = [ + "@@//:.ruff.toml", + "@@//src/subdir:ruff.toml", + ], +) + +ruff_test = lint_test(aspect = ruff) + +flake8 = lint_flake8_aspect( + binary = "@@//tools/lint:flake8", + config = "@@//:.flake8", +) + +flake8_test = lint_test(aspect = flake8) + +shellcheck = lint_shellcheck_aspect( + binary = "@@//tools/lint:shellcheck", + config = "@@//:.shellcheckrc", +) + +shellcheck_test = lint_test(aspect = shellcheck)