FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

chore: fix inconsistency between lint and format by daniel-sanche · Pull Request #18134 · googleapis/google-cloud-python · GitHub

chore: fix inconsistency between lint and format - #18134

Open
daniel-sanche wants to merge 17 commits into
mainfrom
fix_lint_gap
Open

chore: fix inconsistency between lint and format#18134
daniel-sanche wants to merge 17 commits into
mainfrom
fix_lint_gap

Conversation

daniel-sanche commented Aug 17, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

In #18129 it was revealed that lint doesn't check import orderings, but format does. This can result in an issue where code passes the checker, but later fails consistency checks, after running through the formatter

This PR adds an extra step to lint to verify import ordering

Changes will roll out to generated libraries after the next generation cycle

gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Code Review

This pull request adds an import checking step using Ruff (ruff check --select I) to various noxfile.py configurations, templates, and integration goldens across multiple packages. It also includes a minor import reordering in a Bigtable unit test file. There are no review comments, so no feedback is provided.

daniel-sanche changed the title chore(tests): fix inconsistency between lint and format chore: fix inconsistency between lint and format Aug 17, 2026
daniel-sanche marked this pull request as ready for review August 17, 2026 21:51
daniel-sanche requested review from a team as code owners August 17, 2026 21:51

parthea commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

There is a diff when running code generation for google-cloud-spanner. I didn't check all packages. Please can you run generation for all the packages that were changed so there is no diff?

(py3142) partheniou@partheniou-vm-3:~/google-cloud-python-20260818$ git diff
diff --git a/packages/google-cloud-spanner/noxfile.py b/packages/google-cloud-spanner/noxfile.py
index d0a3573f350..c1571f20636 100644
--- a/packages/google-cloud-spanner/noxfile.py
+++ b/packages/google-cloud-spanner/noxfile.py
@@ -103,6 +103,17 @@ def lint(session):
     """
     session.install("flake8", RUFF_VERSION)
 
+    # 1. Check imports
+    session.run(
+        "ruff",
+        "check",
+        "--select",
+        "I",
+        f"--target-version=py{ALL_PYTHON[0].replace('.', '')}",
+        "--line-length=88",
+        *LINT_PATHS,
+    )
+
     # 2. Check formatting
     session.run(
         "ruff",

parthea commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

I'm going to switch this to draft but please mark it ready for review once the generated code has been updated

parthea marked this pull request as draft August 18, 2026 14:57

parthea left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Revert the changes to .librarian/generator-input/client-post-processing/bigtable-integration.yaml and .librarian/generator-input/client-post-processing/spanner-integration.yaml since code generation will happen in a future PR

daniel-sanche commented Aug 19, 2026
edited
Loading

Copy link
Copy Markdown
Contributor Author

Revert the changes to .librarian/generator-input/client-post-processing/bigtable-integration.yaml and .librarian/generator-input/client-post-processing/spanner-integration.yaml since code generation will happen in a future PR

I reverted them for now. But does this mean we'll have to come back and finish this after the next generation?

Could we also apply the generated changes for these libraries early here, and prevent the diff that way?

daniel-sanche marked this pull request as ready for review August 19, 2026 22:26
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL