Skip to content
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

Add mypy support #228

Merged
merged 18 commits into from Jul 22, 2018
Merged

Add mypy support #228

merged 18 commits into from Jul 22, 2018

Conversation

chocoelho
Copy link
Contributor

@chocoelho chocoelho commented Aug 12, 2017

This PR resolves #198.

mypy doesn't output a code to identify the errors, it basically works with options you pass on the command line and the interface available to integrate with other tools accepts these arguments, so that's why it's not following the pattern of using disable messages but rather entries like disallow, no-check and so on.

These are some screenshots of it working:

Running only with mypy tool

image

image

VS Code output

image

.prospector.yaml configuration

image

@coveralls
Copy link

coveralls commented Aug 12, 2017

Coverage Status

Coverage increased (+0.2%) to 58.676% when pulling 50cdd98 on vintasoftware:mypy-support into 1d993d4 on landscapeio:develop.

@coveralls
Copy link

coveralls commented Aug 14, 2017

Coverage Status

Coverage increased (+0.04%) to 58.497% when pulling fe30c8a on vintasoftware:mypy-support into 1d993d4 on landscapeio:develop.

@coveralls
Copy link

coveralls commented Aug 15, 2017

Coverage Status

Coverage increased (+0.1%) to 58.549% when pulling 56afa91 on vintasoftware:mypy-support into 1d993d4 on landscapeio:develop.

@coveralls
Copy link

coveralls commented Aug 15, 2017

Coverage Status

Coverage increased (+0.1%) to 58.574% when pulling 1fc10d2 on vintasoftware:mypy-support into 1d993d4 on landscapeio:develop.

@pmatos
Copy link

pmatos commented Dec 1, 2017

Is there a reason this hasn't been merged?

@chocoelho
Copy link
Contributor Author

@pmatos I guess it wasn't reviewed yet

@chocoelho
Copy link
Contributor Author

This PR is going to take a little while longer to be merged. After syncing with the develop branch, I'm going to write a few more tests just to make sure it's properly integrated. But we're back on business :)

@twidi
Copy link
Contributor

twidi commented May 25, 2018

If prospector runs flake8, with its plugins, then the flake8-mypy should be enough instead of adding mypy support directly in prospector.

@fabianbuechler
Copy link

@twidi flake8 operates on single files, while mypy analyzes a complete codebase. The flake8-mypy plugin is therefore somewhat limited. Basically this note from the flake8-mypy page says it all:

Flake8 operates on unrelated files, it doesn’t perform full program analysis. In other words, it doesn’t follow imports. This is a curse and a blessing. We cannot find complex problems and the number of warnings we can safely show without risking false positives is lower. In return, we can provide useful warnings with great performance, usable for realtime editor integration.

@twidi
Copy link
Contributor

twidi commented May 27, 2018

Yes indeed, you're right.

Signed-off-by: Carlos Coêlho <carlospecter@gmail.com>
@coveralls
Copy link

coveralls commented May 28, 2018

Pull Request Test Coverage Report for Build 591

  • 2 of 49 (4.08%) changed or added relevant lines in 1 file are covered.
  • 246 unchanged lines in 18 files lost coverage.
  • Overall coverage increased (+0.5%) to 77.525%

Changes Missing Coverage Covered Lines Changed/Added Lines %
prospector/tools/mypy/init.py 2 49 4.08%
Files with Coverage Reduction New Missed Lines %
prospector/formatters/text.py 1 64.29%
prospector/encoding.py 5 66.67%
prospector/finder.py 6 83.59%
prospector/tools/pylint/linter.py 6 66.67%
prospector/message.py 8 79.66%
prospector/tools/pylint/collector.py 9 88.46%
prospector/tools/pep257/init.py 10 80.65%
prospector/config/init.py 10 80.21%
prospector/tools/pylint/indent_checker.py 11 80.77%
prospector/formatters/grouped.py 12 100.0%
Totals Coverage Status
Change from base Build 590: 0.5%
Covered Lines: 1497
Relevant Lines: 1931

💛 - Coveralls

@carlio
Copy link
Member

carlio commented May 28, 2018

Looks good to me.

@carlio carlio merged commit f219943 into landscapeio:develop Jul 22, 2018
@chocoelho chocoelho deleted the mypy-support branch July 24, 2018 23:00
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.

None yet

6 participants