Unify ruff config and apply lint fixes across all sub-repos#1703
Merged
cpcloud merged 42 commits intoNVIDIA:mainfrom Mar 3, 2026
Merged
Unify ruff config and apply lint fixes across all sub-repos#1703cpcloud merged 42 commits intoNVIDIA:mainfrom
cpcloud merged 42 commits intoNVIDIA:mainfrom
Conversation
Contributor
Merge cuda_pathfinder's [tool.ruff] into the top-level ruff.toml and remove the duplicate. The unified config is the union of all lint rules (adding ARG, Q, N, C4, PIE, T20, RUF, PT, DTZ) with sane per-file ignores for tests, examples, benchmarks, scripts, and CUDA naming conventions in cuda_bindings. Made-with: Cursor
Made-with: Cursor
- Remove combine-as-imports (keep as-imports separate from bare imports) - Add C408 to global ignores (dict()/list()/tuple() calls are fine) - Add RUF005 to global ignores (list concatenation is fine) - Add E402, F403, F405 to __init__.py per-file-ignores - Add E702, B028 to test per-file-ignores - Add T201 for canary_probe_subprocess.py Made-with: Cursor
- I001: unsorted imports — 48 fixed across 48 files Made-with: Cursor
- RUF100: unused-noqa — 80 fixed across 24 files Made-with: Cursor
- C416: unnecessary-comprehension — use set()/list() directly - C401: unnecessary-generator-set — use set comprehension - C419: unnecessary-comprehension-in-call — use generator in all()/any() - C400: unnecessary-generator-list — use list comprehension - C414: unnecessary-double-cast-or-process — remove redundant list() - C420: unnecessary-dict-comprehension — use dict.fromkeys() 40 fixed across 10 files Made-with: Cursor
- PIE808: unnecessary-range-start — remove redundant range(0, n) - PIE790: unnecessary-placeholder — remove pass after docstring - PIE810: multiple-starts-ends-with — consolidate into tuple arg 3 fixed across 3 files Made-with: Cursor
- PT003: extraneous-scope-function — remove default scope="function" - PT022: pytest-useless-yield-fixture — convert yield fixture to return - PT001: pytest-fixture-incorrect-parentheses — remove empty parentheses - PT013: pytest-incorrect-pytest-import — use pytest.param instead of from pytest import param 18 fixed across 4 files Made-with: Cursor
- RUF022: unsorted-dunder-all — sort __all__ entries (4 fixes across 4 files) - RUF023: unsorted-dunder-slots — sort __slots__ entries (3 fixes across 1 file) - RUF012: mutable-class-default — suppress with noqa for lookup tables (5 fixes in 1 file) Made-with: Cursor
- E711: none-comparison — use 'is not None' instead of '!= None' (1 fix in 1 file) Made-with: Cursor
- N806: non-lowercase-variable-in-function — rename CUDA_PATH to cuda_path (2 fixes in 1 file) - N816: mixed-case-variable-in-global-scope — suppress for CUDA API naming (1 noqa in 1 file) - N801: invalid-class-name — suppress for setuptools convention (1 noqa in 1 file) Made-with: Cursor
- ARG002: unused-method-argument — suppress for interface method (1 noqa in 1 file) Made-with: Cursor
- F401: unused-import — suppress for re-exports and side-effect imports (4 noqa in 2 files) Made-with: Cursor
- B018: useless-expression — suppress for property access expected to raise (2 noqa in 1 file) Made-with: Cursor
- S110: try-except-pass — suppress for best-effort cleanup (5 noqa in 2 files) - S102: exec-builtin — suppress in test code (2 noqa in 2 files) - S301: suspicious-pickle-usage — suppress in test code (3 noqa in 3 files) Made-with: Cursor
- I001: unsorted imports — 42 fixed across NFILES files Made-with: Cursor
- RUF100: unused-noqa — 16 fixed across 9 files Made-with: Cursor
- C416: unnecessary-comprehension — use set()/list() directly - C401: unnecessary-generator-set — use set comprehension - C419: unnecessary-comprehension-in-call — use generator in all()/any() - C400: unnecessary-generator-list — use list comprehension - C414: unnecessary-double-cast-or-process — remove redundant list() - C420: unnecessary-dict-comprehension — use dict.fromkeys() 9 fixed across 3 files Made-with: Cursor
- PIE808: unnecessary-range-start — remove redundant range(0, n) - PIE790: unnecessary-placeholder — remove pass after docstring - PIE810: multiple-starts-ends-with — consolidate into tuple arg 5 fixed across 4 files Made-with: Cursor
- PT003: extraneous-scope-function — remove default scope="function" (4 fixes) - PT001: pytest-fixture-incorrect-parentheses — remove empty parentheses 4 fixed across 1 files Made-with: Cursor
- F401: unused-import — suppress for intentional re-exports and side-effect imports (2 noqa in 2 files) Made-with: Cursor
- S110: try-except-pass — suppress for best-effort cleanup (2 noqa in 1 file) - S603: subprocess-without-shell-equals-true — suppress at call site (5 noqa in 4 files) - S607: start-process-with-partial-path — suppress at call site (3 noqa in 2 files) Made-with: Cursor
- RUF100: unused-noqa — 12 fixed across 7 files Made-with: Cursor
- SIM102: collapsible-if — merge nested if statements (1 fix in 1 file) - SIM105: suppressible-exception — use contextlib.suppress instead of try/except/pass (1 fix in 1 file) Made-with: Cursor
- S110: try-except-pass — suppress for best-effort cleanup (1 noqa in 1 file) Made-with: Cursor
- I001: unsorted imports — across 1 files Made-with: Cursor
- RUF100: unused-noqa — 1 fixed across 1 files Made-with: Cursor
- RUF059: unused-unpacked-variable — prefix unused vars with underscore (2 fixes in 1 file) Made-with: Cursor
- I001: unsorted imports — across 2 files Made-with: Cursor
- RUF100: unused-noqa — 2 fixed across 1 files Made-with: Cursor
- DTZ011: call-date-today — use timezone-aware datetime.now(tz=utc) (1 fix in 1 file) Made-with: Cursor
- N806: non-lowercase-variable-in-function — rename TILE_SIZE to tile_size (1 fix in 1 file) Made-with: Cursor
- S603: subprocess-without-shell-equals-true — suppress at call site (1 noqa in 1 file) - S607: start-process-with-partial-path — suppress at call site (1 noqa in 1 file) Made-with: Cursor
- RUF100: unused-noqa — 1 fixed across 1 files Made-with: Cursor
- RUF013: implicit-optional — annotate as T | None explicitly (2 fixes in 1 file) Made-with: Cursor
- S603: subprocess-without-shell-equals-true — suppress at call site (1 noqa in 1 file) Made-with: Cursor
- ARG001: unused-function-argument — suppress for pytest hook signature (1 noqa in 1 file) Made-with: Cursor
Made-with: Cursor
- 2 files reformatted (cuda_core/cuda/core/system/__init__.py, cuda_core/tests/test_utils.py) Made-with: Cursor
2202302 to
e3a033f
Compare
Contributor
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
ctypes Structure._fields_ is a standard pattern, not a mutable default concern Made-with: Cursor
b6de826 to
1e931db
Compare
Contributor
Author
|
/ok to test |
Read CU_MEM_ALLOCATION_TYPE_* from CUmemAllocationType instead of CUmemAccess_flags so cuda.core imports correctly in test/docs CI jobs. Made-with: Cursor
Contributor
Author
|
/ok to test |
This comment has been minimized.
This comment has been minimized.
Switch test parametrization calls to pytest.param so collection succeeds under current pytest and the pixi cuda_core suite runs end-to-end. Made-with: Cursor
Contributor
Author
|
/ok to test |
rwgk
approved these changes
Mar 3, 2026
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
ruff.toml, removing the duplicated[tool.ruff]section fromcuda_pathfinder/pyproject.tomlruff >=0.15.3to pixi dependenciesRule categories applied
# noqacommentsConfig decisions
dict()andlist + listare finecombine-as-importsis off — aliased imports stay separate from bare imports# noqa, not via global/per-file ignorescuda_bindings/since it mirrors C API naming; specific suppressions elsewhereCloses #1677
Test plan
ruff checkpasses with zero violationsruff format --checkpasses with zero reformatted filesMade with Cursor