Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add Error format support, and JSON output option#11396

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
JelleZijlstra merged 48 commits intopython:masterfromtusharsadhwani:output-json
May 10, 2024
Merged
Changes from1 commit
Commits
Show all changes
48 commits
Select commitHold shift + click to select a range
393820c
Add -O/--output CLI option
tusharsadhwaniOct 24, 2021
282bd28
Initial formatter setup
tusharsadhwaniOct 25, 2021
ccda5b0
Make error_formatter an optional argument
tusharsadhwaniOct 27, 2021
c849a77
Fix type annotation
tusharsadhwaniOct 27, 2021
fd2feab
Fix whitespace
tusharsadhwaniOct 27, 2021
b188001
Remove whitespace
tusharsadhwaniOct 27, 2021
51c1acc
Merge branch 'master' of https://github.com/tusharsadhwani/mypy into …
tusharsadhwaniOct 27, 2021
9177dab
Merge branch 'python:master' into output-json
tushar-deepsourceJan 19, 2022
bc5ceac
Add hint property to errors
tushar-deepsourceJan 19, 2022
9d29ab0
Fix lint issues
tusharsadhwaniJan 19, 2022
bd6d48d
Merge branch 'master' into output-json
tusharsadhwaniFeb 22, 2023
ba8d17f
Fix import and typing issues
tusharsadhwaniFeb 22, 2023
a2bc04d
Fix error tuple signature
tusharsadhwaniFeb 22, 2023
35974e4
Import Optional
tusharsadhwaniFeb 23, 2023
1e5ec91
Run black
tusharsadhwaniFeb 23, 2023
723219f
Run black on another file
tusharsadhwaniFeb 23, 2023
2228c0a
Run isort
tusharsadhwaniFeb 23, 2023
33d81b0
Run isort on build.py
tusharsadhwaniFeb 23, 2023
63001ea
Merge branch 'master' into output-json
tusharsadhwaniApr 19, 2023
d27be7e
Merge branch 'master' into output-json
tusharsadhwaniApr 20, 2023
efe5c5d
Merge branch 'master' into output-json
tusharsadhwaniApr 27, 2023
1872ae6
Add tests for json output
tusharsadhwaniApr 27, 2023
3abc9cb
Suggestions from code review, and negative test
tusharsadhwaniApr 27, 2023
6c9ab11
Add default value of None
tusharsadhwaniApr 27, 2023
627ed8e
Default output to None in options as well
tusharsadhwaniApr 27, 2023
e425cbe
Fix failing tests
tusharsadhwaniApr 27, 2023
47f1b07
improve docstring
tusharsadhwaniApr 27, 2023
e00ad4a
type cast
tusharsadhwaniApr 27, 2023
c1fb6a2
Another explicit type cast
tusharsadhwaniApr 27, 2023
aafe3aa
remove unused import
tusharsadhwaniApr 27, 2023
fae3215
create formatter object
tusharsadhwaniApr 27, 2023
89ad1d3
Add custom end to end test
tusharsadhwaniApr 27, 2023
7a3f736
unused import
tusharsadhwaniApr 27, 2023
6d46f75
trailing whitespace
tusharsadhwaniApr 27, 2023
e71a372
try fixing windows
tusharsadhwaniApr 28, 2023
8cca203
fix windows separator issue
tusharsadhwaniApr 28, 2023
79e16a8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot]Apr 28, 2023
8bf4890
unused import
tusharsadhwaniApr 28, 2023
5899f26
Merge branch 'master' into output-json
tusharsadhwaniApr 28, 2023
880b8f3
Merge branch 'master' into output-json
tusharsadhwaniMay 5, 2023
0aafadf
Pass error tuples to format_messages
tusharsadhwaniMay 10, 2023
4cab249
Merge branch 'master' into output-json
tusharsadhwaniMay 10, 2023
7fe71c3
Merge branch 'master' into output-json
tusharsadhwaniMay 13, 2023
ad8f1d6
Merge branch 'master' into output-json
tusharsadhwaniMay 9, 2024
e2fd45e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot]May 9, 2024
4b03c5c
ruff lints
tusharsadhwaniMay 9, 2024
e0e6896
address comments
tusharsadhwaniMay 10, 2024
a0dc6d1
use severity
tusharsadhwaniMay 10, 2024
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
PrevPrevious commit
NextNext commit
Fix lint issues
  • Loading branch information
@tusharsadhwani
tusharsadhwani committedJan 19, 2022
commit9d29ab0d28da329d91a5633a11f0df4da5a014f4
7 changes: 5 additions & 2 deletionsmypy/errors.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -871,6 +871,7 @@ def report_internal_error(err: Exception,
# We use exit code 2 to signal that this is no ordinary error.
raise SystemExit(2)


class MypyError:
def __init__(self,
file_path: str,
Expand All@@ -886,9 +887,11 @@ def __init__(self,
self.hint = hint
self.errorcode = errorcode


# (file_path, line, column)
_ErrorLocation = Tuple[str, int, int]


def create_errors(error_tuples: List[ErrorTuple]) -> List[MypyError]:
errors: List[MypyError] = []
latest_error_at_location: Dict[_ErrorLocation, MypyError] = {}
Expand All@@ -905,7 +908,7 @@ def create_errors(error_tuples: List[ErrorTuple]) -> List[MypyError]:
if error is None:
# No error tuple found for this hint. Ignoring it
Copy link
Member

Choose a reason for hiding this comment

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

Why not instead generate a MypyError with some field that lets us indicate that this is a note?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Addressed.

continue

if error.hint == '':
error.hint = message
else:
Expand All@@ -917,4 +920,4 @@ def create_errors(error_tuples: List[ErrorTuple]) -> List[MypyError]:
error_location = (file_path, line, column)
latest_error_at_location[error_location] = error

return errors
return errors

[8]ページ先頭

©2009-2025 Movatter.jp