Skip to content

fix(entry_point): ignore type lints on the generated files#3736

Merged
aignas merged 3 commits intobazel-contrib:mainfrom
aignas:aignas.chore.mypy-ignore-entry-point
Apr 26, 2026
Merged

fix(entry_point): ignore type lints on the generated files#3736
aignas merged 3 commits intobazel-contrib:mainfrom
aignas:aignas.chore.mypy-ignore-entry-point

Conversation

@aignas
Copy link
Copy Markdown
Collaborator

@aignas aignas commented Apr 24, 2026

Fixes #3126

@aignas aignas requested a review from rickeylev as a code owner April 24, 2026 15:08
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds a # type: ignore comment to generated console scripts to skip mypy type checking. Feedback indicates that the comment's placement on a separate line is syntactically incorrect for mypy and highlights a discrepancy between the changelog's description and the actual code implementation.

Comment thread python/private/py_console_script_gen.py Outdated
Comment thread CHANGELOG.md
Comment on lines +68 to +69
* (entry_point) From now on `mypy` type checking will be skipped on the generated
files ([#3126](https://github.com/bazel-contrib/rules_python/issues/3126)).
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

This entry states that type checking will be skipped on the "generated files", implying the entire file. However, the current implementation in py_console_script_gen.py only targets a single line in the entry point script. If the goal is to ignore the whole file, the implementation should be updated to use a file-level ignore at the top of the generated script. If only the sys.exit line is intended to be ignored, this description should be clarified.

aignas and others added 2 commits April 25, 2026 00:17
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@rickeylev rickeylev added this pull request to the merge queue Apr 25, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 25, 2026
@aignas aignas added this pull request to the merge queue Apr 25, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 25, 2026
@aignas aignas added this pull request to the merge queue Apr 26, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 26, 2026
@aignas aignas added this pull request to the merge queue Apr 26, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 26, 2026
@aignas aignas added this pull request to the merge queue Apr 26, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 26, 2026
@aignas aignas added this pull request to the merge queue Apr 26, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 26, 2026
@aignas aignas added this pull request to the merge queue Apr 26, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 26, 2026
@aignas aignas merged commit b81b287 into bazel-contrib:main Apr 26, 2026
4 checks passed
@aignas aignas deleted the aignas.chore.mypy-ignore-entry-point branch April 26, 2026 05:11
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.

py_console_script_binary fails mypy [func-returns-value]

2 participants