Skip to content

Commit 65b5077

Browse files
authored
Lint all python code (#4768)
### What I don't know why we used to have a list of folders to run python linting on, but running it recursively on "." seems to work just as fine. ### 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/4768/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/4768/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/4768/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/4768) - [Docs preview](https://rerun.io/preview/c964b6f091bc745e90c46a5cb2e7efa3d9bc61b0/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/c964b6f091bc745e90c46a5cb2e7efa3d9bc61b0/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
1 parent 7a921a8 commit 65b5077

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ cpp-plot-dashboard *ARGS:
6060

6161
### Python
6262

63-
py_folders := "docs/code-examples examples rerun_py scripts tests"
63+
py_folders := "."
6464

6565
# Set up a Pythonvirtual environment for development
6666
py-dev-env:

noxfile.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
"""Nox sessions.
1+
"""
2+
Nox sessions.
23
34
This file is used by `nox` to run tests and examples against multiple Python versions.
45
@@ -9,13 +10,12 @@
910

1011
import nox # type: ignore
1112

12-
1313
PYTHON_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]
1414

1515

1616
@nox.session(python=PYTHON_VERSIONS)
1717
def tests(session: nox.Session) -> None:
18-
"""Run the Python test suite"""
18+
"""Run the Python test suite."""
1919
session.install("-r", "rerun_py/requirements-build.txt")
2020

2121
# TODO(#4704): clean that up when torch is 3.12 compatible
@@ -30,7 +30,7 @@ def tests(session: nox.Session) -> None:
3030

3131
@nox.session(python=PYTHON_VERSIONS)
3232
def run_all(session: nox.Session) -> None:
33-
"""Run all examples through the run_all.py script (pass args with: "-- <args>")"""
33+
"""Run all examples through the run_all.py script (pass args with: "-- <args>")."""
3434

3535
# TODO(#4704): clean that up when torch is 3.12 compatible
3636
if session.python == "3.12":
@@ -48,7 +48,7 @@ def run_all(session: nox.Session) -> None:
4848

4949
@nox.session(python=PYTHON_VERSIONS)
5050
def roundtrips(session: nox.Session) -> None:
51-
"""Run all roundtrip tests (C++ will be built only once / skip with: "-- --no-cpp-build")"""
51+
"""Run all roundtrip tests (C++ will be built only once / skip with: "-- --no-cpp-build")."""
5252

5353
global roundtrip_cpp_built
5454

rerun_py/pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,14 @@ select = [
108108
]
109109

110110
[tool.ruff.per-file-ignores]
111-
"docs/code-examples/*" = ["I002"]
111+
"docs/code-examples/*" = [
112+
# Missing required import: `from __future__ import annotations`
113+
"I002",
114+
]
115+
"crates/re_viewer/data/quick_start_guides/*" = [
116+
# Missing required import: `from __future__ import annotations`
117+
"I002",
118+
]
112119
"__init__.py" = ["F401", "F403"]
113120

114121
[tool.ruff.isort]

scripts/fast_lint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def run_cmd(self, files: list[str], skip_list: list[str], no_change_filter: bool
7676
return proc.returncode == 0
7777

7878

79-
PY_FOLDERS = ["docs/code-examples", "examples", "rerun_py", "scripts", "tests"]
79+
PY_FOLDERS = ["."]
8080

8181

8282
def main() -> None:

0 commit comments

Comments
 (0)