Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/gapic-generator-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,17 @@ jobs:
for pkg in credentials eventarc logging redis; do
nox -f tests/integration/goldens/$pkg/noxfile.py -s format lint unit-${{ needs.python_config.outputs.latest_stable_python }}
done
# Run pylint (errors-only) over the goldens so generator regressions
# like undefined names or import-time breakage that ruff/flake8 do
# not flag are caught at PR time.
# See https://github.com/googleapis/google-cloud-python/issues/16393.
- name: Pylint goldens (errors only)
run: |
pip install --quiet pylint
cd packages/gapic-generator/tests/integration/goldens
for pkg in credentials eventarc logging redis; do
pylint --rcfile=.pylintrc --errors-only --recursive=y "$pkg/google"
done

goldens-prerelease:
needs: python_config
Expand Down
28 changes: 28 additions & 0 deletions packages/gapic-generator/tests/integration/goldens/.pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Pylint configuration for golden client libraries.
#
# These goldens are auto-generated GAPIC client output (see
# packages/gapic-generator/gapic/templates/). They are checked in as test
# fixtures so that regressions in the generator are caught at PR time.
#
# Pylint is invoked with `--errors-only` from CI so only error/fatal
# categories run. This file disables the small set of error-class checks
# that consistently misfire on auto-generated GAPIC output (proto
# descriptor lookups, dynamic attribute attachment, optional transports).
# Tighten as the generator's output is cleaned up.
#
# See https://github.com/googleapis/google-cloud-python/issues/16393.

[MAIN]
ignore-patterns=.*_pb2\.py,.*_pb2_grpc\.py
extension-pkg-allow-list=grpc,google.protobuf

[MESSAGES CONTROL]
disable=
no-name-in-module,
no-member,
import-error,
relative-beyond-top-level,
cyclic-import
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.

medium

The disable list includes no-name-in-module (E0611) and import-error (E0401), which appears to conflict with the stated goal of catching "broken imports." These checks are the primary way Pylint identifies missing modules or missing attributes within a module. If they are disabled because they "consistently misfire," it might be worth investigating if the CI environment's PYTHONPATH can be configured to include the generated packages instead of disabling the checks globally.

Additionally, relative-beyond-top-level (W0402) and cyclic-import (R0401) are redundant in this list because they are not Error-level messages, and the CI is configured to run with --errors-only.


[REPORTS]
score=no
Loading