Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

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

A plugin providing both real-time and on-demand scanning of Python files with Mypy from within PyCharm/IDEA.

License

NotificationsYou must be signed in to change notification settings

leinardi/mypy-pycharm

Repository files navigation

GitHub (pre-)releaseTravisGitHub licenseStars

This plugin provides both real-time and on-demand scanning of Python files with Mypy from within PyCharm/IDEA.

Mypy is a Python source code analyzer which looks for programming errors,helps to enforce a coding standard and sniffs for some code smells(as defined in Martin Fowler's Refactoring book).

mypy plugin screenshot

Installation steps

  1. In theSettings/Preferences dialog (CTRL+Alt+S), clickPlugins. ThePlugins page opens.
  2. ClickBrowse repositories.
  3. In theBrowse Repositories dialog that opens, right-click on the plugin namedMypy and selectDownload and Install.
  4. Confirm your intention to download and install the selected plugin.
  5. ClickClose.
  6. ClickOK in theSettings dialog and restart PyCharm for the changes to take effect.

Configuration

The only configuration needed is to set the path to Mypy executable, and only if is not alreadyinside the PATH environment variable.

To reach the Plugin configuration screen you can openSettings/Preferences dialog (CTRL+Alt+S), clickOther Settings and thenMypy or simply click the gear icon from the side bar of the Mypy tool window.

To change the path to your Mypy executable you can either type the path directly or usethe Browse button to open a file selection dialog.

Once you changed the path you should press the Test button to check if the plugin is able to runthe executable.

plugin settings screenshot

Inspection severity

By default, Mypy message severity is set to Warning. It is possible to change the severity levelby going toSettings/Preferences dialog (CTRL+Alt+S) ->Editor ->Inspections ->Mypy ->Severity:

plugin inspection severity screenshot

Usage

plugin actions screenshotplugin actions screenshot

FAQ

When I click "Check Project/Module/Changes" I only get one error for one file, why?

It is aknow issue ofmypy: if the validation encounters a blocking error it just bails out completely ignoring the rest of the files. The biggest problem for the plugin is that currently there is no way to know if the check ended normally or because it encountered a blocking error (in the issue ticket there was a suggestion of using--verbose but it does not work, for exampble, forduplicate module naned errors).

How can I prevent the code inspection to run on a specific folder?

The easiest way to ignore a specific folder is to mark it as Excluded from PyCharm/IDEA:

  1. Open PyCharm/IDEA Settings ->your project -> Project structure
  2. Select the directory you want to exclude
  3. Click the Excluded button (red folder icon)

More infohere.

The name of the plugin ismypy-pycharm, can I use it also with IntelliJ IDEA?

This plugin officially supports only PyCharm, but it should work also on IntelliJ IDEAif you have thePython Community Editionplugin installed. If it does not work, feel free to open a bug on theissue tracker.

I like this plugin, how can I support it?

The best way to support this plugin is to rate it on theJetBrains Plugin Repository page and to star this project on GitHub.Feedback is always welcome: if you found a bug or would like to suggest a feature,feel free to open an issue on theissue tracker. If your feedback doesn't fall in the previous categories,you can always leave a comment on thePlugin Repository page.

Acknowledgements

If I have seen further it is by standing on the shoulders of Giants - Isaac Newton

A huge thanks:

License

Copyright 2021 Roberto Leinardi.Licensed to the Apache Software Foundation (ASF) under one or more contributorlicense agreements.  See the NOTICE file distributed with this work foradditional information regarding copyright ownership.  The ASF licenses thisfile to you under the Apache License, Version 2.0 (the "License"); you may notuse this file except in compliance with the License.  You may obtain a copy ofthe License at  http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS, WITHOUTWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See theLicense for the specific language governing permissions and limitations underthe License.

About

A plugin providing both real-time and on-demand scanning of Python files with Mypy from within PyCharm/IDEA.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp