{ "info": { "author": "Marko Ristin", "author_email": "marko.ristin@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "pyicontract-lint\n================\n.. image:: https://travis-ci.com/Parquery/pyicontract-lint.svg?branch=master\n :target: https://travis-ci.com/Parquery/pyicontract-lint\n :alt: Build status\n\n.. image:: https://coveralls.io/repos/github/Parquery/pyicontract-lint/badge.svg?branch=master\n :target: https://coveralls.io/github/Parquery/pyicontract-lint\n :alt: Test coverage\n\n.. image:: https://readthedocs.org/projects/pyicontract-lint/badge/?version=latest\n :target: https://pyicontract-lint.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation status\n\n.. image:: https://badge.fury.io/py/pyicontract-lint.svg\n :target: https://badge.fury.io/py/pyicontract-lint\n :alt: PyPI - version\n\n.. image:: https://img.shields.io/pypi/pyversions/pyicontract-lint.svg\n :alt: PyPI - Python Version\n\npyicontract-lint lints contracts in Python code defined with\n`icontract library `_.\n\nThe following checks are performed:\n\n+---------------------------------------------------------------------------------------+----------------------+\n| Description | Identifier |\n+=======================================================================================+======================+\n| A preconditions expects a subset of function's arguments. | pre-invalid-arg |\n+---------------------------------------------------------------------------------------+----------------------+\n| A snapshot expects at most an argument element of the function's arguments. | snapshot-invalid-arg |\n+---------------------------------------------------------------------------------------+----------------------+\n| If a snapshot is defined on a function, a postcondition must be defined as well. | snapshot-wo-post |\n+---------------------------------------------------------------------------------------+----------------------+\n| A ``capture`` function must be defined in the contract. | snapshot-wo-capture |\n+---------------------------------------------------------------------------------------+----------------------+\n| A postcondition expects a subset of function's arguments. | post-invalid-arg |\n+---------------------------------------------------------------------------------------+----------------------+\n| If a function returns None, a postcondition should not expect ``result`` as argument. | post-result-none |\n+---------------------------------------------------------------------------------------+----------------------+\n| If a postcondition expects ``result`` argument, the function should not expect it. | post-result-conflict |\n+---------------------------------------------------------------------------------------+----------------------+\n| If a postcondition expects ``OLD`` argument, the function should not expect it. | post-old-conflict |\n+---------------------------------------------------------------------------------------+----------------------+\n| An invariant should only expect ``self`` argument. | inv-invalid-arg |\n+---------------------------------------------------------------------------------------+----------------------+\n| A ``condition`` must be defined in the contract. | no-condition |\n+---------------------------------------------------------------------------------------+----------------------+\n| File must be valid Python code. | invalid-syntax |\n+---------------------------------------------------------------------------------------+----------------------+\n\nUsage\n=====\nPyicontract-lint parses the code and tries to infer the imported modules and functions using\n`astroid library `_. Hence you need to make sure that imported modules are on your\n``PYTHONPATH`` before you invoke pyicontract-lint.\n\nOnce you set up the environment, invoke pyicontract-lint with a list of positional arguments as paths:\n\n.. code-block:: bash\n\n pyicontract-lint \\\n /path/to/some/directory/some-file.py \\\n /path/to/some/directory/another-file.py\n\nYou can also invoke it on directories. Pyicontract-lint will recursively search for ``*.py`` files (including the\nsubdirectories) and verify the files:\n\n.. code-block:: bash\n\n pyicontract-lint \\\n /path/to/some/directory\n\nBy default, pyicontract-lint outputs the errors in a verbose, human-readable format. If you prefer JSON, supply it\n``--format`` argument:\n\n.. code-block:: bash\n\n pyicontract-lint \\\n --format json \\\n /path/to/some/directory\n\nIf one or more checks fail, the return code will be non-zero. You can specify ``--dont_panic`` argument if you want\nto have a zero return code even though one or more checks failed:\n\n.. code-block:: bash\n\n pyicontract-lint \\\n --dont_panic \\\n /path/to/some/directory\n\nTo disable any pyicontract-lint checks on a file, add ``# pyicontract-lint: disabled`` on a separate line to the file.\nThis is useful when you recursively lint files in a directory and want to exclude certain files.\n\nModule ``icontract_lint``\n-------------------------\nThe API is provided in the ``icontract_lint`` module if you want to use pycontract-lint programmatically.\n\nThe main points of entry in ``icontract_line`` module are:\n\n* ``check_file(...)``: lint a single file,\n* ``check_recursively(...)``: lint a directory and\n* ``check_paths(...)``: lint files and directories.\n\nThe output is produced by functions ``output_verbose(...)`` and ``output_json(...)``.\n\nHere is an example code that lints a list of given paths and produces a verbose output:\n\n.. code-block:: python\n\n import pathlib\n import sys\n\n import icontract_lint\n\n errors = icontract_lint.check_paths(paths=[\n pathlib.Path('/some/directory/file.py'),\n pathlib.Path('/yet/yet/another/directory'),\n pathlib.Path('/another/directory/another_file.py'),\n pathlib.Path('/yet/another/directory'),\n ])\n\n output_verbose(errors=errors, stream=sys.stdout)\n\nThe full documentation of the module is available on\n`readthedocs `_.\n\nInstallation\n============\n\n* Install pyicontract-lint with pip:\n\n.. code-block:: bash\n\n pip3 install pyicontract-lint\n\nDevelopment\n===========\n\n* Check out the repository.\n\n* In the repository root, create the virtual environment:\n\n.. code-block:: bash\n\n python3 -m venv venv3\n\n* Activate the virtual environment:\n\n.. code-block:: bash\n\n source venv3/bin/activate\n\n* Install the development dependencies:\n\n.. code-block:: bash\n\n pip3 install -e .[dev]\n\n* We use tox for testing and packaging the distribution. Run:\n\n.. code-block:: bash\n\n tox\n\n* We also provide a set of pre-commit checks that lint and check code for formatting. Run them locally from an activated\n virtual environment with development dependencies:\n\n.. code-block:: bash\n\n ./precommit.py\n\n* The pre-commit script can also automatically format the code:\n\n.. code-block:: bash\n\n ./precommit.py --overwrite\n\nVersioning\n==========\nWe follow `Semantic Versioning `_. The version X.Y.Z indicates:\n\n* X is the major version (backward-incompatible),\n* Y is the minor version (backward-compatible), and\n* Z is the patch version (backward-compatible bug fix).", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Parquery/pyicontract-lint", "keywords": "design-by-contract precondition postcondition validation lint", "license": "License :: OSI Approved :: MIT License", "maintainer": "", "maintainer_email": "", "name": "pyicontract-lint", "package_url": "https://pypi.org/project/pyicontract-lint/", "platform": "", "project_url": "https://pypi.org/project/pyicontract-lint/", "project_urls": { "Homepage": "https://github.com/Parquery/pyicontract-lint" }, "release_url": "https://pypi.org/project/pyicontract-lint/2.0.0/", "requires_dist": null, "requires_python": "", "summary": "Lint contracts defined with icontract library.", "version": "2.0.0" }, "last_serial": 5410384, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "4f8d8e841a773dc790b7f5deca32d8d2", "sha256": "7f9a705a3cf12be05c9e4048ca8a09f395901e5fc7b75181717e398bd9e8ead7" }, "downloads": -1, "filename": "pyicontract-lint-1.0.0.tar.gz", "has_sig": false, "md5_digest": "4f8d8e841a773dc790b7f5deca32d8d2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7734, "upload_time": "2018-09-20T20:37:29", "url": "https://files.pythonhosted.org/packages/ca/48/10fb96b02aba688fa5b23184be100ae8e640fdf2b2a12a4b989ffca60f15/pyicontract-lint-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "7ddf0fa31c4d6bee07f7c736b93fac7f", "sha256": "16a5ab6524cb45bb23c734858ecc39c775b897876f64a446620a4c4fac978945" }, "downloads": -1, "filename": "pyicontract-lint-1.0.1.tar.gz", "has_sig": false, "md5_digest": "7ddf0fa31c4d6bee07f7c736b93fac7f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8011, "upload_time": "2018-09-21T06:55:09", "url": "https://files.pythonhosted.org/packages/da/e6/4f36393ed2b8fedd24e271662074690b92603f4c91f0f9fe682cc56161d0/pyicontract-lint-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "ee80bed31e29b03ad343c6de43bafd8d", "sha256": "b3d36024ddca4257df269bc4abc2ae6d45c1a171b6bda9ec4efc34181d33f952" }, "downloads": -1, "filename": "pyicontract-lint-1.0.2.tar.gz", "has_sig": false, "md5_digest": "ee80bed31e29b03ad343c6de43bafd8d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9659, "upload_time": "2018-09-21T07:13:58", "url": "https://files.pythonhosted.org/packages/53/e0/22026013cb136c0a8cb0f004293b9f3605e92e156ec89313eeb8354cd119/pyicontract-lint-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "6a2e26b8dfd369262017c16475b166f1", "sha256": "8bcd47398c35b0a35a46a2fa21889c60726017ac30951224189a3b4e86c781e7" }, "downloads": -1, "filename": "pyicontract-lint-1.1.0.tar.gz", "has_sig": false, "md5_digest": "6a2e26b8dfd369262017c16475b166f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10005, "upload_time": "2018-09-21T07:43:31", "url": "https://files.pythonhosted.org/packages/e5/fd/4ed0112ab79411138443fe6bdcd521bce888c39e2ba1bba0c8470fd1ce5a/pyicontract-lint-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "f601d5212db9c0e48dbfed57789b9578", "sha256": "4782801f5a12696f7ecfbb14c8cff78438eaa3d9007f73b7a2caeb8b93d9a97a" }, "downloads": -1, "filename": "pyicontract-lint-1.1.1.tar.gz", "has_sig": false, "md5_digest": "f601d5212db9c0e48dbfed57789b9578", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10028, "upload_time": "2018-09-22T07:31:06", "url": "https://files.pythonhosted.org/packages/7d/ef/e7798ff102c0257aca745f1556f953a0edeb6ee89cc331a2422664e7aa35/pyicontract-lint-1.1.1.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "003d6c9a81ab3dd1f02a8d66f81e5693", "sha256": "08c61c22be7fc5c7ebd296c125e33e6c92ed5e606824b21d0b38b012f0b5125c" }, "downloads": -1, "filename": "pyicontract-lint-1.2.0.tar.gz", "has_sig": false, "md5_digest": "003d6c9a81ab3dd1f02a8d66f81e5693", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11151, "upload_time": "2018-10-20T07:08:20", "url": "https://files.pythonhosted.org/packages/34/81/288f5386689cb3417162940f59900d07115eefbd818ecd111152a739def2/pyicontract-lint-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "e78f1aa13503dbcbb2c06b158753caf7", "sha256": "c6d33081dfda7c722e31525ad3ec196afb8a5e0456cb75b1a2d7c195e69450b4" }, "downloads": -1, "filename": "pyicontract-lint-1.2.1.tar.gz", "has_sig": false, "md5_digest": "e78f1aa13503dbcbb2c06b158753caf7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11165, "upload_time": "2018-10-21T05:43:58", "url": "https://files.pythonhosted.org/packages/3c/39/616465ae167b146eb07907b65db0e64dd72dc52146e6ba52f6d7a04a6bbd/pyicontract-lint-1.2.1.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "c35fe350197e8004745888e67ad7229f", "sha256": "a1e9591ab19deeb48b16b239d9254bfb95a2af6ecad780596131f767c4dd73ee" }, "downloads": -1, "filename": "pyicontract-lint-2.0.0.tar.gz", "has_sig": false, "md5_digest": "c35fe350197e8004745888e67ad7229f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11160, "upload_time": "2018-10-24T05:24:30", "url": "https://files.pythonhosted.org/packages/98/27/3e3a2482cc244804e254e2da0afe396cbd02d965bab93c271d4569f1d818/pyicontract-lint-2.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c35fe350197e8004745888e67ad7229f", "sha256": "a1e9591ab19deeb48b16b239d9254bfb95a2af6ecad780596131f767c4dd73ee" }, "downloads": -1, "filename": "pyicontract-lint-2.0.0.tar.gz", "has_sig": false, "md5_digest": "c35fe350197e8004745888e67ad7229f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11160, "upload_time": "2018-10-24T05:24:30", "url": "https://files.pythonhosted.org/packages/98/27/3e3a2482cc244804e254e2da0afe396cbd02d965bab93c271d4569f1d818/pyicontract-lint-2.0.0.tar.gz" } ] }