Skip to content

Add mypy error codes to '# type: ignore' comments #6379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Nov 26, 2021

Conversation

Akuli
Copy link
Collaborator

@Akuli Akuli commented Nov 25, 2021

No description provided.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

…output

import sys
for line in sys.stdin:
    if ": " not in line: continue
    fname, lineno = line.split(":")[:2]
    lines = open(fname).readlines()
    if '# type: ignore' not in lines[int(lineno)-1]:
        lines[int(lineno)-1] = lines[int(lineno)-1].rstrip('\n')
        lines[int(lineno)-1] += '  # type: ignore' + line[line.rindex('['):]
        open(fname,'w').writelines(lines)
        print("Fixed", fname)
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@Akuli Akuli marked this pull request as ready for review November 25, 2021 20:29
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Great, thanks for all the work here!

@srittau srittau merged commit a5bc1e0 into python:master Nov 26, 2021
@Akuli Akuli deleted the type-ignore branch November 26, 2021 23:18
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.

3 participants