Separate output tool error and mypy warnings (stderr, stdout, file)
Open
Nobody has claimed this yet.
feature
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Today I run mypy > mypy.report to let jenkins parse the output log and present it. However then mypy crashes and prints errors, those also go on stdout and into my report file. It would be nice with some way of separating the output.
example on tool error:
$ mypy --no-incremental --disable-error-code import --follow-imports skip . > mypy.report
Duplicate module named "benchmark" (also at "a/b/1/benchmark.py")
a/b/2/benchmark.py: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules for more info
a/b/2/benchmark.py: note: Common resolutions include: a) using `--exclude` to avoid checking one of them, b) adding `__init__.py` somewhere, c) using `--explicit-package-bases` or adjusting MYPYPATH
Suggestion:
- Could these errors be printed to stderr? Should there in that case be an option to do so?
- option flag to set output_file for the report, but still output errors to stdout.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing mypy's current command-line handling of tool errors and report output. Compare the two requested behaviors—sending tool errors to stderr or configuring a report file while retaining stdout—and define which interface should be implemented; done means Jenkins can separate errors from the report reliably.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100