Skip to content

Add lint for unqualified type: ignore#56290

Closed
samestep wants to merge 19 commits intopytorch:masterfrom
samestep:lint-unqualified-type-ignore
Closed

Add lint for unqualified type: ignore#56290
samestep wants to merge 19 commits intopytorch:masterfrom
samestep:lint-unqualified-type-ignore

Conversation

@samestep
Copy link
Copy Markdown
Contributor

@samestep samestep commented Apr 16, 2021

The other half of #56272.

Test plan:

CI should pass on the tip of this PR, and we know that the lint works because the following CI runs (before this PR was finished) failed:

@facebook-github-bot
Copy link
Copy Markdown
Contributor

facebook-github-bot commented Apr 16, 2021

💊 CI failures summary and remediations

As of commit 270a517 (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions to the (internal) Dr. CI Users group.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2021

Codecov Report

Merging #56290 (e060b85) into master (0ea4eb7) will increase coverage by 0.02%.
The diff coverage is 80.58%.

❗ Current head e060b85 differs from pull request most recent head 270a517. Consider uploading reports for the commit 270a517 to get more accurate results

@@            Coverage Diff             @@
##           master   #56290      +/-   ##
==========================================
+ Coverage   77.76%   77.79%   +0.02%     
==========================================
  Files        1923     1923              
  Lines      190699   190882     +183     
==========================================
+ Hits       148298   148497     +199     
+ Misses      42401    42385      -16     

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@samestep has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@samestep
Copy link
Copy Markdown
Contributor Author

samestep commented Apr 20, 2021

@seemethere That may be something we should do, but I don't want to do that in this PR. I believe the problem is just that I removed # type: ignore comments from four lines generated by test/test_type_hints.py, so I need to figure out what mypy error code those comments were suppressing, and add them back.

Edit: Actually, I think that somehow the issue was resolved by rebasing onto a more recent master commit after #56388 was merged.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@samestep has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Copy Markdown
Member

@seemethere seemethere left a comment

Choose a reason for hiding this comment

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

LGTM on green

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@samestep has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@samestep merged this pull request in 75024e2.

@samestep samestep deleted the lint-unqualified-type-ignore branch April 21, 2021 15:08
facebook-github-bot pushed a commit that referenced this pull request Apr 21, 2021
Summary:
Followup to #56290 which adds the new lint to the local runner from #56439.

Pull Request resolved: #56587

Test Plan: Same as #56439.

Reviewed By: walterddr

Differential Revision: D27909889

Pulled By: samestep

fbshipit-source-id: 8b67f3bc36c9b5567fe5a9e49904f2cf23a9f135
facebook-github-bot pushed a commit that referenced this pull request Apr 21, 2021
Summary:
This should make it easier to resolve issues surfaced by #56290. Also see #56559 (comment) for context.

Pull Request resolved: #56616

Test Plan:
You could add a type error in a strict-checked file like `tools/test_history.py`, and then run this command:
```
$ mypy --config=mypy-strict.ini tools/test_history.py
```

Output before this PR:
```
tools/test_history.py:13:1: error: Function is missing a type annotation for one or more arguments
Found 1 error in 1 file (checked 1 source file)
```

Output after this PR:
```
tools/test_history.py:13:1: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
Found 1 error in 1 file (checked 1 source file)
```

Reviewed By: driazati

Differential Revision: D27918753

Pulled By: samestep

fbshipit-source-id: 953926e019a7669da9004fd54498b414aec777a6
heitorschueroff pushed a commit that referenced this pull request Apr 21, 2021
Summary:
The other half of #56272.

Pull Request resolved: #56290

Test Plan:
CI should pass on the tip of this PR, and we know that the lint works because the following CI runs (before this PR was finished) failed:

- https://github.com/pytorch/pytorch/runs/2384511062
- https://github.com/pytorch/pytorch/actions/runs/765036024

Reviewed By: seemethere

Differential Revision: D27867219

Pulled By: samestep

fbshipit-source-id: e648f07b6822867e70833e23ddafe7fb7eaca235
heitorschueroff pushed a commit that referenced this pull request Apr 21, 2021
Summary:
Followup to #56290 which adds the new lint to the local runner from #56439.

Pull Request resolved: #56587

Test Plan: Same as #56439.

Reviewed By: walterddr

Differential Revision: D27909889

Pulled By: samestep

fbshipit-source-id: 8b67f3bc36c9b5567fe5a9e49904f2cf23a9f135
krshrimali pushed a commit to krshrimali/pytorch that referenced this pull request May 19, 2021
Summary:
The other half of pytorch#56272.

Pull Request resolved: pytorch#56290

Test Plan:
CI should pass on the tip of this PR, and we know that the lint works because the following CI runs (before this PR was finished) failed:

- https://github.com/pytorch/pytorch/runs/2384511062
- https://github.com/pytorch/pytorch/actions/runs/765036024

Reviewed By: seemethere

Differential Revision: D27867219

Pulled By: samestep

fbshipit-source-id: e648f07b6822867e70833e23ddafe7fb7eaca235
krshrimali pushed a commit to krshrimali/pytorch that referenced this pull request May 19, 2021
Summary:
Followup to pytorch#56290 which adds the new lint to the local runner from pytorch#56439.

Pull Request resolved: pytorch#56587

Test Plan: Same as pytorch#56439.

Reviewed By: walterddr

Differential Revision: D27909889

Pulled By: samestep

fbshipit-source-id: 8b67f3bc36c9b5567fe5a9e49904f2cf23a9f135
krshrimali pushed a commit to krshrimali/pytorch that referenced this pull request May 19, 2021
Summary:
This should make it easier to resolve issues surfaced by pytorch#56290. Also see pytorch#56559 (comment) for context.

Pull Request resolved: pytorch#56616

Test Plan:
You could add a type error in a strict-checked file like `tools/test_history.py`, and then run this command:
```
$ mypy --config=mypy-strict.ini tools/test_history.py
```

Output before this PR:
```
tools/test_history.py:13:1: error: Function is missing a type annotation for one or more arguments
Found 1 error in 1 file (checked 1 source file)
```

Output after this PR:
```
tools/test_history.py:13:1: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
Found 1 error in 1 file (checked 1 source file)
```

Reviewed By: driazati

Differential Revision: D27918753

Pulled By: samestep

fbshipit-source-id: 953926e019a7669da9004fd54498b414aec777a6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants