ruff: move per-file-ignores into inline noqa headers#1457
Open
hectorcast-db wants to merge 1 commit into
Open
Conversation
Replaces the centralized `[tool.ruff.lint.per-file-ignores]` block in pyproject.toml with inline `# ruff: noqa: <codes>` headers on the affected files. Matches the team's direction away from per-file-ignores. Generated files (databricks/sdk/__init__.py, service/*.py, errors/overrides.py, tests/databricks/sdk/service/*.py, tests/generated/*.py) get their headers from the codegen templates; re-run `genkit update-sdk` to regenerate. The matching template changes live in the universe PR. Hand-written changes: - core.py: `# ruff: noqa: F403, F405` for the star imports that re-export config and credentials_provider for backward compat. - errors/__init__.py: `# ruff: noqa: F401, F403, F405, F811` for the public re-export surface. - logger/__init__.py: `# ruff: noqa: F401` (re-exports RoundTrip). - runtime/__init__.py: `# noqa: F401` on the optional `from pyspark.sql.functions import udf` (intentionally probes availability inside a try/except). `make lint` passes cleanly.
|
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
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.
Why
Internal coding guidelines don't allow the centralized
[tool.ruff.lint.per-file-ignores]block inpyproject.toml. Exceptions must be annotated inline on the files that need them. Most of the affected files are generated, so the noqa headers have to come from the codegen templates.What
Removes the
[tool.ruff.lint.per-file-ignores]block frompyproject.tomland replaces it with inline# ruff: noqa: <codes>headers on the affected files.Where the noqas come from
databricks/sdk/__init__.pypysdkv0/templates/batch/init.py.tmpl)databricks/sdk/service/*.py+tests/databricks/sdk/service/*.pypysdkv0/templates/packages/service.py.tmpl)databricks/sdk/errors/overrides.pypysdkv0/templates/batch/error_overrides.py.tmpl)tests/generated/test_*.pypysdkv0/unittestgen/{http,lro,marshall,idempotency})databricks/sdk/core.pydatabricks/sdk/errors/__init__.pydatabricks/sdk/logger/__init__.pyRoundTrip)databricks/sdk/runtime/__init__.pyline 127F401 stays uncovered on
service/*.pyon purpose:make fmtrunsruff check --fix-onlyto strip the fat-import header emitted by the codegen template. Ignoring F401 there would defeat that (the autoflake-equivalent behavior the SDK relies on).Paired PR
Template changes land in databricks-eng/universe#2008679. Regenerate via
bazel build //openapi/genkitthengenkit update-sdk --dir .from this checkout. Generation job runs once a day, so the two PRs are safe to merge outside of that window.Verification
This pull request and its description were written by Isaac.
NO_CHANGELOG=true