Skip to content

Use crosshair to statically analyze Python code from within PyCharm.

License

Notifications You must be signed in to change notification settings

pschanely/crosshair-pycharm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crosshair-pycharm

Crosshair-pycharm is a plug-in for PyCharm IDE that allows you to automatically test your Python code using crosshair-tool.

Installation

Install crosshair-pycharm. Use Plug-in manager in your PyCharm: File ⟶ Settings ⟶ Plugins.

Select crosshair-pycharm.

settings

settings-plugins

Install crosshair-tool. As crosshair-pycharm is only a thin wrapper around crosshair-tool, please install crosshair-tool manually in the virtual environment of your project.

For example, through: File ⟶ Settings ⟶ Project ⟶ Python Interpreter.

settings

settings-project-interpreter

settings-install-package

If you are writing a package using setup.py, you might want to include crosshair-tool in your test dependencies.

Usage

You can use crosshair-pycharm from within an editor (with an open Python file) through the editor pop-up menu:

editor pop-up menu

Alternatively, you can select a file in the project view and access crosshair-pycharm through the project view pop-up menu:

project view pop-up menu on a file

A module containing multiple submodules can also be selected in which case both the parent module, and the children modules are going to be verified (or in case of watch command, watched recursively):

project view pop-up menu on a directory

You can also select a directory which is not a proper Python module (e.g., lacks the __init__.py). In this case, all the Python files beneath the directory will be verified.

Actions

Crosshair-pycharm creates the run configuration based on the selected action (described below).

You can view and edit these run configurations manually or re-run them (usually by pressing Shift+F10). Crosshair-pycharm will not overwrite the run configurations, so the manual changes will persist. For example, you might want to change the parameter --per_path_timeout in a particular run (see Command-line interface in the crosshair-tool's documentation).

The following actions can be executed:

Check {module or function}. Verify the given module or function using crosshair-tool.

Watch {module or function}. Watch the given module or function for changes and verify continuously using crosshair-tool.

You can see the results in the terminal window immediately upon making changes in the editor.

Contributing

Feature requests or bug reports are always very, very welcome!

Please see quickly if the issue does not already exist in the issue section and, if not, create a new issue.

You can also contribute in code. Please use GitHub's fork workflow. The commit messages follow Chris Beams' guidelines. Please discuss briefly the feature you would like to implement beforehand so that we can explore together the use case and how it fits with the overall vision.

Versioning

We follow a bit unusual semantic versioning schema:

  • X is the oldest supported version of crosshair-tool,
  • Y is the minor version (new or modified features), and
  • Z is the patch version (only bug fixes).

About

Use crosshair to statically analyze Python code from within PyCharm.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages