gemini-code-assist[bot] commented on code in PR #38306:
URL: https://github.com/apache/beam/pull/38306#discussion_r3155955735


##########
sdks/python/pyproject.toml:
##########
@@ -44,3 +44,165 @@ requires = [
 
 # legacy installation is needed to generate `apache_beam.portability.api` 
package.
 build-backend = "setuptools.build_meta"
+
+[tool.isort]
+py_version = 310
+line_length = 120
+old_finders = true
+order_by_type = true
+force_single_line = true
+combine_star = true
+src_paths = ["apache_beam"]
+extra_standard_library = ["dataclasses"]
+known_third_party = ["yaml"]
+skip = [
+    "apiclient.py",
+    "avroio_test.py",
+    "cloudpickle.py",
+    "datastore_wordcount.py",
+    "datastoreio_test.py",
+    "doctests_test.py",
+    "fast_coders_test.py",
+    "hadoopfilesystem.py",
+    "iobase_test.py",
+    "main_test.py",
+    "model.py",
+    "preprocess.py",
+    "process_tfma.py",
+    "render_test.py",
+    "slow_coders_test.py",
+    "taxi.py",
+    "tfdv_analyze_and_validate.py",
+    "yaml/main.py",
+    "yaml_testing_test.py",
+    "bigquery_v2_client.py",
+    "bigquery_v2_messages.py",
+    "dataflow_v1b3_client.py",
+    "dataflow_v1b3_messages.py",
+    "storage_v1_client.py",
+    "storage_v1_messages.py",
+    "proto2_coder_test_messages_pb2.py",
+    "cloudbuild_v1_client.py",
+    "cloudbuild_v1_messages.py",
+    "boto3_client.py",
+]
+skip_glob = [
+    "*.pxd",
+    "*.pyx",
+    "*pb2*.py",
+    "**/examples/**/*.py",
+    "**/portability/api/**/*.py",
+    "**/portability/api/__init__.py",
+]
+
+[tool.ruff]
+exclude = [
+    ".bzr",
+    ".direnv",
+    ".eggs",
+    ".git",
+    ".git-rewrite",
+    ".hg",
+    ".ipynb_checkpoints",
+    ".mypy_cache",
+    ".nox",
+    ".pants.d",
+    ".pyenv",
+    ".pytest_cache",
+    ".pytype",
+    ".ruff_cache",
+    ".svn",
+    ".tox",
+    ".venv",
+    ".vscode",
+    "__pypackages__",
+    "_build",
+    "buck-out",
+    "build",
+    "dist",
+    "node_modules",
+    "site-packages",
+    "venv",
+    "*.pxd",
+    "*.pyx",
+    "*pb2*.py",
+    "**/examples/**/*.py",
+    "**/examples/**/*.ipynb",
+    "**/portability/api/**/*.py",
+    "**/portability/api/__init__.py",
+]
+target-version = "py310"
+src = ["apache_beam"]
+
+[tool.ruff.lint]
+select = ["E9", "PL", "F821", "F822", "F823"]
+ignore = [
+    "PLC0415",
+    "PLR2004",
+    "PLR0913",
+    "PLR0912",
+    "PLW0108",
+    "PLW2901",
+    "PLR0915",
+    "PLR1714",
+    "PLR0911",
+    "PLR5501",
+    "PLW0603",
+    "PLR1730",
+    "PLW1641",
+    "PLW0602",
+    "PLC1802",
+    "PLC3002",
+    "PLW0642",
+    "PLR1733",
+    "PLR0402",
+    "PLC0132",
+    "PLC0206",
+    "PLC0207",
+    "PLR1704",
+    "PLR1711",
+    "PLW0406",
+    "PLW3301",
+    "PLR2044",
+]
+fixable = ["ALL"]
+unfixable = []
+dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   The descriptive comments for the ignored Ruff rules and other configurations 
were lost during the migration. Restoring these comments improves 
maintainability by explaining the purpose of each suppression and setting.
   
   ```
   ignore = [
       # Ignored Pylint Checks
       "PLC0415",  # import-outside-toplevel
       "PLR2004",  # magic-value-comparison
       "PLR0913",  # too-many-arguments
       "PLR0912",  # too-many-branches
       "PLW0108",  # unnecessary-lambda
       "PLW2901",  # redefined-loop-name
       "PLR0915",  # too-many-statements
       "PLR1714",  # repeated-equality-comparison
       "PLR0911",  # too-many-return-statements
       "PLR5501",  # collapsible-else-if
       "PLW0603",  # global-statement
       "PLR1730",  # if-stmt-min-max
       "PLW1641",  # eq-without-hash
       "PLW0602",  # global-variable-not-assigned
       "PLC1802",  # len-test
       "PLC3002",  # unnecessary-direct-lambda-call
       "PLW0642",  # self-or-cls-assignment
       "PLR1733",  # unnecessary-dict-index-lookup
       "PLR0402",  # manual-from-import
       "PLC0132",  # type-param-name-mismatch
       "PLC0206",  # dict-index-missing-items
       "PLC0207",  # missing-maxsplit-arg
       "PLR1704",  # redefined-argument-from-local
       "PLR1711",  # useless-return
       "PLW0406",  # import-self
       "PLW3301",  # nested-min-max
       "PLR2044",  # empty-comment
   ]
   
   # Allow fix for all enabled rules (when --fix) is provided.
   fixable = ["ALL"]
   unfixable = []
   
   # Allow unused variables when underscore-prefixed.
   dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
   ```



##########
sdks/python/pyproject.toml:
##########
@@ -44,3 +44,165 @@ requires = [
 
 # legacy installation is needed to generate `apache_beam.portability.api` 
package.
 build-backend = "setuptools.build_meta"
+
+[tool.isort]
+py_version = 310
+line_length = 120
+old_finders = true
+order_by_type = true
+force_single_line = true
+combine_star = true
+src_paths = ["apache_beam"]
+extra_standard_library = ["dataclasses"]
+known_third_party = ["yaml"]
+skip = [
+    "apiclient.py",
+    "avroio_test.py",
+    "cloudpickle.py",
+    "datastore_wordcount.py",
+    "datastoreio_test.py",
+    "doctests_test.py",
+    "fast_coders_test.py",
+    "hadoopfilesystem.py",
+    "iobase_test.py",
+    "main_test.py",
+    "model.py",
+    "preprocess.py",
+    "process_tfma.py",
+    "render_test.py",
+    "slow_coders_test.py",
+    "taxi.py",
+    "tfdv_analyze_and_validate.py",
+    "yaml/main.py",
+    "yaml_testing_test.py",
+    "bigquery_v2_client.py",
+    "bigquery_v2_messages.py",
+    "dataflow_v1b3_client.py",
+    "dataflow_v1b3_messages.py",
+    "storage_v1_client.py",
+    "storage_v1_messages.py",
+    "proto2_coder_test_messages_pb2.py",
+    "cloudbuild_v1_client.py",
+    "cloudbuild_v1_messages.py",
+    "boto3_client.py",
+]
+skip_glob = [
+    "*.pxd",
+    "*.pyx",
+    "*pb2*.py",
+    "**/examples/**/*.py",
+    "**/portability/api/**/*.py",
+    "**/portability/api/__init__.py",
+]
+
+[tool.ruff]
+exclude = [
+    ".bzr",
+    ".direnv",
+    ".eggs",
+    ".git",
+    ".git-rewrite",
+    ".hg",
+    ".ipynb_checkpoints",
+    ".mypy_cache",
+    ".nox",
+    ".pants.d",
+    ".pyenv",
+    ".pytest_cache",
+    ".pytype",
+    ".ruff_cache",
+    ".svn",
+    ".tox",
+    ".venv",
+    ".vscode",
+    "__pypackages__",
+    "_build",
+    "buck-out",
+    "build",
+    "dist",
+    "node_modules",
+    "site-packages",
+    "venv",
+    "*.pxd",
+    "*.pyx",
+    "*pb2*.py",
+    "**/examples/**/*.py",
+    "**/examples/**/*.ipynb",
+    "**/portability/api/**/*.py",
+    "**/portability/api/__init__.py",
+]
+target-version = "py310"
+src = ["apache_beam"]
+
+[tool.ruff.lint]
+select = ["E9", "PL", "F821", "F822", "F823"]
+ignore = [
+    "PLC0415",
+    "PLR2004",
+    "PLR0913",
+    "PLR0912",
+    "PLW0108",
+    "PLW2901",
+    "PLR0915",
+    "PLR1714",
+    "PLR0911",
+    "PLR5501",
+    "PLW0603",
+    "PLR1730",
+    "PLW1641",
+    "PLW0602",
+    "PLC1802",
+    "PLC3002",
+    "PLW0642",
+    "PLR1733",
+    "PLR0402",
+    "PLC0132",
+    "PLC0206",
+    "PLC0207",
+    "PLR1704",
+    "PLR1711",
+    "PLW0406",
+    "PLW3301",
+    "PLR2044",
+]
+fixable = ["ALL"]
+unfixable = []
+dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
+
+[tool.pyrefly]
+project-includes = ["apache_beam"]
+python-version = "3.10.0"
+ignore-missing-imports = ["*"]
+untyped-def-behavior = "skip-and-infer-return-any"
+
+[tool.pyrefly.errors]
+missing-attribute = "ignore"
+invalid-annotation = "ignore"
+redundant-condition = "ignore"
+untyped-import = "ignore"
+bad-param-name-override = "ignore"

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   The `TODO` and context regarding the order of suppressed errors in Pyrefly 
were omitted. This information is valuable for future maintenance and cleanup 
of type-checking ignores.
   
   ```suggestion
   [tool.pyrefly.errors]
   missing-attribute = "ignore"
   invalid-annotation = "ignore"
   redundant-condition = "ignore"
   untyped-import = "ignore"
   
   # Beam-specific supressions to keep pyrefly green
   # These are in descending order of instances.
   #
   # TODO(https://github.com/apache/beam/issues/37699): Reduce the number of
   # ignored checks.
   bad-param-name-override = "ignore"
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to