Skip to content

Commit

Permalink
Run taplo and typos always via pixi (#4913)
Browse files Browse the repository at this point in the history
### What

* Fixes #4907
* Chips away on #4170


### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/4913/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/4913/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/4913/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG

- [PR Build Summary](https://build.rerun.io/pr/4913)
- [Docs
preview](https://rerun.io/preview/efc4b733c65083d1bc5901edb024ea125164b8e3/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/efc4b733c65083d1bc5901edb024ea125164b8e3/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
  • Loading branch information
Wumpf committed Jan 26, 2024
1 parent acd699c commit b18c182
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 30 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/auto_release_crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install taplo-cli
uses: taiki-e/install-action@v2
- uses: prefix-dev/setup-pixi@v0.4.1
with:
tool: taplo-cli
pixi-version: v0.6.0

- name: Install dependencies
shell: bash
Expand All @@ -35,7 +34,7 @@ jobs:
run: |
python3 scripts/ci/crates.py version --bump prerelease
- run: taplo fmt
- run: pixi run toml-fmt
shell: bash

- name: Get bumped version
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/contrib_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,12 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install taplo-cli
uses: taiki-e/install-action@v2
- uses: prefix-dev/setup-pixi@v0.4.1
with:
tool: taplo-cli
pixi-version: v0.6.0

- name: Taplo check
- run: pixi run lint-taplo
shell: bash
run: |
taplo fmt --check --diff

misc-rerun-lints:
name: Rerun lints
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,9 @@ jobs:
run: |
python3 -m pip install -r ./scripts/ci/requirements-crates.txt
- name: Install taplo-cli
uses: taiki-e/install-action@v2
- uses: prefix-dev/setup-pixi@v0.4.1
with:
tool: taplo-cli
pixi-version: v0.6.0

- name: Update crate versions
id: versioning
Expand Down Expand Up @@ -147,7 +146,7 @@ jobs:
run: |
cmake -B build -S .
- run: taplo fmt
- run: pixi run toml-fmt
shell: bash

- name: Commit new version
Expand Down Expand Up @@ -389,19 +388,18 @@ jobs:
run: |
python3 -m pip install -r scripts/ci/requirements-crates.txt
- name: Install taplo-cli
uses: taiki-e/install-action@v2
with:
tool: taplo-cli

- name: Update version
id: update-version
shell: bash
run: |
python3 scripts/ci/crates.py version --bump auto
echo "version=$(python3 scripts/ci/crates.py get-version)" >> "$GITHUB_OUTPUT"
- run: taplo fmt
- uses: prefix-dev/setup-pixi@v0.4.1
with:
pixi-version: v0.6.0

- run: pixi run toml-fmt
shell: bash

- name: Commit new version
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/reusable_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,14 @@ jobs:
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || '' }}

- name: Install taplo-cli
uses: taiki-e/install-action@v2
- uses: prefix-dev/setup-pixi@v0.4.1
with:
tool: taplo-cli
pixi-version: v0.6.0

- name: Taplo check
shell: bash
run: |
taplo fmt --check --diff
pixi run lint-taplo
# ---------------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,11 @@ rs-plot-dashboard *ARGS:

# Format .toml files
toml-format:
taplo fmt
pixi run toml-fmt

# Lint .toml files
toml-lint:
taplo fmt --check --diff
pixi run lint-taplo


### Misc
Expand Down
5 changes: 3 additions & 2 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ lint-py-fmt-check = "ruff format --check --config rerun_py/pyproject.toml"
lint-py-blackdoc = "blackdoc --check"
lint-py-mypy = "mypy --install-types --non-interactive --no-warn-unused-ignore"
lint-py-ruff = "ruff check --config rerun_py/pyproject.toml"
lint-taplo = "taplo fmt --check"
lint-taplo = "taplo fmt --check --diff"
lint-typos = "typos"

misc-fmt = "prettier --write '**/*.{yml,yaml,js,css,html}'"
misc-fmt-check = "prettier --check '**/*.{yml,yaml,js,css,html}'"
toml-fmt = "taplo fmt"

py-build = "maturin develop --manifest-path rerun_py/Cargo.toml --extras=tests"
py-test = { cmd = "python -m pytest -vv rerun_py/tests/unit", depends_on = [
Expand Down Expand Up @@ -115,7 +116,7 @@ pytest = ">=7"
python = ">=3.8,<3.12"
ruff = "0.1.2"
semver = ">=2.13,<2.14"
taplo = ">=0.8.1"
taplo = "=0.8.1"
typing_extensions = ">4.5"
typos = ">=1.16.20"
wheel = ">=0.38,<0.39"
Expand Down
2 changes: 0 additions & 2 deletions scripts/setup_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ curl -fsSL https://pixi.sh/install.sh | bash
cargo install cargo-cranky # Uses lints defined in Cranky.toml. See https://github.com/ericseppanen/cargo-cranky
cargo install --locked cargo-deny # https://github.com/EmbarkStudios/cargo-deny
cargo install just # https://github.com/casey/just - a command runner
cargo install taplo-cli --locked # https://github.com/tamasfe/taplo - toml formatter/linter/lsp
cargo install typos-cli # https://github.com/crate-ci/typos - typo detector


packagesNeeded='pngcrush pipx clang-format flatbuffers'
Expand Down
2 changes: 2 additions & 0 deletions taplo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# https://github.com/tamasfe/taplo

exclude = [".pixi/**", "build/**", "target/**", "venv/**"]

[formatting]
indent_string = " "

0 comments on commit b18c182

Please sign in to comment.