Skip to main content

An autohooks plugin for python code static typing check with mypy

Project description

Greenbone Logo

autohooks-plugin-mypy

GitHub releases PyPI release code test coverage Build and test

An autohooks plugin for python code static typing check via mypy.

Installation

Install using pip

You can install the latest stable release of autohooks-plugin-mypy from the Python Package Index using pip:

python3 -m pip install autohooks-plugin-mypy

Install using poetry

It is highly encouraged to use poetry for maintaining your project's dependencies. Normally autohooks-plugin-mypy is installed as a development dependency.

poetry install

Usage

To activate the mypy autohooks plugin please add the following setting to your pyproject.toml file.

[tool.autohooks]
pre-commit = ["autohooks.plugins.mypy"]

By default, autohooks plugin mypy checks all files with a .py ending. If only files in a sub-directory or files with different endings should be formatted, just add the following setting:

[tool.autohooks]
pre-commit = ["autohooks.plugins.mypy"]

[tool.autohooks.plugins.mypy]
include = ['foo/*.py', '*.foo']

By default, autohooks plugin mypy executes mypy without any arguments. To change specific settings or to define a mypy config file the following plugin configuration can be used:

[tool.autohooks]
pre-commit = ["autohooks.plugins.mypy"]

[tool.autohooks.plugins.mypy]
arguments = ["--ignore-missing-imports", "--config-file=/path/to/.mypy.ini"]

Maintainer

This project is maintained by Greenbone AG.

Contributing

Your contributions are highly appreciated. Please create a pull request on GitHub. Bigger changes need to be discussed with the development team via the issues section at GitHub first.

License

Copyright (C) 2021 Vincent Texier. Copyright (C) 2023 Greenbone AG

Licensed under the GNU General Public License v3.0 or later.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autohooks_plugin_mypy-23.3.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

autohooks_plugin_mypy-23.3.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file autohooks_plugin_mypy-23.3.0.tar.gz.

File metadata

  • Download URL: autohooks_plugin_mypy-23.3.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for autohooks_plugin_mypy-23.3.0.tar.gz
Algorithm Hash digest
SHA256 eb768b1114c1cb54c8cbfe7f520641b70001d3c90ea9337067ce42567ec44f88
MD5 b215d412ff095f6a19db8cbf57fca6ed
BLAKE2b-256 6508a6d63a860363196fae197fe38a79968c4829586809ae24c76b2422337b7a

See more details on using hashes here.

File details

Details for the file autohooks_plugin_mypy-23.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for autohooks_plugin_mypy-23.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3cd38cf53c2307ff396beb448d098f6631c3af74ab289bb45fc4f0f53f72a18b
MD5 0a4163562923e1b62674d54687c447a1
BLAKE2b-256 f1363a04a15f3898eb63bb02ca48b7c852285be8b207e2e4e6619d32bef5de81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page