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


##########
sdks/python/tox.ini:
##########
@@ -218,7 +219,7 @@ extras =
   gcp
 commands =
   mypy --version
-  python setup.py mypy
+  time python setup.py mypy

Review Comment:
   ![high](https://www.gstatic.com/codereviewagent/high-priority.svg)
   
   This environment is broken because the `mypy` command was renamed to 
`pyrefly` in `setup.py`. Additionally, since `pyrefly` is now executed as part 
of the `lint` environment (lines 202-203), this separate environment may be 
redundant. If it is still needed, it should be updated to use `pyrefly` and 
ensure the `dev` extra is included in the environment dependencies.
   
   ```
     pyrefly --version
     time python setup.py pyrefly
   ```



##########
.pre-commit-config.yaml:
##########
@@ -31,12 +31,11 @@ repos:
                 sdks/python/apache_beam/portability/api/.*pb2.*.py
             )$
 
-  - repo: https://github.com/pycqa/pylint
-    # this rev is a release tag in the repo above and corresponds with a pylint
-    # version. make sure this matches the version of pylint in tox.ini.
-    rev: v4.0.2
+  - repo: https://github.com/astral-sh/ruff-pre-commit
+    # this rev is a release tag in the repo above and corresponds with a ruff
+    # version. make sure this matches the version of yapf in setup.py

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   The comment incorrectly refers to `yapf`. Since this block is for the `ruff` 
pre-commit hook, it should be updated to say `ruff` to avoid confusion.
   
   ```yaml
       # version. make sure this matches the version of ruff in setup.py
   ```



##########
.pre-commit-config.yaml:
##########
@@ -31,12 +31,11 @@ repos:
                 sdks/python/apache_beam/portability/api/.*pb2.*.py
             )$
 
-  - repo: https://github.com/pycqa/pylint
-    # this rev is a release tag in the repo above and corresponds with a pylint
-    # version. make sure this matches the version of pylint in tox.ini.
-    rev: v4.0.2
+  - repo: https://github.com/astral-sh/ruff-pre-commit
+    # this rev is a release tag in the repo above and corresponds with a ruff
+    # version. make sure this matches the version of yapf in setup.py
+    rev: v0.15.7
     hooks:
-      - id: pylint
-        args: ["--rcfile=sdks/python/.pylintrc"]
-        files: ^sdks/python/apache_beam/
-        exclude: *exclude
+      - id: ruff-check
+        files: "sdks/python/apache_beam"

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   The `files` pattern for pre-commit is a regular expression. The previous 
pattern `^sdks/python/apache_beam/` was more precise. Using 
`"sdks/python/apache_beam"` might match unintended paths that contain this 
string but are not within the target directory.
   
   ```yaml
           files: ^sdks/python/apache_beam/
   ```



##########
sdks/python/test-suites/tox/pycommon/build.gradle:
##########
@@ -41,5 +41,5 @@ check.dependsOn formatter
 toxTask "lint", "lint", "${posargs}"
 linter.dependsOn lint
 
-toxTask "mypy", "mypy", "${posargs}"
-linter.dependsOn mypy
+// toxTask "mypy", "mypy", "${posargs}"
+// linter.dependsOn mypy

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   Avoid leaving commented-out code in the repository. Since the `mypy` task is 
being replaced by `pyrefly` or integrated into the `lint` task, these lines 
should be removed entirely.



-- 
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